Merge "Hide new Hotspot preferences if feature is disabled" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
0373a46e81
@@ -371,12 +371,20 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
|
||||
|| !mWifiRestriction.isHotspotAvailable(context)) {
|
||||
keys.add(KEY_WIFI_TETHER_NETWORK_NAME);
|
||||
keys.add(KEY_WIFI_TETHER_SECURITY);
|
||||
keys.add(KEY_WIFI_HOTSPOT_SECURITY);
|
||||
keys.add(KEY_WIFI_TETHER_NETWORK_PASSWORD);
|
||||
keys.add(KEY_WIFI_TETHER_AUTO_OFF);
|
||||
keys.add(KEY_WIFI_TETHER_MAXIMIZE_COMPATIBILITY);
|
||||
keys.add(KEY_WIFI_HOTSPOT_SPEED);
|
||||
keys.add(KEY_INSTANT_HOTSPOT);
|
||||
} else if (!mIsInstantHotspotEnabled) {
|
||||
keys.add(KEY_INSTANT_HOTSPOT);
|
||||
} else {
|
||||
if (!isSpeedFeatureAvailable()) {
|
||||
keys.add(KEY_WIFI_HOTSPOT_SECURITY);
|
||||
keys.add(KEY_WIFI_HOTSPOT_SPEED);
|
||||
}
|
||||
if (!mIsInstantHotspotEnabled) {
|
||||
keys.add(KEY_INSTANT_HOTSPOT);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove duplicate
|
||||
@@ -400,6 +408,12 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
|
||||
public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
return buildPreferenceControllers(context, null /* listener */);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
boolean isSpeedFeatureAvailable() {
|
||||
return FeatureFactory.getFeatureFactory().getWifiFeatureProvider()
|
||||
.getWifiHotspotRepository().isSpeedFeatureAvailable();
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
Reference in New Issue
Block a user