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

Commit b30422d4 authored by qing's avatar qing Committed by Qing Zhong
Browse files

Use phone account to skip caller info

Previously boolean flag is used to skip caller info, but this will cause wear watch shows empty call number/caller name even for cellular call missed call notification.
We should only skip caller info for bridged calls, missed call notification will be bridged phone.

Bug: 352496288
Test: Manual test + unit test
Flag: EXEMPT bugfix
Change-Id: I7089da8c5282ada137d3937dcbd36cdaf9c1c9ad
parent 40afe69d
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");