diff options
author | Chris Manton <cmanton@google.com> | 2015-09-14 17:29:09 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-14 17:29:09 +0000 |
commit | ae0b7ca9ad2e21853af06a68c02da068f748f8bd (patch) | |
tree | eb2fb9da368b1ba9c4bb3009cc1416491ddbc9a9 /packages/SettingsLib | |
parent | f66e4979c579bde5031c8e6f29e5163246fc54ee (diff) | |
parent | c9180528452d67359618eda4aa2edd39112c83ca (diff) | |
download | frameworks_base-ae0b7ca9ad2e21853af06a68c02da068f748f8bd.zip frameworks_base-ae0b7ca9ad2e21853af06a68c02da068f748f8bd.tar.gz frameworks_base-ae0b7ca9ad2e21853af06a68c02da068f748f8bd.tar.bz2 |
am c9180528: Merge "Add capability to ignore carrier entitlement checks" into mnc-dr-dev
* commit 'c9180528452d67359618eda4aa2edd39112c83ca':
Add capability to ignore carrier entitlement checks
Diffstat (limited to 'packages/SettingsLib')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/TetherUtil.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java b/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java index 5062423..5294199 100644 --- a/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java +++ b/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java @@ -25,6 +25,7 @@ import android.net.wifi.WifiManager; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; +import android.telephony.CarrierConfigManager; public class TetherUtil { @@ -62,6 +63,13 @@ public class TetherUtil { return wifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED; } + private static boolean isEntitlementCheckRequired(Context context) { + final CarrierConfigManager configManager = (CarrierConfigManager) context + .getSystemService(Context.CARRIER_CONFIG_SERVICE); + return configManager.getConfig().getBoolean(CarrierConfigManager + .KEY_REQUIRE_ENTITLEMENT_CHECKS_BOOL); + } + public static boolean isProvisioningNeeded(Context context) { // Keep in sync with other usage of config_mobile_hotspot_provision_app. // ConnectivityManager#enforceTetherChangePermission @@ -71,6 +79,10 @@ public class TetherUtil { || provisionApp == null) { return false; } + // Check carrier config for entitlement checks + if (isEntitlementCheckRequired(context) == false) { + return false; + } return (provisionApp.length == 2); } |