Loading flags/network.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,10 @@ flag { description: "Allow carriers to hide the roaming (R) icon when roaming." bug: "301467052" } flag { name: "enable_identifier_disclosure_transparency" namespace: "telephony" description: "Allows the framework to register for CellularIdentifierDisclosure events and emit notifications to the user about them" bug: "276752426" } src/java/com/android/internal/telephony/BaseCommands.java +11 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mNotifyAnbrRegistrants = new RegistrantList(); protected RegistrantList mTriggerImsDeregistrationRegistrants = new RegistrantList(); protected RegistrantList mImeiInfoRegistrants = new RegistrantList(); protected RegistrantList mCellularIdentifierDisclosedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected Registrant mGsmSmsRegistrant; Loading Loading @@ -1183,4 +1184,14 @@ public abstract class BaseCommands implements CommandsInterface { public void registerForImeiMappingChanged(Handler h, int what, Object obj) { mImeiInfoRegistrants.add(h, what, obj); } @Override public void registerForCellularIdentifierDisclosures(Handler h, int what, Object obj) { mCellularIdentifierDisclosedRegistrants.add(h, what, obj); } @Override public void unregisterForCellularIdentifierDisclosures(Handler h) { mCellularIdentifierDisclosedRegistrants.remove(h); } } src/java/com/android/internal/telephony/CommandsInterface.java +13 −0 Original line number Diff line number Diff line Loading @@ -2927,4 +2927,17 @@ public interface CommandsInterface { * @param result Callback message to receive the result. */ default void isSecurityAlgorithmsUpdatedEnabled(Message result) {} /** * Registers for cellular identifier disclosure events. */ default void registerForCellularIdentifierDisclosures( @NonNull Handler h, int what, @Nullable Object obj) {} /** * Unregisters for cellular identifier disclosure events. * * @param h Handler to be removed from the registrant list. */ default void unregisterForCellularIdentifierDisclosures(@NonNull Handler h) {} } src/java/com/android/internal/telephony/GsmCdmaPhone.java +38 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import android.telephony.BarringInfo; import android.telephony.CarrierConfigManager; import android.telephony.CellBroadcastIdRange; import android.telephony.CellIdentity; import android.telephony.CellularIdentifierDisclosure; import android.telephony.ImsiEncryptionInfo; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkScanRequest; Loading Loading @@ -116,6 +117,7 @@ import com.android.internal.telephony.imsphone.ImsPhoneCallTracker; import com.android.internal.telephony.imsphone.ImsPhoneMmiCode; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.metrics.VoiceCallSessionStats; import com.android.internal.telephony.security.CellularIdentifierDisclosureNotifier; import com.android.internal.telephony.subscription.SubscriptionInfoInternal; import com.android.internal.telephony.subscription.SubscriptionManagerService.SubscriptionManagerServiceCallback; import com.android.internal.telephony.test.SimulatedRadioControl; Loading Loading @@ -298,6 +300,8 @@ public class GsmCdmaPhone extends Phone { private final SubscriptionManager.OnSubscriptionsChangedListener mSubscriptionsChangedListener; private final CallWaitingController mCallWaitingController; private CellularIdentifierDisclosureNotifier mIdentifierDisclosureNotifier; // Set via Carrier Config private boolean mIsN1ModeAllowedByCarrier = true; // Set via a call to the method on Phone; the only caller is IMS, and all of this code will Loading Loading @@ -515,6 +519,20 @@ public class GsmCdmaPhone extends Phone { mCIM = new CarrierInfoManager(); mCi.registerForImeiMappingChanged(this, EVENT_IMEI_MAPPING_CHANGED, null); if (mFeatureFlags.enableIdentifierDisclosureTransparency()) { logi( "enable_identifier_disclosure_transparency is on. Registering for cellular " + "identifier disclosures from phone " + getPhoneId()); mIdentifierDisclosureNotifier = mTelephonyComponentFactory .inject(CellularIdentifierDisclosureNotifier.class.getName()) .makeIdentifierDisclosureNotifier(); mCi.registerForCellularIdentifierDisclosures( this, EVENT_CELL_IDENTIFIER_DISCLOSURE, null); } initializeCarrierApps(); } Loading Loading @@ -3663,6 +3681,26 @@ public class GsmCdmaPhone extends Phone { parseImeiInfo(msg); break; case EVENT_CELL_IDENTIFIER_DISCLOSURE: logd("EVENT_CELL_IDENTIFIER_DISCLOSURE phoneId = " + getPhoneId()); ar = (AsyncResult) msg.obj; if (ar == null || ar.result == null || ar.exception != null) { Rlog.e( LOG_TAG, "Failed to process cellular identifier disclosure", ar.exception); break; } CellularIdentifierDisclosure disclosure = (CellularIdentifierDisclosure) ar.result; if (mFeatureFlags.enableIdentifierDisclosureTransparency() && mIdentifierDisclosureNotifier != null && disclosure != null) { mIdentifierDisclosureNotifier.addDisclosure(disclosure); } break; default: super.handleMessage(msg); } Loading src/java/com/android/internal/telephony/NetworkIndication.java +6 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.telephony.AnomalyReporter; import android.telephony.BarringInfo; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.EmergencyRegResult; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; Loading Loading @@ -436,7 +437,11 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub { mRil.unsljLogRet(RIL_UNSOL_CELLULAR_IDENTIFIER_DISCLOSED, identifierDisclsoure); } // TODO (b/276752426) notify registrants of identifier disclosure CellularIdentifierDisclosure disclosure = RILUtils.convertCellularIdentifierDisclosure(identifierDisclsoure); mRil.mCellularIdentifierDisclosedRegistrants.notifyRegistrants( new AsyncResult(null, disclosure, null)); } /** Loading Loading
flags/network.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,10 @@ flag { description: "Allow carriers to hide the roaming (R) icon when roaming." bug: "301467052" } flag { name: "enable_identifier_disclosure_transparency" namespace: "telephony" description: "Allows the framework to register for CellularIdentifierDisclosure events and emit notifications to the user about them" bug: "276752426" }
src/java/com/android/internal/telephony/BaseCommands.java +11 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ public abstract class BaseCommands implements CommandsInterface { protected RegistrantList mNotifyAnbrRegistrants = new RegistrantList(); protected RegistrantList mTriggerImsDeregistrationRegistrants = new RegistrantList(); protected RegistrantList mImeiInfoRegistrants = new RegistrantList(); protected RegistrantList mCellularIdentifierDisclosedRegistrants = new RegistrantList(); @UnsupportedAppUsage protected Registrant mGsmSmsRegistrant; Loading Loading @@ -1183,4 +1184,14 @@ public abstract class BaseCommands implements CommandsInterface { public void registerForImeiMappingChanged(Handler h, int what, Object obj) { mImeiInfoRegistrants.add(h, what, obj); } @Override public void registerForCellularIdentifierDisclosures(Handler h, int what, Object obj) { mCellularIdentifierDisclosedRegistrants.add(h, what, obj); } @Override public void unregisterForCellularIdentifierDisclosures(Handler h) { mCellularIdentifierDisclosedRegistrants.remove(h); } }
src/java/com/android/internal/telephony/CommandsInterface.java +13 −0 Original line number Diff line number Diff line Loading @@ -2927,4 +2927,17 @@ public interface CommandsInterface { * @param result Callback message to receive the result. */ default void isSecurityAlgorithmsUpdatedEnabled(Message result) {} /** * Registers for cellular identifier disclosure events. */ default void registerForCellularIdentifierDisclosures( @NonNull Handler h, int what, @Nullable Object obj) {} /** * Unregisters for cellular identifier disclosure events. * * @param h Handler to be removed from the registrant list. */ default void unregisterForCellularIdentifierDisclosures(@NonNull Handler h) {} }
src/java/com/android/internal/telephony/GsmCdmaPhone.java +38 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import android.telephony.BarringInfo; import android.telephony.CarrierConfigManager; import android.telephony.CellBroadcastIdRange; import android.telephony.CellIdentity; import android.telephony.CellularIdentifierDisclosure; import android.telephony.ImsiEncryptionInfo; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkScanRequest; Loading Loading @@ -116,6 +117,7 @@ import com.android.internal.telephony.imsphone.ImsPhoneCallTracker; import com.android.internal.telephony.imsphone.ImsPhoneMmiCode; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.metrics.VoiceCallSessionStats; import com.android.internal.telephony.security.CellularIdentifierDisclosureNotifier; import com.android.internal.telephony.subscription.SubscriptionInfoInternal; import com.android.internal.telephony.subscription.SubscriptionManagerService.SubscriptionManagerServiceCallback; import com.android.internal.telephony.test.SimulatedRadioControl; Loading Loading @@ -298,6 +300,8 @@ public class GsmCdmaPhone extends Phone { private final SubscriptionManager.OnSubscriptionsChangedListener mSubscriptionsChangedListener; private final CallWaitingController mCallWaitingController; private CellularIdentifierDisclosureNotifier mIdentifierDisclosureNotifier; // Set via Carrier Config private boolean mIsN1ModeAllowedByCarrier = true; // Set via a call to the method on Phone; the only caller is IMS, and all of this code will Loading Loading @@ -515,6 +519,20 @@ public class GsmCdmaPhone extends Phone { mCIM = new CarrierInfoManager(); mCi.registerForImeiMappingChanged(this, EVENT_IMEI_MAPPING_CHANGED, null); if (mFeatureFlags.enableIdentifierDisclosureTransparency()) { logi( "enable_identifier_disclosure_transparency is on. Registering for cellular " + "identifier disclosures from phone " + getPhoneId()); mIdentifierDisclosureNotifier = mTelephonyComponentFactory .inject(CellularIdentifierDisclosureNotifier.class.getName()) .makeIdentifierDisclosureNotifier(); mCi.registerForCellularIdentifierDisclosures( this, EVENT_CELL_IDENTIFIER_DISCLOSURE, null); } initializeCarrierApps(); } Loading Loading @@ -3663,6 +3681,26 @@ public class GsmCdmaPhone extends Phone { parseImeiInfo(msg); break; case EVENT_CELL_IDENTIFIER_DISCLOSURE: logd("EVENT_CELL_IDENTIFIER_DISCLOSURE phoneId = " + getPhoneId()); ar = (AsyncResult) msg.obj; if (ar == null || ar.result == null || ar.exception != null) { Rlog.e( LOG_TAG, "Failed to process cellular identifier disclosure", ar.exception); break; } CellularIdentifierDisclosure disclosure = (CellularIdentifierDisclosure) ar.result; if (mFeatureFlags.enableIdentifierDisclosureTransparency() && mIdentifierDisclosureNotifier != null && disclosure != null) { mIdentifierDisclosureNotifier.addDisclosure(disclosure); } break; default: super.handleMessage(msg); } Loading
src/java/com/android/internal/telephony/NetworkIndication.java +6 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.telephony.AnomalyReporter; import android.telephony.BarringInfo; import android.telephony.CellIdentity; import android.telephony.CellInfo; import android.telephony.CellularIdentifierDisclosure; import android.telephony.EmergencyRegResult; import android.telephony.LinkCapacityEstimate; import android.telephony.NetworkRegistrationInfo; Loading Loading @@ -436,7 +437,11 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub { mRil.unsljLogRet(RIL_UNSOL_CELLULAR_IDENTIFIER_DISCLOSED, identifierDisclsoure); } // TODO (b/276752426) notify registrants of identifier disclosure CellularIdentifierDisclosure disclosure = RILUtils.convertCellularIdentifierDisclosure(identifierDisclsoure); mRil.mCellularIdentifierDisclosedRegistrants.notifyRegistrants( new AsyncResult(null, disclosure, null)); } /** Loading