Loading src/com/android/dialer/CallDetailActivity.java +3 −3 Original line number Diff line number Diff line Loading @@ -419,7 +419,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe final int numberPresentation = firstDetails.numberPresentation; final Uri contactUri = firstDetails.contactUri; final Uri photoUri = firstDetails.photoUri; final long subId = firstDetails.accountId; final int subId = firstDetails.accountId; // Cache the details about the phone number. final boolean canPlaceCallsTo = Loading Loading @@ -545,9 +545,9 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe callCursor.getString(ACCOUNT_COMPONENT_NAME), callCursor.getString(ACCOUNT_ID))); String accId = callCursor.getString(ACCOUNT_ID); long subId = SubscriptionManager.DEFAULT_SUB_ID; int subId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID; if (accId!=null && !accId.equals("E") && !accId.toLowerCase().contains("sip")) { subId = Long.parseLong(accId); subId = Integer.parseInt(accId); } if (TextUtils.isEmpty(countryIso)) { Loading src/com/android/dialer/DialtactsActivity.java +56 −11 Original line number Diff line number Diff line Loading @@ -183,6 +183,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private ListsFragment mListsFragment; /** * Tracks whether onSaveInstanceState has been called. If true, no fragment transactions can * be commited. */ private boolean mStateSaved; private boolean mInDialpadSearch; private boolean mInRegularSearch; private boolean mClearSearchOnPause; Loading Loading @@ -232,6 +237,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private int mActionBarHeight; /** * The text returned from a voice search query. Set in {@link #onActivityResult} and used in * {@link #onResume()} to populate the search box. */ private String mVoiceSearchQuery; private class OptionsPopupMenu extends PopupMenu { public OptionsPopupMenu(Context context, View anchor) { super(context, anchor, Gravity.END); Loading Loading @@ -473,6 +484,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override protected void onResume() { super.onResume(); mStateSaved = false; if (mFirstLaunch) { displayFragment(getIntent()); } else if (!phoneIsInUse() && mInCallDialpadUp) { Loading @@ -482,6 +494,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O showDialpadFragment(false); mShowDialpadOnResume = false; } // If there was a voice query result returned in the {@link #onActivityResult} callback, it // will have been stashed in mVoiceSearchQuery since the search results fragment cannot be // shown until onResume has completed. Active the search UI and set the search term now. if (!TextUtils.isEmpty(mVoiceSearchQuery)) { mActionBarController.onSearchBoxTapped(); mSearchView.setText(mVoiceSearchQuery); mVoiceSearchQuery = null; } mFirstLaunch = false; prepareVoiceSearchButton(); mDialerDatabaseHelper.startSmartDialUpdateThread(); Loading @@ -496,6 +518,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O hideDialpadAndSearchUi(); mClearSearchOnPause = false; } if (mSlideOut.hasStarted() && !mSlideOut.hasEnded()) { commitDialpadFragmentHide(); } super.onPause(); } Loading @@ -508,6 +533,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O outState.putBoolean(KEY_FIRST_LAUNCH, mFirstLaunch); outState.putBoolean(KEY_IS_DIALPAD_SHOWN, mIsDialpadShown); mActionBarController.saveInstanceState(outState); mStateSaved = true; } @Override Loading Loading @@ -627,7 +653,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O RecognizerIntent.EXTRA_RESULTS); if (matches.size() > 0) { final String match = matches.get(0); mSearchView.setText(match); mVoiceSearchQuery = match; } else { Log.e(TAG, "Voice search - nothing heard"); } Loading @@ -644,7 +670,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * @see #onDialpadShown */ private void showDialpadFragment(boolean animate) { if (mIsDialpadShown) { if (mIsDialpadShown || mStateSaved) { return; } mIsDialpadShown = true; Loading Loading @@ -730,10 +756,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * Finishes hiding the dialpad fragment after any animations are completed. */ public void commitDialpadFragmentHide() { if (!mStateSaved && !mDialpadFragment.isHidden()) { final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.hide(mDialpadFragment); ft.commit(); } mFloatingActionButtonController.scaleIn(AnimUtils.NO_DELAY); } Loading Loading @@ -852,6 +879,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onNewIntent(Intent newIntent) { setIntent(newIntent); mStateSaved = false; displayFragment(newIntent); invalidateOptionsMenu(); Loading Loading @@ -886,7 +914,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * Shows the search fragment */ private void enterSearchUi(boolean smartDialSearch, String query) { if (getFragmentManager().isDestroyed()) { if (mStateSaved || getFragmentManager().isDestroyed()) { // Weird race condition where fragment is doing work after the activity is destroyed // due to talkback being on (b/10209937). Just return since we can't do any // constructive here. Loading Loading @@ -939,7 +967,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private void exitSearchUi() { // See related bug in enterSearchUI(); if (getFragmentManager().isDestroyed()) { if (getFragmentManager().isDestroyed() || mStateSaved) { return; } Loading Loading @@ -969,6 +997,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onBackPressed() { if (mStateSaved) { return; } setConferenceDialButtonImage(false); setConferenceDialButtonVisibility(true); boolean mIsRecipientsShown = mDialpadFragment.isRecipientsShown(); Loading Loading @@ -1048,7 +1079,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void setConferenceDialButtonVisibility(boolean enabled) { boolean imsUseEnabled = ImsManager.isEnhanced4gLteModeSettingEnabledByPlatform(this) && ImsManager.isVolteEnabledByPlatform(this) && ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this); if(mConferenceDialButton != null) { mConferenceDialButton.setVisibility((enabled && imsUseEnabled) ? Loading Loading @@ -1077,8 +1108,22 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } public static Intent getAddNumberToContactIntent(CharSequence text) { final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.putExtra(Intents.Insert.PHONE, text); return getAddToContactIntent(null /* name */, text /* phoneNumber */, -1 /* phoneNumberType */); } public static Intent getAddToContactIntent(CharSequence name, CharSequence phoneNumber, int phoneNumberType) { Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.putExtra(Intents.Insert.PHONE, phoneNumber); // Only include the name and phone type extras if they are specified (the method // getAddNumberToContactIntent does not use them). if (name != null) { intent.putExtra(Intents.Insert.NAME, name); } if (phoneNumberType != -1) { intent.putExtra(Intents.Insert.PHONE_TYPE, phoneNumberType); } intent.setType(Contacts.CONTENT_ITEM_TYPE); return intent; } Loading src/com/android/dialer/PhoneCallDetails.java +3 −3 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ public class PhoneCallDetails { /** * The account id associated with the call. */ public final long accountId; public final int accountId; /** * Features applicable to this call. */ Loading Loading @@ -123,7 +123,7 @@ public class PhoneCallDetails { public PhoneCallDetails(CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, int[] callTypes, long date, long duration, String accountLabel, Drawable accountIcon, int features, Long dataUsage, String transcription, long accountId) { int features, Long dataUsage, String transcription, int accountId) { this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, "", 0, "", null, null, 0, accountLabel, accountIcon, features, dataUsage, transcription, accountId); Loading @@ -146,7 +146,7 @@ public class PhoneCallDetails { int[] callTypes, long date, long duration, CharSequence name, int numberType, CharSequence numberLabel, Uri contactUri, Uri photoUri, int sourceType, String accountLabel, Drawable accountIcon, int features, Long dataUsage, String transcription, long accountId) { Long dataUsage, String transcription, int accountId) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; Loading src/com/android/dialer/SpecialCharSequenceMgr.java +5 −5 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ public class SpecialCharSequenceMgr { sc.progressDialog.show(); // run the query. long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); Uri uri = Uri.parse("content://icc/adn/subId/" + subId); handler.startQuery(ADN_QUERY_TOKEN, sc, uri, new String[]{ADN_PHONE_NUMBER_COLUMN_NAME}, null, null, null); Loading @@ -231,7 +231,7 @@ public class SpecialCharSequenceMgr { static boolean handlePinEntry(Context context, String input) { if ((input.startsWith("**04") || input.startsWith("**05")) && input.endsWith("#")) { long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); try { return ITelephony.Stub.asInterface(ServiceManager.getService( Context.TELEPHONY_SERVICE)).handlePinMmiForSubscriber(subId, input); Loading @@ -248,7 +248,7 @@ public class SpecialCharSequenceMgr { (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (telephonyManager != null && input.equals(MMI_IMEI_DISPLAY)) { int phoneType; long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); phoneType = telephonyManager.getCurrentPhoneType(subId); if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { showIMEIPanel(context, useSystemWindow, telephonyManager); Loading Loading @@ -285,7 +285,7 @@ public class SpecialCharSequenceMgr { private static void showIMEIPanel(Context context, boolean useSystemWindow, TelephonyManager telephonyManager) { String imeiStr = null; long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); int slotId = SubscriptionManager.getSlotId(subId); imeiStr = telephonyManager.getDeviceId(slotId); Loading @@ -300,7 +300,7 @@ public class SpecialCharSequenceMgr { private static void showMEIDPanel(Context context, boolean useSystemWindow, TelephonyManager telephonyManager) { String meidStr = null; long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); int slotId = SubscriptionManager.getSlotId(subId); meidStr = telephonyManager.getDeviceId(slotId); Loading src/com/android/dialer/calllog/CallLogActivity.java +23 −8 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.ViewGroup; import com.android.contacts.common.interactions.TouchPointManager; import com.android.contacts.common.list.ViewPagerTabs; Loading Loading @@ -88,18 +89,33 @@ public class CallLogActivity extends AnalyticsActivity implements CallLogQueryHa public Fragment getItem(int position) { switch (position) { case TAB_INDEX_ALL: mAllCallsFragment = new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL); return mAllCallsFragment; return new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL); case TAB_INDEX_MISSED: mMissedCallsFragment = new CallLogFragment(Calls.MISSED_TYPE); return mMissedCallsFragment; return new CallLogFragment(Calls.MISSED_TYPE); case TAB_INDEX_VOICEMAIL: mVoicemailFragment = new CallLogFragment(Calls.VOICEMAIL_TYPE); return mVoicemailFragment; return new CallLogFragment(Calls.VOICEMAIL_TYPE); } throw new IllegalStateException("No fragment at position " + position); } @Override public Object instantiateItem(ViewGroup container, int position) { final CallLogFragment fragment = (CallLogFragment) super.instantiateItem(container, position); switch (position) { case TAB_INDEX_ALL: mAllCallsFragment = fragment; break; case TAB_INDEX_MISSED: mMissedCallsFragment = fragment; break; case TAB_INDEX_VOICEMAIL: mVoicemailFragment = fragment; break; } return fragment; } @Override public CharSequence getPageTitle(int position) { return mTabTitles[position]; Loading Loading @@ -243,9 +259,8 @@ public class CallLogActivity extends AnalyticsActivity implements CallLogQueryHa @Override public boolean onPrepareOptionsMenu(Menu menu) { final MenuItem itemDeleteAll = menu.findItem(R.id.delete_all); // If onPrepareOptionsMenu is called before fragments loaded. Don't do anything. if (mAllCallsFragment != null && itemDeleteAll != null) { // If onPrepareOptionsMenu is called before fragments are loaded, don't do anything. final CallLogAdapter adapter = mAllCallsFragment.getAdapter(); itemDeleteAll.setVisible(adapter != null && !adapter.isEmpty()); } Loading Loading
src/com/android/dialer/CallDetailActivity.java +3 −3 Original line number Diff line number Diff line Loading @@ -419,7 +419,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe final int numberPresentation = firstDetails.numberPresentation; final Uri contactUri = firstDetails.contactUri; final Uri photoUri = firstDetails.photoUri; final long subId = firstDetails.accountId; final int subId = firstDetails.accountId; // Cache the details about the phone number. final boolean canPlaceCallsTo = Loading Loading @@ -545,9 +545,9 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe callCursor.getString(ACCOUNT_COMPONENT_NAME), callCursor.getString(ACCOUNT_ID))); String accId = callCursor.getString(ACCOUNT_ID); long subId = SubscriptionManager.DEFAULT_SUB_ID; int subId = SubscriptionManager.DEFAULT_SUBSCRIPTION_ID; if (accId!=null && !accId.equals("E") && !accId.toLowerCase().contains("sip")) { subId = Long.parseLong(accId); subId = Integer.parseInt(accId); } if (TextUtils.isEmpty(countryIso)) { Loading
src/com/android/dialer/DialtactsActivity.java +56 −11 Original line number Diff line number Diff line Loading @@ -183,6 +183,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private ListsFragment mListsFragment; /** * Tracks whether onSaveInstanceState has been called. If true, no fragment transactions can * be commited. */ private boolean mStateSaved; private boolean mInDialpadSearch; private boolean mInRegularSearch; private boolean mClearSearchOnPause; Loading Loading @@ -232,6 +237,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O private int mActionBarHeight; /** * The text returned from a voice search query. Set in {@link #onActivityResult} and used in * {@link #onResume()} to populate the search box. */ private String mVoiceSearchQuery; private class OptionsPopupMenu extends PopupMenu { public OptionsPopupMenu(Context context, View anchor) { super(context, anchor, Gravity.END); Loading Loading @@ -473,6 +484,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override protected void onResume() { super.onResume(); mStateSaved = false; if (mFirstLaunch) { displayFragment(getIntent()); } else if (!phoneIsInUse() && mInCallDialpadUp) { Loading @@ -482,6 +494,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O showDialpadFragment(false); mShowDialpadOnResume = false; } // If there was a voice query result returned in the {@link #onActivityResult} callback, it // will have been stashed in mVoiceSearchQuery since the search results fragment cannot be // shown until onResume has completed. Active the search UI and set the search term now. if (!TextUtils.isEmpty(mVoiceSearchQuery)) { mActionBarController.onSearchBoxTapped(); mSearchView.setText(mVoiceSearchQuery); mVoiceSearchQuery = null; } mFirstLaunch = false; prepareVoiceSearchButton(); mDialerDatabaseHelper.startSmartDialUpdateThread(); Loading @@ -496,6 +518,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O hideDialpadAndSearchUi(); mClearSearchOnPause = false; } if (mSlideOut.hasStarted() && !mSlideOut.hasEnded()) { commitDialpadFragmentHide(); } super.onPause(); } Loading @@ -508,6 +533,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O outState.putBoolean(KEY_FIRST_LAUNCH, mFirstLaunch); outState.putBoolean(KEY_IS_DIALPAD_SHOWN, mIsDialpadShown); mActionBarController.saveInstanceState(outState); mStateSaved = true; } @Override Loading Loading @@ -627,7 +653,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O RecognizerIntent.EXTRA_RESULTS); if (matches.size() > 0) { final String match = matches.get(0); mSearchView.setText(match); mVoiceSearchQuery = match; } else { Log.e(TAG, "Voice search - nothing heard"); } Loading @@ -644,7 +670,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * @see #onDialpadShown */ private void showDialpadFragment(boolean animate) { if (mIsDialpadShown) { if (mIsDialpadShown || mStateSaved) { return; } mIsDialpadShown = true; Loading Loading @@ -730,10 +756,11 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * Finishes hiding the dialpad fragment after any animations are completed. */ public void commitDialpadFragmentHide() { if (!mStateSaved && !mDialpadFragment.isHidden()) { final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.hide(mDialpadFragment); ft.commit(); } mFloatingActionButtonController.scaleIn(AnimUtils.NO_DELAY); } Loading Loading @@ -852,6 +879,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onNewIntent(Intent newIntent) { setIntent(newIntent); mStateSaved = false; displayFragment(newIntent); invalidateOptionsMenu(); Loading Loading @@ -886,7 +914,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O * Shows the search fragment */ private void enterSearchUi(boolean smartDialSearch, String query) { if (getFragmentManager().isDestroyed()) { if (mStateSaved || getFragmentManager().isDestroyed()) { // Weird race condition where fragment is doing work after the activity is destroyed // due to talkback being on (b/10209937). Just return since we can't do any // constructive here. Loading Loading @@ -939,7 +967,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private void exitSearchUi() { // See related bug in enterSearchUI(); if (getFragmentManager().isDestroyed()) { if (getFragmentManager().isDestroyed() || mStateSaved) { return; } Loading Loading @@ -969,6 +997,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void onBackPressed() { if (mStateSaved) { return; } setConferenceDialButtonImage(false); setConferenceDialButtonVisibility(true); boolean mIsRecipientsShown = mDialpadFragment.isRecipientsShown(); Loading Loading @@ -1048,7 +1079,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public void setConferenceDialButtonVisibility(boolean enabled) { boolean imsUseEnabled = ImsManager.isEnhanced4gLteModeSettingEnabledByPlatform(this) && ImsManager.isVolteEnabledByPlatform(this) && ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this); if(mConferenceDialButton != null) { mConferenceDialButton.setVisibility((enabled && imsUseEnabled) ? Loading Loading @@ -1077,8 +1108,22 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } public static Intent getAddNumberToContactIntent(CharSequence text) { final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.putExtra(Intents.Insert.PHONE, text); return getAddToContactIntent(null /* name */, text /* phoneNumber */, -1 /* phoneNumberType */); } public static Intent getAddToContactIntent(CharSequence name, CharSequence phoneNumber, int phoneNumberType) { Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT); intent.putExtra(Intents.Insert.PHONE, phoneNumber); // Only include the name and phone type extras if they are specified (the method // getAddNumberToContactIntent does not use them). if (name != null) { intent.putExtra(Intents.Insert.NAME, name); } if (phoneNumberType != -1) { intent.putExtra(Intents.Insert.PHONE_TYPE, phoneNumberType); } intent.setType(Contacts.CONTENT_ITEM_TYPE); return intent; } Loading
src/com/android/dialer/PhoneCallDetails.java +3 −3 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ public class PhoneCallDetails { /** * The account id associated with the call. */ public final long accountId; public final int accountId; /** * Features applicable to this call. */ Loading Loading @@ -123,7 +123,7 @@ public class PhoneCallDetails { public PhoneCallDetails(CharSequence number, int numberPresentation, CharSequence formattedNumber, String countryIso, String geocode, int[] callTypes, long date, long duration, String accountLabel, Drawable accountIcon, int features, Long dataUsage, String transcription, long accountId) { int features, Long dataUsage, String transcription, int accountId) { this(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, "", 0, "", null, null, 0, accountLabel, accountIcon, features, dataUsage, transcription, accountId); Loading @@ -146,7 +146,7 @@ public class PhoneCallDetails { int[] callTypes, long date, long duration, CharSequence name, int numberType, CharSequence numberLabel, Uri contactUri, Uri photoUri, int sourceType, String accountLabel, Drawable accountIcon, int features, Long dataUsage, String transcription, long accountId) { Long dataUsage, String transcription, int accountId) { this.number = number; this.numberPresentation = numberPresentation; this.formattedNumber = formattedNumber; Loading
src/com/android/dialer/SpecialCharSequenceMgr.java +5 −5 Original line number Diff line number Diff line Loading @@ -211,7 +211,7 @@ public class SpecialCharSequenceMgr { sc.progressDialog.show(); // run the query. long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); Uri uri = Uri.parse("content://icc/adn/subId/" + subId); handler.startQuery(ADN_QUERY_TOKEN, sc, uri, new String[]{ADN_PHONE_NUMBER_COLUMN_NAME}, null, null, null); Loading @@ -231,7 +231,7 @@ public class SpecialCharSequenceMgr { static boolean handlePinEntry(Context context, String input) { if ((input.startsWith("**04") || input.startsWith("**05")) && input.endsWith("#")) { long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); try { return ITelephony.Stub.asInterface(ServiceManager.getService( Context.TELEPHONY_SERVICE)).handlePinMmiForSubscriber(subId, input); Loading @@ -248,7 +248,7 @@ public class SpecialCharSequenceMgr { (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (telephonyManager != null && input.equals(MMI_IMEI_DISPLAY)) { int phoneType; long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); phoneType = telephonyManager.getCurrentPhoneType(subId); if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { showIMEIPanel(context, useSystemWindow, telephonyManager); Loading Loading @@ -285,7 +285,7 @@ public class SpecialCharSequenceMgr { private static void showIMEIPanel(Context context, boolean useSystemWindow, TelephonyManager telephonyManager) { String imeiStr = null; long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); int slotId = SubscriptionManager.getSlotId(subId); imeiStr = telephonyManager.getDeviceId(slotId); Loading @@ -300,7 +300,7 @@ public class SpecialCharSequenceMgr { private static void showMEIDPanel(Context context, boolean useSystemWindow, TelephonyManager telephonyManager) { String meidStr = null; long subId = SubscriptionManager.getDefaultVoiceSubId(); int subId = SubscriptionManager.getDefaultVoiceSubId(); int slotId = SubscriptionManager.getSlotId(subId); meidStr = telephonyManager.getDeviceId(slotId); Loading
src/com/android/dialer/calllog/CallLogActivity.java +23 −8 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.ViewGroup; import com.android.contacts.common.interactions.TouchPointManager; import com.android.contacts.common.list.ViewPagerTabs; Loading Loading @@ -88,18 +89,33 @@ public class CallLogActivity extends AnalyticsActivity implements CallLogQueryHa public Fragment getItem(int position) { switch (position) { case TAB_INDEX_ALL: mAllCallsFragment = new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL); return mAllCallsFragment; return new CallLogFragment(CallLogQueryHandler.CALL_TYPE_ALL); case TAB_INDEX_MISSED: mMissedCallsFragment = new CallLogFragment(Calls.MISSED_TYPE); return mMissedCallsFragment; return new CallLogFragment(Calls.MISSED_TYPE); case TAB_INDEX_VOICEMAIL: mVoicemailFragment = new CallLogFragment(Calls.VOICEMAIL_TYPE); return mVoicemailFragment; return new CallLogFragment(Calls.VOICEMAIL_TYPE); } throw new IllegalStateException("No fragment at position " + position); } @Override public Object instantiateItem(ViewGroup container, int position) { final CallLogFragment fragment = (CallLogFragment) super.instantiateItem(container, position); switch (position) { case TAB_INDEX_ALL: mAllCallsFragment = fragment; break; case TAB_INDEX_MISSED: mMissedCallsFragment = fragment; break; case TAB_INDEX_VOICEMAIL: mVoicemailFragment = fragment; break; } return fragment; } @Override public CharSequence getPageTitle(int position) { return mTabTitles[position]; Loading Loading @@ -243,9 +259,8 @@ public class CallLogActivity extends AnalyticsActivity implements CallLogQueryHa @Override public boolean onPrepareOptionsMenu(Menu menu) { final MenuItem itemDeleteAll = menu.findItem(R.id.delete_all); // If onPrepareOptionsMenu is called before fragments loaded. Don't do anything. if (mAllCallsFragment != null && itemDeleteAll != null) { // If onPrepareOptionsMenu is called before fragments are loaded, don't do anything. final CallLogAdapter adapter = mAllCallsFragment.getAdapter(); itemDeleteAll.setVisible(adapter != null && !adapter.isEmpty()); } Loading