diff options
author | cretin45 <cretin45@gmail.com> | 2014-11-06 10:45:18 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2014-11-06 10:45:18 -0800 |
commit | 84f8765dfc20cba00981e9abb8d86e4665b61486 (patch) | |
tree | 81e77fb024bb71497c7581cfd02ea08c2e8c6f7d | |
parent | 9a281de7ad38b6ac4b3c9b4a7cf704008e7333e3 (diff) | |
download | android_packages_apps_Dialer-84f8765dfc20cba00981e9abb8d86e4665b61486.tar.gz android_packages_apps_Dialer-84f8765dfc20cba00981e9abb8d86e4665b61486.tar.bz2 android_packages_apps_Dialer-84f8765dfc20cba00981e9abb8d86e4665b61486.zip |
Dialer: Filter IP call from call log context menu if config is false
Change-Id: I3b8852894d91aae8ef1bbdeffaea5077047f4c5e
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index dc3dfd434..ce024771b 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -32,6 +32,7 @@ import android.provider.CallLog.Calls; import android.provider.ContactsContract; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Intents.Insert; +import android.provider.Settings; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; import android.view.ContextMenu; @@ -287,22 +288,27 @@ public class CallLogFragment extends ListFragment final MenuItem editBeforeCallMenuItem = menu.findItem(R.id.menu_edit_before_call); final MenuItem sendTextMessageMenuItem = menu.findItem(R.id.menu_send_text_message); final MenuItem addToContactMenuItem = menu.findItem(R.id.menu_add_to_contacts); - + final boolean isIPPrefixEnabled = + getResources().getBoolean(R.bool.config_ip_prefix_enable); AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; mNumber = getValidCallLogNumber(info.position); menu.setHeaderTitle(mNumber); - if (MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB1)) { + if (isIPPrefixEnabled && MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB1)) { String sub1Name = MoreContactUtils.getSimSpnName(MSimConstants.SUB1); + sub1Name = Settings.Global.getSimNameForSubscription(getActivity(), + MSimConstants.SUB1, sub1Name); ipCallBySlot1MenuItem.setTitle(getActivity().getString( com.android.contacts.common.R.string.ip_call_by_slot, sub1Name)); ipCallBySlot1MenuItem.setVisible(true); } else { ipCallBySlot1MenuItem.setVisible(false); } - if (MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB2)) { + if (isIPPrefixEnabled && MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB2)) { String sub2Name = MoreContactUtils.getSimSpnName(MSimConstants.SUB2); + sub2Name = Settings.Global.getSimNameForSubscription(getActivity(), + MSimConstants.SUB2, sub2Name); ipCallBySlot2MenuItem.setTitle(getActivity().getString( com.android.contacts.common.R.string.ip_call_by_slot, sub2Name)); ipCallBySlot2MenuItem.setVisible(true); |