Loading flags/network.aconfig +17 −0 Original line number Diff line number Diff line Loading @@ -93,3 +93,20 @@ flag { } } # OWNER=yomna TARGET=25Q2 flag { name: "security_algorithms_update_indications" is_exported: true namespace: "telephony" description: "guard system API onSecurityAlgorithmsChanged" bug: "355062720" } # OWNER=yomna TARGET=25Q2 flag { name: "cellular_identifier_disclosure_indications" is_exported: true namespace: "telephony" description: "guard system API onCellularIdentifierDisclosedChanged" bug: "355062720" } src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +19 −0 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.ServiceState; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager.DataEnabledReason; Loading Loading @@ -356,6 +358,23 @@ public class DefaultPhoneNotifier implements PhoneNotifier { sender.getSubId(), ntnSignalStrength); } @Override public void notifySecurityAlgorithmsChanged(Phone sender, SecurityAlgorithmUpdate update) { if (!mFeatureFlags.securityAlgorithmsUpdateIndications()) return; mTelephonyRegistryMgr.notifySecurityAlgorithmsChanged(sender.getPhoneId(), sender.getSubId(), update); } @Override public void notifyCellularIdentifierDisclosedChanged(Phone sender, CellularIdentifierDisclosure disclosure) { if (!mFeatureFlags.cellularIdentifierDisclosureIndications()) return; mTelephonyRegistryMgr.notifyCellularIdentifierDisclosedChanged(sender.getPhoneId(), sender.getSubId(), disclosure); } /** * Convert the {@link Call.State} enum into the PreciseCallState.PRECISE_CALL_STATE_* constants * for the public API. Loading src/java/com/android/internal/telephony/PhoneNotifier.java +9 −0 Original line number Diff line number Diff line Loading @@ -25,11 +25,13 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseDataConnectionState; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.ServiceState; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager.DataEnabledReason; Loading Loading @@ -174,4 +176,11 @@ public interface PhoneNotifier { /** Notify carrier roaming non-terrestrial network signal strength changed. */ void notifyCarrierRoamingNtnSignalStrengthChanged(Phone sender, @NonNull NtnSignalStrength ntnSignalStrength); /** Notify of a cellular identifier disclosure change. */ void notifyCellularIdentifierDisclosedChanged(Phone sender, CellularIdentifierDisclosure disclosure); /** Notify of a security algorithm update change. */ void notifySecurityAlgorithmsChanged(Phone sender, SecurityAlgorithmUpdate update); } tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java +39 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,12 @@ */ package com.android.internal.telephony; import static android.telephony.CellularIdentifierDisclosure.CELLULAR_IDENTIFIER_IMSI; import static android.telephony.CellularIdentifierDisclosure.NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST; import static android.telephony.SecurityAlgorithmUpdate.CONNECTION_EVENT_VOLTE_SIP; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_EEA2; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_HMAC_SHA1_96; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; Loading @@ -26,9 +32,11 @@ import static org.mockito.Mockito.verify; import android.telephony.CellIdentityGsm; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.DisconnectCause; import android.telephony.PreciseCallState; import android.telephony.PreciseDisconnectCause; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.SignalStrength; import android.telephony.TelephonyManager; import android.telephony.ims.ImsCallProfile; Loading Loading @@ -449,4 +457,35 @@ public class DefaultPhoneNotifierTest extends TelephonyTest { verify(mTelephonyRegistryManager).notifyCarrierRoamingNtnAvailableServicesChanged( eq(subId), eq(testServices)); } @Test @SmallTest public void testSecurityAlgorithmsChanged() { doReturn(true).when(mFeatureFlags).securityAlgorithmsUpdateIndications(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); SecurityAlgorithmUpdate update = new SecurityAlgorithmUpdate( CONNECTION_EVENT_VOLTE_SIP, SECURITY_ALGORITHM_EEA2, SECURITY_ALGORITHM_HMAC_SHA1_96, false); mDefaultPhoneNotifierUT.notifySecurityAlgorithmsChanged(mPhone, update); verify(mTelephonyRegistryManager).notifySecurityAlgorithmsChanged( eq(phoneId), eq(subId), eq(update)); } @Test @SmallTest public void testCellularIdentifierDisclosedChanged() { doReturn(true).when(mFeatureFlags).cellularIdentifierDisclosureIndications(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); CellularIdentifierDisclosure disclosure = new CellularIdentifierDisclosure(NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST, CELLULAR_IDENTIFIER_IMSI, "001001", false); mDefaultPhoneNotifierUT.notifyCellularIdentifierDisclosedChanged(mPhone, disclosure); verify(mTelephonyRegistryManager).notifyCellularIdentifierDisclosedChanged( eq(phoneId), eq(subId), eq(disclosure)); } } tests/telephonytests/src/com/android/internal/telephony/TelephonyRegistryTest.java +69 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,12 @@ */ package com.android.internal.telephony; import static android.telephony.CellularIdentifierDisclosure.CELLULAR_IDENTIFIER_IMSI; import static android.telephony.CellularIdentifierDisclosure.NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST; import static android.telephony.PhysicalChannelConfig.PHYSICAL_CELL_ID_UNKNOWN; import static android.telephony.SecurityAlgorithmUpdate.CONNECTION_EVENT_VOLTE_SIP; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_EEA2; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_HMAC_SHA1_96; import static android.telephony.ServiceState.FREQUENCY_RANGE_LOW; import static android.telephony.SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED; import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID; Loading Loading @@ -57,11 +62,13 @@ import android.telephony.CellIdentityLte; import android.telephony.CellInfo; import android.telephony.CellInfoLte; import android.telephony.CellLocation; import android.telephony.CellularIdentifierDisclosure; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseDataConnectionState; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; Loading Loading @@ -181,6 +188,10 @@ public class TelephonyRegistryTest extends TelephonyTest { TelephonyCallback.EVENT_EMERGENCY_CALLBACK_MODE_CHANGED); READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED); READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_CELLULAR_IDENTIFIER_DISCLOSED_CHANGED); READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_SECURITY_ALGORITHMS_CHANGED); } // All events contribute to TelephonyRegistry#isActiveEmergencySessionPermissionRequired Loading Loading @@ -211,7 +222,9 @@ public class TelephonyRegistryTest extends TelephonyTest { TelephonyCallback.DataActivityListener, TelephonyCallback.SimultaneousCellularCallingSupportListener, TelephonyCallback.EmergencyCallbackModeListener, TelephonyCallback.CarrierRoamingNtnModeListener { TelephonyCallback.CarrierRoamingNtnModeListener, TelephonyCallback.SecurityAlgorithmsListener, TelephonyCallback.CellularIdentifierDisclosedListener { // This class isn't mockable to get invocation counts because the IBinder is null and // crashes the TelephonyRegistry. Make a cheesy verify(times()) alternative. public AtomicInteger invocationCount = new AtomicInteger(0); Loading Loading @@ -351,6 +364,16 @@ public class TelephonyRegistryTest extends TelephonyTest { invocationCount.incrementAndGet(); mCarrierRoamingNtnSignalStrength = ntnSignalStrength; } @Override public void onSecurityAlgorithmsChanged(SecurityAlgorithmUpdate update) { invocationCount.incrementAndGet(); } @Override public void onCellularIdentifierDisclosedChanged(CellularIdentifierDisclosure disclosure) { invocationCount.incrementAndGet(); } } public class MySatelliteStateChangeListener implements ISatelliteStateChangeListener { Loading Loading @@ -1838,4 +1861,49 @@ public class TelephonyRegistryTest extends TelephonyTest { // We should not receive the new state change after monitoring end assertFalse(mIsSatelliteEnabled); } @Test @EnableFlags(Flags.FLAG_SECURITY_ALGORITHMS_UPDATE_INDICATIONS) public void testNotifySecurityAlgorithmsChanged() { int subId = 1; int[] events = {TelephonyCallback.EVENT_SECURITY_ALGORITHMS_CHANGED}; mTelephonyRegistry.listenWithEventList(false, false, subId, mContext.getOpPackageName(), mContext.getAttributionTag(), mTelephonyCallback.callback, events, false); SecurityAlgorithmUpdate update = new SecurityAlgorithmUpdate( CONNECTION_EVENT_VOLTE_SIP, SECURITY_ALGORITHM_EEA2, SECURITY_ALGORITHM_HMAC_SHA1_96, false); mTelephonyRegistry.listenWithEventList(false, false, subId, mContext.getOpPackageName(), mContext.getAttributionTag(), mTelephonyCallback.callback, events, false); int invocationCount = mTelephonyCallback.invocationCount.get(); mTelephonyRegistry.notifySecurityAlgorithmsChanged(0, 1, update); processAllMessages(); assertEquals(invocationCount + 1, mTelephonyCallback.invocationCount.get()); } @Test @EnableFlags(Flags.FLAG_CELLULAR_IDENTIFIER_DISCLOSURE_INDICATIONS) public void testNotifyCellularIdentifierDisclosedChanged() { int subId = 1; int[] events = {TelephonyCallback.EVENT_CELLULAR_IDENTIFIER_DISCLOSED_CHANGED}; CellularIdentifierDisclosure disclosure = new CellularIdentifierDisclosure(NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST, CELLULAR_IDENTIFIER_IMSI, "001001", false); mTelephonyRegistry.listenWithEventList(false, false, subId, mContext.getOpPackageName(), mContext.getAttributionTag(), mTelephonyCallback.callback, events, false); int invocationCount = mTelephonyCallback.invocationCount.get(); mTelephonyRegistry.notifyCellularIdentifierDisclosedChanged(0, 1, disclosure); processAllMessages(); assertEquals(invocationCount + 1, mTelephonyCallback.invocationCount.get()); } } Loading
flags/network.aconfig +17 −0 Original line number Diff line number Diff line Loading @@ -93,3 +93,20 @@ flag { } } # OWNER=yomna TARGET=25Q2 flag { name: "security_algorithms_update_indications" is_exported: true namespace: "telephony" description: "guard system API onSecurityAlgorithmsChanged" bug: "355062720" } # OWNER=yomna TARGET=25Q2 flag { name: "cellular_identifier_disclosure_indications" is_exported: true namespace: "telephony" description: "guard system API onCellularIdentifierDisclosedChanged" bug: "355062720" }
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java +19 −0 Original line number Diff line number Diff line Loading @@ -25,12 +25,14 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.ServiceState; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager.DataEnabledReason; Loading Loading @@ -356,6 +358,23 @@ public class DefaultPhoneNotifier implements PhoneNotifier { sender.getSubId(), ntnSignalStrength); } @Override public void notifySecurityAlgorithmsChanged(Phone sender, SecurityAlgorithmUpdate update) { if (!mFeatureFlags.securityAlgorithmsUpdateIndications()) return; mTelephonyRegistryMgr.notifySecurityAlgorithmsChanged(sender.getPhoneId(), sender.getSubId(), update); } @Override public void notifyCellularIdentifierDisclosedChanged(Phone sender, CellularIdentifierDisclosure disclosure) { if (!mFeatureFlags.cellularIdentifierDisclosureIndications()) return; mTelephonyRegistryMgr.notifyCellularIdentifierDisclosedChanged(sender.getPhoneId(), sender.getSubId(), disclosure); } /** * Convert the {@link Call.State} enum into the PreciseCallState.PRECISE_CALL_STATE_* constants * for the public API. Loading
src/java/com/android/internal/telephony/PhoneNotifier.java +9 −0 Original line number Diff line number Diff line Loading @@ -25,11 +25,13 @@ import android.telephony.BarringInfo; import android.telephony.CallQuality; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseDataConnectionState; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.ServiceState; import android.telephony.TelephonyDisplayInfo; import android.telephony.TelephonyManager.DataEnabledReason; Loading Loading @@ -174,4 +176,11 @@ public interface PhoneNotifier { /** Notify carrier roaming non-terrestrial network signal strength changed. */ void notifyCarrierRoamingNtnSignalStrengthChanged(Phone sender, @NonNull NtnSignalStrength ntnSignalStrength); /** Notify of a cellular identifier disclosure change. */ void notifyCellularIdentifierDisclosedChanged(Phone sender, CellularIdentifierDisclosure disclosure); /** Notify of a security algorithm update change. */ void notifySecurityAlgorithmsChanged(Phone sender, SecurityAlgorithmUpdate update); }
tests/telephonytests/src/com/android/internal/telephony/DefaultPhoneNotifierTest.java +39 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,12 @@ */ package com.android.internal.telephony; import static android.telephony.CellularIdentifierDisclosure.CELLULAR_IDENTIFIER_IMSI; import static android.telephony.CellularIdentifierDisclosure.NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST; import static android.telephony.SecurityAlgorithmUpdate.CONNECTION_EVENT_VOLTE_SIP; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_EEA2; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_HMAC_SHA1_96; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; Loading @@ -26,9 +32,11 @@ import static org.mockito.Mockito.verify; import android.telephony.CellIdentityGsm; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.DisconnectCause; import android.telephony.PreciseCallState; import android.telephony.PreciseDisconnectCause; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.SignalStrength; import android.telephony.TelephonyManager; import android.telephony.ims.ImsCallProfile; Loading Loading @@ -449,4 +457,35 @@ public class DefaultPhoneNotifierTest extends TelephonyTest { verify(mTelephonyRegistryManager).notifyCarrierRoamingNtnAvailableServicesChanged( eq(subId), eq(testServices)); } @Test @SmallTest public void testSecurityAlgorithmsChanged() { doReturn(true).when(mFeatureFlags).securityAlgorithmsUpdateIndications(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); SecurityAlgorithmUpdate update = new SecurityAlgorithmUpdate( CONNECTION_EVENT_VOLTE_SIP, SECURITY_ALGORITHM_EEA2, SECURITY_ALGORITHM_HMAC_SHA1_96, false); mDefaultPhoneNotifierUT.notifySecurityAlgorithmsChanged(mPhone, update); verify(mTelephonyRegistryManager).notifySecurityAlgorithmsChanged( eq(phoneId), eq(subId), eq(update)); } @Test @SmallTest public void testCellularIdentifierDisclosedChanged() { doReturn(true).when(mFeatureFlags).cellularIdentifierDisclosureIndications(); int phoneId = mPhone.getPhoneId(); int subId = mPhone.getSubId(); CellularIdentifierDisclosure disclosure = new CellularIdentifierDisclosure(NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST, CELLULAR_IDENTIFIER_IMSI, "001001", false); mDefaultPhoneNotifierUT.notifyCellularIdentifierDisclosedChanged(mPhone, disclosure); verify(mTelephonyRegistryManager).notifyCellularIdentifierDisclosedChanged( eq(phoneId), eq(subId), eq(disclosure)); } }
tests/telephonytests/src/com/android/internal/telephony/TelephonyRegistryTest.java +69 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,12 @@ */ package com.android.internal.telephony; import static android.telephony.CellularIdentifierDisclosure.CELLULAR_IDENTIFIER_IMSI; import static android.telephony.CellularIdentifierDisclosure.NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST; import static android.telephony.PhysicalChannelConfig.PHYSICAL_CELL_ID_UNKNOWN; import static android.telephony.SecurityAlgorithmUpdate.CONNECTION_EVENT_VOLTE_SIP; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_EEA2; import static android.telephony.SecurityAlgorithmUpdate.SECURITY_ALGORITHM_HMAC_SHA1_96; import static android.telephony.ServiceState.FREQUENCY_RANGE_LOW; import static android.telephony.SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED; import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID; Loading Loading @@ -57,11 +62,13 @@ import android.telephony.CellIdentityLte; import android.telephony.CellInfo; import android.telephony.CellInfoLte; import android.telephony.CellLocation; import android.telephony.CellularIdentifierDisclosure; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseDataConnectionState; import android.telephony.SecurityAlgorithmUpdate; import android.telephony.ServiceState; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; Loading Loading @@ -181,6 +188,10 @@ public class TelephonyRegistryTest extends TelephonyTest { TelephonyCallback.EVENT_EMERGENCY_CALLBACK_MODE_CHANGED); READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED); READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_CELLULAR_IDENTIFIER_DISCLOSED_CHANGED); READ_PRIVILEGED_PHONE_STATE_EVENTS.add( TelephonyCallback.EVENT_SECURITY_ALGORITHMS_CHANGED); } // All events contribute to TelephonyRegistry#isActiveEmergencySessionPermissionRequired Loading Loading @@ -211,7 +222,9 @@ public class TelephonyRegistryTest extends TelephonyTest { TelephonyCallback.DataActivityListener, TelephonyCallback.SimultaneousCellularCallingSupportListener, TelephonyCallback.EmergencyCallbackModeListener, TelephonyCallback.CarrierRoamingNtnModeListener { TelephonyCallback.CarrierRoamingNtnModeListener, TelephonyCallback.SecurityAlgorithmsListener, TelephonyCallback.CellularIdentifierDisclosedListener { // This class isn't mockable to get invocation counts because the IBinder is null and // crashes the TelephonyRegistry. Make a cheesy verify(times()) alternative. public AtomicInteger invocationCount = new AtomicInteger(0); Loading Loading @@ -351,6 +364,16 @@ public class TelephonyRegistryTest extends TelephonyTest { invocationCount.incrementAndGet(); mCarrierRoamingNtnSignalStrength = ntnSignalStrength; } @Override public void onSecurityAlgorithmsChanged(SecurityAlgorithmUpdate update) { invocationCount.incrementAndGet(); } @Override public void onCellularIdentifierDisclosedChanged(CellularIdentifierDisclosure disclosure) { invocationCount.incrementAndGet(); } } public class MySatelliteStateChangeListener implements ISatelliteStateChangeListener { Loading Loading @@ -1838,4 +1861,49 @@ public class TelephonyRegistryTest extends TelephonyTest { // We should not receive the new state change after monitoring end assertFalse(mIsSatelliteEnabled); } @Test @EnableFlags(Flags.FLAG_SECURITY_ALGORITHMS_UPDATE_INDICATIONS) public void testNotifySecurityAlgorithmsChanged() { int subId = 1; int[] events = {TelephonyCallback.EVENT_SECURITY_ALGORITHMS_CHANGED}; mTelephonyRegistry.listenWithEventList(false, false, subId, mContext.getOpPackageName(), mContext.getAttributionTag(), mTelephonyCallback.callback, events, false); SecurityAlgorithmUpdate update = new SecurityAlgorithmUpdate( CONNECTION_EVENT_VOLTE_SIP, SECURITY_ALGORITHM_EEA2, SECURITY_ALGORITHM_HMAC_SHA1_96, false); mTelephonyRegistry.listenWithEventList(false, false, subId, mContext.getOpPackageName(), mContext.getAttributionTag(), mTelephonyCallback.callback, events, false); int invocationCount = mTelephonyCallback.invocationCount.get(); mTelephonyRegistry.notifySecurityAlgorithmsChanged(0, 1, update); processAllMessages(); assertEquals(invocationCount + 1, mTelephonyCallback.invocationCount.get()); } @Test @EnableFlags(Flags.FLAG_CELLULAR_IDENTIFIER_DISCLOSURE_INDICATIONS) public void testNotifyCellularIdentifierDisclosedChanged() { int subId = 1; int[] events = {TelephonyCallback.EVENT_CELLULAR_IDENTIFIER_DISCLOSED_CHANGED}; CellularIdentifierDisclosure disclosure = new CellularIdentifierDisclosure(NAS_PROTOCOL_MESSAGE_ATTACH_REQUEST, CELLULAR_IDENTIFIER_IMSI, "001001", false); mTelephonyRegistry.listenWithEventList(false, false, subId, mContext.getOpPackageName(), mContext.getAttributionTag(), mTelephonyCallback.callback, events, false); int invocationCount = mTelephonyCallback.invocationCount.get(); mTelephonyRegistry.notifyCellularIdentifierDisclosedChanged(0, 1, disclosure); processAllMessages(); assertEquals(invocationCount + 1, mTelephonyCallback.invocationCount.get()); } }