Loading src/com/android/settings/network/telephony/DisabledSubscriptionController.java +13 −5 Original line number Diff line number Diff line Loading @@ -28,16 +28,21 @@ import androidx.lifecycle.OnLifecycleEvent; import androidx.preference.PreferenceCategory; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; import com.android.settings.network.SubscriptionsChangeListener; public class DisabledSubscriptionController extends BasePreferenceController implements /** * Preference controller group which can hide UI option from visible when SIM is no longer in * active. */ public class DisabledSubscriptionController extends TelephonyBasePreferenceController implements SubscriptionsChangeListener.SubscriptionsChangeListenerClient, LifecycleObserver { private PreferenceCategory mCategory; private int mSubId; private SubscriptionsChangeListener mChangeListener; private SubscriptionManager mSubscriptionManager; /** * Constructor of preference controller */ public DisabledSubscriptionController(Context context, String preferenceKey) { super(context, preferenceKey); mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; Loading @@ -45,6 +50,9 @@ public class DisabledSubscriptionController extends BasePreferenceController imp mChangeListener = new SubscriptionsChangeListener(context, this); } /** * Re-initialize the configuration based on subscription id provided */ public void init(Lifecycle lifecycle, int subId) { lifecycle.addObserver(this); mSubId = subId; Loading @@ -69,7 +77,7 @@ public class DisabledSubscriptionController extends BasePreferenceController imp } private void update() { if (mCategory == null || mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) { if (mCategory == null || !SubscriptionManager.isValidSubscriptionId(mSubId)) { return; } // TODO b/135222940: re-evaluate whether to use mSubscriptionManager#isSubscriptionEnabled Loading @@ -77,7 +85,7 @@ public class DisabledSubscriptionController extends BasePreferenceController imp } @Override public int getAvailabilityStatus() { public int getAvailabilityStatus(int subId) { return AVAILABLE_UNSEARCHABLE; } Loading src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java +0 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ public abstract class CdmaBasePreferenceController extends TelephonyBasePreferen protected Preference mPreference; protected TelephonyManager mTelephonyManager; protected PreferenceManager mPreferenceManager; protected int mSubId; private DataContentObserver mDataContentObserver; public CdmaBasePreferenceController(Context context, String key) { Loading Loading
src/com/android/settings/network/telephony/DisabledSubscriptionController.java +13 −5 Original line number Diff line number Diff line Loading @@ -28,16 +28,21 @@ import androidx.lifecycle.OnLifecycleEvent; import androidx.preference.PreferenceCategory; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; import com.android.settings.network.SubscriptionsChangeListener; public class DisabledSubscriptionController extends BasePreferenceController implements /** * Preference controller group which can hide UI option from visible when SIM is no longer in * active. */ public class DisabledSubscriptionController extends TelephonyBasePreferenceController implements SubscriptionsChangeListener.SubscriptionsChangeListenerClient, LifecycleObserver { private PreferenceCategory mCategory; private int mSubId; private SubscriptionsChangeListener mChangeListener; private SubscriptionManager mSubscriptionManager; /** * Constructor of preference controller */ public DisabledSubscriptionController(Context context, String preferenceKey) { super(context, preferenceKey); mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; Loading @@ -45,6 +50,9 @@ public class DisabledSubscriptionController extends BasePreferenceController imp mChangeListener = new SubscriptionsChangeListener(context, this); } /** * Re-initialize the configuration based on subscription id provided */ public void init(Lifecycle lifecycle, int subId) { lifecycle.addObserver(this); mSubId = subId; Loading @@ -69,7 +77,7 @@ public class DisabledSubscriptionController extends BasePreferenceController imp } private void update() { if (mCategory == null || mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) { if (mCategory == null || !SubscriptionManager.isValidSubscriptionId(mSubId)) { return; } // TODO b/135222940: re-evaluate whether to use mSubscriptionManager#isSubscriptionEnabled Loading @@ -77,7 +85,7 @@ public class DisabledSubscriptionController extends BasePreferenceController imp } @Override public int getAvailabilityStatus() { public int getAvailabilityStatus(int subId) { return AVAILABLE_UNSEARCHABLE; } Loading
src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java +0 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ public abstract class CdmaBasePreferenceController extends TelephonyBasePreferen protected Preference mPreference; protected TelephonyManager mTelephonyManager; protected PreferenceManager mPreferenceManager; protected int mSubId; private DataContentObserver mDataContentObserver; public CdmaBasePreferenceController(Context context, String key) { Loading