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

Commit aaa411b7 authored by Matt Garnes's avatar Matt Garnes
Browse files

Merge remote-tracking branch 'caf/LA.BR.1.2.3_1' into caf/cm-12.1

parents 61899450 77e9bb4b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@
                        android:layout_height="@dimen/call_provider_small_icon_size"
                        android:layout_marginEnd="@dimen/call_log_icon_margin"
                        android:layout_gravity="center_vertical"
                        android:tint="?attr/call_log_secondary_text_color"
                        android:scaleType="centerInside"
                        android:visibility="gone"
                        />
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
    <string name="call_log_incoming_header" msgid="2787722299753674684">"只显示来电"</string>
    <string name="call_log_outgoing_header" msgid="761009180766735769">"只显示外拨电话"</string>
    <string name="call_log_missed_header" msgid="8017148056610855956">"只显示未接来电"</string>
    <string name="call_log_blacklist_header">只显示黑名单来电</string>
    <string name="voicemail_status_voicemail_not_available" msgid="3021980206152528883">"无法连接到语音信箱服务器。"</string>
    <string name="voicemail_status_messages_waiting" msgid="7113421459602803605">"无法连接到语音信箱服务器。新的语音邮件正在等待接收。"</string>
    <string name="voicemail_status_configure_voicemail" msgid="3738537770636895689">"设置您的语音信箱。"</string>
+2 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@
    <style name="DialtactsActivityTheme" parent="DialtactsTheme">
        <item name="android:actionBarStyle">@style/DialtactsActionBarWithoutTitleStyle</item>
        <item name="android:fastScrollThumbDrawable">@drawable/fastscroll_thumb</item>

        <item name="android:fastScrollTrackDrawable">@null</item>
    </style>
    <!-- A theme for inflation of spinners in the dialtacts action bar -->
    <style name="DialtactsSpinnerTheme" parent="DialtactsTheme">
@@ -154,6 +154,7 @@
        <item name="android:height">@dimen/action_bar_height_large</item>
        <!-- Override ActionBar title offset to keep search box aligned left -->
        <item name="android:contentInsetStart">0px</item>
        <item name="android:contentInsetEnd">0px</item>
    </style>

    <!-- Text in the action bar at the top of the screen -->
+56 −10
Original line number Diff line number Diff line
@@ -187,6 +187,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;
@@ -236,6 +241,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);
@@ -483,6 +494,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) {
@@ -492,6 +504,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();
@@ -506,6 +528,9 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
            hideDialpadAndSearchUi();
            mClearSearchOnPause = false;
        }
        if (mSlideOut.hasStarted() && !mSlideOut.hasEnded()) {
            commitDialpadFragmentHide();
        }
        super.onPause();
    }

@@ -518,6 +543,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
@@ -645,7 +671,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");
                }
@@ -732,7 +758,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
     * @see #onDialpadShown
     */
    private void showDialpadFragment(boolean animate) {
        if (mIsDialpadShown) {
        if (mIsDialpadShown || mStateSaved) {
            return;
        }
        mIsDialpadShown = true;
@@ -818,10 +844,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);
    }

@@ -940,6 +967,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
    @Override
    public void onNewIntent(Intent newIntent) {
        setIntent(newIntent);
        mStateSaved = false;
        displayFragment(newIntent);

        invalidateOptionsMenu();
@@ -974,7 +1002,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.
@@ -1027,7 +1055,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
     */
    private void exitSearchUi() {
        // See related bug in enterSearchUI();
        if (getFragmentManager().isDestroyed() || !isSafeToCommitTransactions()) {
        if (getFragmentManager().isDestroyed() || mStateSaved) {
            return;
        }

@@ -1064,6 +1092,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
            mDialpadFragment.hideAndClearDialConference();
        }

        if (mStateSaved) {
            return;
        }

        if (mIsDialpadShown || mIsRecipientsShown) {
            if (TextUtils.isEmpty(mSearchQuery) ||
                    (mSmartDialSearchFragment != null && mSmartDialSearchFragment.isVisible()
@@ -1162,8 +1194,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;
    }
+22 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.dialer;

import android.content.Context;
import android.content.res.Resources;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
@@ -50,6 +51,7 @@ public class PhoneCallDetailsHelper {
    /** The maximum number of icons will be shown to represent the call types in a group. */
    private static final int MAX_CALL_TYPE_ICONS = 3;

    private final Context mContext;
    private final Resources mResources;
    /** The injected current time in milliseconds since the epoch. Used only by tests. */
    private Long mCurrentTimeMillisForTest;
@@ -69,8 +71,9 @@ public class PhoneCallDetailsHelper {
     *
     * @param resources used to look up strings
     */
    public PhoneCallDetailsHelper(Resources resources, CallTypeHelper callTypeHelper,
    public PhoneCallDetailsHelper(Context context, Resources resources,
            PhoneNumberUtilsWrapper phoneUtils) {
        mContext = context;
        mResources = resources;
        mPhoneNumberUtilsWrapper = phoneUtils;
        mPhoneNumberHelper = new PhoneNumberDisplayHelper(mPhoneNumberUtilsWrapper, resources);
@@ -129,6 +132,24 @@ public class PhoneCallDetailsHelper {
            views.callAccountIcon.setVisibility(View.GONE);
        }

        /*
        // Set the account label if it exists.
        String accountLabel = details.accountLabel;
        if (accountLabel != null) {
            views.callAccountLabel.setVisibility(View.VISIBLE);
            views.callAccountLabel.setText(accountLabel);
            int color = PhoneAccountUtils.getAccountColor(mContext, details.accountHandle);
            if (color == PhoneAccount.NO_HIGHLIGHT_COLOR) {
                int defaultColor = R.color.dialtacts_secondary_text_color;
                views.callAccountLabel.setTextColor(mContext.getResources().getColor(defaultColor));
            } else {
                views.callAccountLabel.setTextColor(color);
            }
        } else {
            views.callAccountLabel.setVisibility(View.GONE);
        }
        */

        CharSequence nameText;
        CharSequence displayNumber =
            mPhoneNumberHelper.getDisplayNumber(details.accountId, details.number,
Loading