Introduce Telephony2gUpdater to Apply 2g User Restrictions
Listens for the following actions and ensures that 2g is enabled
or disabled based on the state of the `DISALLOW_2G` user
restriction. 2g is enabled or disabled for all active subscriptions
on the device.
* A broadcast for action `android.os.action.USER_RESTRICTIONS_CHANGED`
* A callback from `SubscriptionManager` informing us of a subscription
state change
Test: atest Telephony2gUpdaterTest
Bug: 230669497
Change-Id: I819d412bc14cb98a5874d2a42b50d4e4483b4b02
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 66cef64..837df86 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -380,6 +380,7 @@
private SharedPreferences mTelephonySharedPreferences;
private PhoneConfigurationManager mPhoneConfigurationManager;
private final RadioInterfaceCapabilityController mRadioInterfaceCapabilities;
+ private final Telephony2gUpdater mTelephony2gUpdater;
/** User Activity */
private AtomicBoolean mNotifyUserActivity;
@@ -2347,6 +2348,9 @@
mRadioInterfaceCapabilities = RadioInterfaceCapabilityController.getInstance();
mNotifyUserActivity = new AtomicBoolean(false);
PropertyInvalidatedCache.invalidateCache(TelephonyManager.CACHE_KEY_PHONE_ACCOUNT_TO_SUBID);
+ mTelephony2gUpdater = new Telephony2gUpdater(
+ Executors.newSingleThreadExecutor(), mApp);
+ mTelephony2gUpdater.init();
publish();
}