summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib
diff options
context:
space:
mode:
authorChris Manton <cmanton@google.com>2015-09-01 13:56:46 -0700
committerChris Manton <cmanton@google.com>2015-09-11 14:33:22 -0700
commit1ba0fa04ded1df73363a1c25064a3d6f5686478d (patch)
tree6244f2be99bc908fb917d34b6251955d00aa2a94 /packages/SettingsLib
parent62b94c353a8748ef10691da4844bf894e1155870 (diff)
downloadframeworks_base-1ba0fa04ded1df73363a1c25064a3d6f5686478d.zip
frameworks_base-1ba0fa04ded1df73363a1c25064a3d6f5686478d.tar.gz
frameworks_base-1ba0fa04ded1df73363a1c25064a3d6f5686478d.tar.bz2
Add capability to ignore carrier entitlement checks
Boolean to check to ignore carrier entitlement check. API to follow later. Carrier configuration manager has an option to override tethering entitlement checks. Ignore entitlement checks if overridden by the carrier configuration flag. bug:23712807 Change-Id: I6c9b3b9994279e592db304debef54809338fe9cf
Diffstat (limited to 'packages/SettingsLib')
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/TetherUtil.java12
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);
}