Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ffbe550 authored by Sudhir Sharma's avatar Sudhir Sharma
Browse files

Merge tag 'AU_LINUX_ANDROID_LA.BF64.1.2.1_RB2.05.00.02.081.002' into HEAD

"AU_LINUX_ANDROID_LA.BF64.1.2.1_RB2.05.00.02.081.002"

* tag 'AU_LINUX_ANDROID_LA.BF64.1.2.1_RB2.05.00.02.081.002': (21 commits)
  IMS LMR1 Compilation Fixes
  Fix compilation
  Fix crasher due to IndexOutOfBoundsException
  Fix for clear call log dialog not being dismissed
  Handle SQLiteFullExceptions
  Fix ClassCastException in CallLogFragment
  Fix potential NPE when generating accessibility text.
  Telephony: Disable circularRevealActivity
  Telephony: Compilation fix for subId conversion from long to int.
  Updating "Add Contact" to pre-populate full contact info.
  Improve outgoing call UI responsiveness
  Fix NPE in markDropArea
  Correcting population of search box with voice search results.
  Move ToneGenerator recreation/release to onStart/onStop
  Fix IOOB exception in ViewDragHelper
  Fix for "Clear call log" menu item showing up incorrectly.
  Reset mSavedState in onNewIntent because the activity is refreshing.
  Protect against ActivityNotFoundException
  Fix various IllegalStateExceptions in Dialer
  Fix NPEs in ActionBarControllerTest
  ...

Change-Id: Ic4365f85a8b8e8bbbb23289fe9a22f16b40256df
parents 5b4258ad fc470d12
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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 =
@@ -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)) {
+56 −11
Original line number Diff line number Diff line
@@ -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;
@@ -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);
@@ -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) {
@@ -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();
@@ -496,6 +518,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
            hideDialpadAndSearchUi();
            mClearSearchOnPause = false;
        }
        if (mSlideOut.hasStarted() && !mSlideOut.hasEnded()) {
            commitDialpadFragmentHide();
        }
        super.onPause();
    }

@@ -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
@@ -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");
                }
@@ -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;
@@ -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);
    }

@@ -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();
@@ -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.
@@ -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;
        }

@@ -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();
@@ -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) ?
@@ -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;
    }
+3 −3
Original line number Diff line number Diff line
@@ -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.
     */
@@ -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);
@@ -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;
+5 −5
Original line number Diff line number Diff line
@@ -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);
@@ -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);
@@ -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);
@@ -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);

@@ -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);

+23 −8
Original line number Diff line number Diff line
@@ -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;
@@ -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];
@@ -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