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

Commit 6b1346ab authored by Zoey Chen's avatar Zoey Chen
Browse files

[Telephony] Update the permission of event list

Bug: 182478738
Test: atest TelephonyRegistryTest
Change-Id: I371a2ef974910a3025b67bd11fe496b16871ea1e
parent c30a4d38
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -90,14 +90,9 @@ public class TelephonyRegistryTest extends TelephonyTest {
    private static final Set<Integer> READ_PHONE_STATE_EVENTS;
    static {
        READ_PHONE_STATE_EVENTS = new HashSet<>();
        READ_PHONE_STATE_EVENTS.add(
                TelephonyCallback.EVENT_CALL_FORWARDING_INDICATOR_CHANGED);
        READ_PHONE_STATE_EVENTS.add(
                TelephonyCallback.EVENT_MESSAGE_WAITING_INDICATOR_CHANGED);
        READ_PHONE_STATE_EVENTS.add(
                TelephonyCallback.EVENT_EMERGENCY_NUMBER_LIST_CHANGED);
        READ_PHONE_STATE_EVENTS.add(
                TelephonyCallback.EVENT_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGED);
        READ_PHONE_STATE_EVENTS.add(TelephonyCallback.EVENT_CALL_FORWARDING_INDICATOR_CHANGED);
        READ_PHONE_STATE_EVENTS.add(TelephonyCallback.EVENT_MESSAGE_WAITING_INDICATOR_CHANGED);
        READ_PHONE_STATE_EVENTS.add(TelephonyCallback.EVENT_EMERGENCY_NUMBER_LIST_CHANGED);
    }

    // All events contribute to TelephonyRegistry#isPrecisePhoneStatePermissionRequired
@@ -131,6 +126,8 @@ public class TelephonyRegistryTest extends TelephonyTest {
        READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_RADIO_POWER_STATE_CHANGED);
        READ_PRIVILEGED_PHONE_STATE_EVENTS.add(
                TelephonyCallback.EVENT_VOICE_ACTIVATION_STATE_CHANGED);
        READ_PRIVILEGED_PHONE_STATE_EVENTS.add(
                TelephonyCallback.EVENT_ALLOWED_NETWORK_TYPE_LIST_CHANGED);
    }

    // All events contribute to TelephonyRegistry#isActiveEmergencySessionPermissionRequired
@@ -219,6 +216,14 @@ public class TelephonyRegistryTest extends TelephonyTest {
                .thenReturn(false);
        when(mMockConfigurationProvider.isCallStateReadPhoneStateEnforcedInPlatformCompat(
                anyString(), any())).thenReturn(false);
        when(mMockConfigurationProvider.isActiveDataSubIdReadPhoneStateEnforcedInPlatformCompat(
                anyString(), any())).thenReturn(false);
        when(mMockConfigurationProvider.isCellInfoReadPhoneStateEnforcedInPlatformCompat(
                anyString(), any())).thenReturn(false);
        when(mMockConfigurationProvider.isDisplayInfoReadPhoneStateEnforcedInPlatformCompat(
                anyString(), any())).thenReturn(false);
        when(mMockConfigurationProvider.isDisplayInfoNrAdvancedSupported(
                anyString(), any())).thenReturn(false);
        mTelephonyRegistry = new TelephonyRegistry(mContext, mMockConfigurationProvider);
        addTelephonyRegistryService();
        mTelephonyCallback = new TelephonyCallbackWrapper();