Loading flags/network.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,13 @@ flag { flag { name: "enable_identifier_disclosure_transparency" namespace: "telephony" description: "Guards APIs for enabling and disabling identifier disclosure transparency" bug: "276752426" } flag { name: "enable_identifier_disclosure_transparency_unsol_events" namespace: "telephony" description: "Allows the framework to register for CellularIdentifierDisclosure events and emit notifications to the user about them" bug: "276752426" } Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +15 −7 Original line number Diff line number Diff line Loading @@ -524,10 +524,10 @@ public class GsmCdmaPhone extends Phone { mCi.registerForImeiMappingChanged(this, EVENT_IMEI_MAPPING_CHANGED, null); if (mFeatureFlags.enableIdentifierDisclosureTransparency()) { if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()) { logi( "enable_identifier_disclosure_transparency is on. Registering for cellular " + "identifier disclosures from phone " "enable_identifier_disclosure_transparency_unsol_events is on. Registering for " + "cellular identifier disclosures from phone " + getPhoneId()); mIdentifierDisclosureNotifier = mTelephonyComponentFactory Loading Loading @@ -3703,7 +3703,7 @@ public class GsmCdmaPhone extends Phone { } CellularIdentifierDisclosure disclosure = (CellularIdentifierDisclosure) ar.result; if (mFeatureFlags.enableIdentifierDisclosureTransparency() if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents() && mIdentifierDisclosureNotifier != null && disclosure != null) { mIdentifierDisclosureNotifier.addDisclosure(disclosure); Loading Loading @@ -5333,16 +5333,24 @@ public class GsmCdmaPhone extends Phone { public void handleIdentifierDisclosureNotificationPreferenceChange() { if (!mFeatureFlags.enableIdentifierDisclosureTransparency()) { logi("Not handling identifier disclosure preference change. Feature flag " + "ENABLE_IDENTIFIER_DISCLOSURE_TRANSPARENCY disabled"); + "enable_identifier_disclosure_transparency disabled"); return; } boolean prefEnabled = getIdentifierDisclosureNotificationsPreferenceEnabled(); // The notifier is tied to handling unsolicited updates from the modem, not the // enable/disable API, so we only toggle the enable state if the unsol events feature // flag is enabled. if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()) { if (prefEnabled) { mIdentifierDisclosureNotifier.enable(); } else { mIdentifierDisclosureNotifier.disable(); } } else { logi("Not toggling enable state for disclosure notifier. Feature flag " + "enable_identifier_disclosure_transparency_unsol_events is disabled"); } mCi.setCellularIdentifierTransparencyEnabled(prefEnabled, obtainMessage(EVENT_SET_IDENTIFIER_DISCLOSURE_ENABLED_DONE)); Loading tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -2789,7 +2789,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosureFlagOff() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(false); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(false); GsmCdmaPhone phoneUT = new GsmCdmaPhone( Loading @@ -2811,7 +2811,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosureFlagOn() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(true); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = new GsmCdmaPhone( Loading @@ -2834,7 +2834,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosure_disclosureEventAddedToNotifier() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(true); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = new GsmCdmaPhone( Loading Loading @@ -2865,7 +2865,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosure_disclosureEventNull() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(true); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = new GsmCdmaPhone( Loading Loading
flags/network.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,13 @@ flag { flag { name: "enable_identifier_disclosure_transparency" namespace: "telephony" description: "Guards APIs for enabling and disabling identifier disclosure transparency" bug: "276752426" } flag { name: "enable_identifier_disclosure_transparency_unsol_events" namespace: "telephony" description: "Allows the framework to register for CellularIdentifierDisclosure events and emit notifications to the user about them" bug: "276752426" } Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +15 −7 Original line number Diff line number Diff line Loading @@ -524,10 +524,10 @@ public class GsmCdmaPhone extends Phone { mCi.registerForImeiMappingChanged(this, EVENT_IMEI_MAPPING_CHANGED, null); if (mFeatureFlags.enableIdentifierDisclosureTransparency()) { if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()) { logi( "enable_identifier_disclosure_transparency is on. Registering for cellular " + "identifier disclosures from phone " "enable_identifier_disclosure_transparency_unsol_events is on. Registering for " + "cellular identifier disclosures from phone " + getPhoneId()); mIdentifierDisclosureNotifier = mTelephonyComponentFactory Loading Loading @@ -3703,7 +3703,7 @@ public class GsmCdmaPhone extends Phone { } CellularIdentifierDisclosure disclosure = (CellularIdentifierDisclosure) ar.result; if (mFeatureFlags.enableIdentifierDisclosureTransparency() if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents() && mIdentifierDisclosureNotifier != null && disclosure != null) { mIdentifierDisclosureNotifier.addDisclosure(disclosure); Loading Loading @@ -5333,16 +5333,24 @@ public class GsmCdmaPhone extends Phone { public void handleIdentifierDisclosureNotificationPreferenceChange() { if (!mFeatureFlags.enableIdentifierDisclosureTransparency()) { logi("Not handling identifier disclosure preference change. Feature flag " + "ENABLE_IDENTIFIER_DISCLOSURE_TRANSPARENCY disabled"); + "enable_identifier_disclosure_transparency disabled"); return; } boolean prefEnabled = getIdentifierDisclosureNotificationsPreferenceEnabled(); // The notifier is tied to handling unsolicited updates from the modem, not the // enable/disable API, so we only toggle the enable state if the unsol events feature // flag is enabled. if (mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()) { if (prefEnabled) { mIdentifierDisclosureNotifier.enable(); } else { mIdentifierDisclosureNotifier.disable(); } } else { logi("Not toggling enable state for disclosure notifier. Feature flag " + "enable_identifier_disclosure_transparency_unsol_events is disabled"); } mCi.setCellularIdentifierTransparencyEnabled(prefEnabled, obtainMessage(EVENT_SET_IDENTIFIER_DISCLOSURE_ENABLED_DONE)); Loading
tests/telephonytests/src/com/android/internal/telephony/GsmCdmaPhoneTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -2789,7 +2789,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosureFlagOff() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(false); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(false); GsmCdmaPhone phoneUT = new GsmCdmaPhone( Loading @@ -2811,7 +2811,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosureFlagOn() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(true); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = new GsmCdmaPhone( Loading @@ -2834,7 +2834,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosure_disclosureEventAddedToNotifier() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(true); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = new GsmCdmaPhone( Loading Loading @@ -2865,7 +2865,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest { @Test public void testCellularIdentifierDisclosure_disclosureEventNull() { when(mFeatureFlags.enableIdentifierDisclosureTransparency()).thenReturn(true); when(mFeatureFlags.enableIdentifierDisclosureTransparencyUnsolEvents()).thenReturn(true); Phone phoneUT = new GsmCdmaPhone( Loading