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

Commit f24f7ecb authored by Qing Zhong's avatar Qing Zhong Committed by Android (Google) Code Review
Browse files

Merge "Use phone account to skip caller info" into main

parents c00fa9f1 b30422d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@
    <!-- When true, skip fetching quick reply response -->
    <bool name="skip_loading_canned_text_response">false</bool>

    <!-- When true, skip fetching incoming caller info -->
    <bool name="skip_incoming_caller_info_query">false</bool>
    <!-- When set, telecom will skip fetching incoming caller info for this account -->
    <string name="skip_incoming_caller_info_account_package"></string>

    <string-array name="system_bluetooth_stack_package_name" translatable="false">
        <!-- AOSP -->
+5 −3
Original line number Diff line number Diff line
@@ -931,7 +931,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        mLock = lock;
        mRepository = repository;
        mPhoneNumberUtilsAdapter = phoneNumberUtilsAdapter;
        setHandle(handle);
        mParticipants = participants;
        mPostDialDigits = handle != null
                ? PhoneNumberUtils.extractPostDialPortion(handle.getSchemeSpecificPart()) : "";
@@ -939,6 +938,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        setConnectionManagerPhoneAccount(connectionManagerPhoneAccountHandle);
        mCallDirection = callDirection;
        setTargetPhoneAccount(targetPhoneAccountHandle);
        setHandle(handle);
        mIsConference = isConference;
        mShouldAttachToExistingConnection = shouldAttachToExistingConnection
                || callDirection == CALL_DIRECTION_INCOMING;
@@ -1611,7 +1611,9 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
                mIsTestEmergencyCall = mHandle != null &&
                        isTestEmergencyCall(mHandle.getSchemeSpecificPart());
            }
            if (!mContext.getResources().getBoolean(R.bool.skip_incoming_caller_info_query)) {
            if (mTargetPhoneAccountHandle == null || !mContext.getResources().getString(
                    R.string.skip_incoming_caller_info_account_package).equalsIgnoreCase(
                    mTargetPhoneAccountHandle.getComponentName().getPackageName())) {
                startCallerInfoLookup();
            } else {
                Log.i(this, "skip incoming caller info lookup");
+4 −4
Original line number Diff line number Diff line
@@ -130,8 +130,8 @@ public class CallTest extends TelecomTestCase {
        Resources mockResources = mContext.getResources();
        when(mockResources.getBoolean(R.bool.skip_loading_canned_text_response))
                .thenReturn(false);
        when(mockResources.getBoolean(R.bool.skip_incoming_caller_info_query))
                .thenReturn(false);
        when(mockResources.getString(R.string.skip_incoming_caller_info_account_package))
                .thenReturn("");
        EmergencyCallHelper helper = mock(EmergencyCallHelper.class);
        doReturn(helper).when(mMockCallsManager).getEmergencyCallHelper();
    }
@@ -694,8 +694,8 @@ public class CallTest extends TelecomTestCase {
    @SmallTest
    public void testGetFromCallerInfo_skipLookup() {
        Resources mockResources = mContext.getResources();
        when(mockResources.getBoolean(R.bool.skip_incoming_caller_info_query))
                .thenReturn(true);
        when(mockResources.getString(R.string.skip_incoming_caller_info_account_package))
                .thenReturn("com.foo");

        createCall("1");