Merge "Add config for Wi-Fi Hotspot Settings hidden" into tm-qpr-dev am: 87d2f6d3cb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20244146 Change-Id: I7b3275ffad2af79bb81c3761b691ab793a61168a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -18,6 +18,8 @@ package com.android.settings.wifi.tether;
|
||||
|
||||
import static android.net.wifi.WifiManager.WIFI_AP_STATE_CHANGED_ACTION;
|
||||
|
||||
import static com.android.settings.wifi.WifiUtils.canShowWifiHotspot;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -108,6 +110,13 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
if (!canShowWifiHotspot(getContext())) {
|
||||
Log.e(TAG, "can not launch Wi-Fi hotspot settings"
|
||||
+ " because the config is not set to show.");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
setIfOnlyAvailableForAdmins(true);
|
||||
mUnavailable = isUiRestricted() || !mWifiRestriction.isHotspotAvailable(getContext());
|
||||
}
|
||||
|
Reference in New Issue
Block a user