Handle Device Admin Updates to 2G per Phone Instance
Problem: A previous implementation (aosp/2371949) honoring the no_cellular_2g restriction operated at the subscription level and was complex and prone to race conditions between subscription loading and carrier configs. This manifested in devices booting without applying the admin policy sometimes. Solution: Move the enforcement of the admin policy into each instance of Phone. Before allowed network types are sent to the modem, a check against the admin policy is performed. If the no_cellular_2g restriction is set, 2g is disabled in the effective bitmap that is passed to the modem. Note that Phone.sendSubscriptionSetting is called by ServiceStateTracker when a new subscription is added so this change is piggy backing off of that call to ensure the admin policy gets enforced on every call. Introduce BroadcastReceiver, TelephonyAdminReceiver, that calls Phone.sendSubscriptionSettings when the relevant 2g admin policy changes. Bug: 266472206 Test: atest TelephonyAdminReceiver Test: atest GsmCdmaPhoneTest Test: Manual testing on cuttlefish with the TestDPC app. Asserted that the 2g admin policy is applied on boot and persisted across reboots. Change-Id: Iaf15dca36c4a1b383d75b65d157578fdeb4ad989
Loading
Please register or sign in to comment