[Provider Model] Hide Connectivity Subsystems when recovering
- Hide Carrier Network - Hide Wi-Fi toggle - Hide all of Wi-Fi Networks Bug: 186590805 Test: manual test atest InternetResetHelperTest atest NetworkMobileProviderControllerTest make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest Change-Id: Ib8462f890847d14bfc6ef533d1147822fd797a13
This commit is contained in:
@@ -50,6 +50,7 @@ public class NetworkMobileProviderController extends BasePreferenceController im
|
||||
private SubscriptionsPreferenceController mSubscriptionsController;
|
||||
|
||||
private int mOriginalExpandedChildrenCount;
|
||||
private boolean mHide;
|
||||
|
||||
public NetworkMobileProviderController(Context context, String key) {
|
||||
super(context, key);
|
||||
@@ -94,7 +95,7 @@ public class NetworkMobileProviderController extends BasePreferenceController im
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (mSubscriptionsController == null) {
|
||||
if (mHide || mSubscriptionsController == null) {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
return mSubscriptionsController.isAvailable() ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
|
||||
@@ -122,4 +123,14 @@ public class NetworkMobileProviderController extends BasePreferenceController im
|
||||
mSubscriptionsController.setWifiPickerTrackerHelper(helper);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the preference.
|
||||
*/
|
||||
public void hidePreference(boolean hide, boolean immediately) {
|
||||
mHide = hide;
|
||||
if (immediately) {
|
||||
mPreferenceCategory.setVisible(hide ? false : isAvailable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user