diff options
author | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-11-05 02:27:28 +0000 |
---|---|---|
committer | Ricardo Cerqueira <ricardo@cyngn.com> | 2015-11-05 15:13:26 +0000 |
commit | a89168479cb14f482268af6f1a650b28eba0b393 (patch) | |
tree | 8552b9d49ecfad6a453ee5f743571b700b4d3d3c /packages/SettingsLib/src/com/android/settingslib | |
parent | 8331d3e508498a19c296fed41b9d4b23ea960031 (diff) | |
parent | 25b5096f154721c8142d54f1b3af9e2998deffe9 (diff) | |
download | frameworks_base-a89168479cb14f482268af6f1a650b28eba0b393.zip frameworks_base-a89168479cb14f482268af6f1a650b28eba0b393.tar.gz frameworks_base-a89168479cb14f482268af6f1a650b28eba0b393.tar.bz2 |
Merge tag 'android-6.0.0_r26' into HEAD
Android 6.0.0 release 26
Conflicts:
cmds/bootanimation/BootAnimation.cpp
core/java/android/accounts/AccountManager.java
core/java/android/app/AppOpsManager.java
core/java/android/os/PowerManagerInternal.java
core/java/android/os/storage/IMountService.java
core/java/android/provider/Settings.java
core/java/com/android/internal/widget/ILockSettings.aidl
core/res/res/values-mcc204-mnc12/config.xml
core/res/res/values-mcc219-mnc02/config.xml
core/res/res/values-mcc730-mnc07/config.xml
core/res/res/values/config.xml
core/res/res/values/symbols.xml
packages/SystemUI/res/values/config.xml
packages/SystemUI/src/com/android/systemui/doze/DozeService.java
packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableOutlineView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java
services/core/java/com/android/server/LocationManagerService.java
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/pm/PackageManagerService.java
services/core/java/com/android/server/power/PowerManagerService.java
telecomm/java/android/telecom/Phone.java
telephony/java/android/telephony/CarrierConfigManager.java
telephony/java/android/telephony/RadioAccessFamily.java
telephony/java/android/telephony/ServiceState.java
telephony/java/android/telephony/SignalStrength.java
telephony/java/android/telephony/TelephonyManager.java
telephony/java/com/android/ims/ImsCallProfile.java
telephony/java/com/android/ims/ImsReasonInfo.java
telephony/java/com/android/ims/ImsSuppServiceNotification.aidl
telephony/java/com/android/ims/ImsSuppServiceNotification.java
telephony/java/com/android/ims/internal/IImsRegistrationListener.aidl
telephony/java/com/android/internal/telephony/RILConstants.java
Change-Id: I99c6edb8e25a77145b5adef97d0d55bfbe676959
Diffstat (limited to 'packages/SettingsLib/src/com/android/settingslib')
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/TetherUtil.java | 36 | ||||
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 4 |
2 files changed, 15 insertions, 25 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java b/packages/SettingsLib/src/com/android/settingslib/TetherUtil.java index 58e5e29..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 { @@ -54,29 +55,7 @@ public class TetherUtil { public static boolean setWifiTethering(boolean enable, Context context) { final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); - final ContentResolver cr = context.getContentResolver(); - /** - * Disable Wifi if enabling tethering - */ - int wifiState = wifiManager.getWifiState(); - if (enable && ((wifiState == WifiManager.WIFI_STATE_ENABLING) || - (wifiState == WifiManager.WIFI_STATE_ENABLED))) { - wifiManager.setWifiEnabled(false); - Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 1); - } - - boolean success = wifiManager.setWifiApEnabled(null, enable); - /** - * If needed, restore Wifi on tether disable - */ - if (!enable) { - int wifiSavedState = Settings.Global.getInt(cr, Settings.Global.WIFI_SAVED_STATE, 0); - if (wifiSavedState == 1) { - wifiManager.setWifiEnabled(true); - Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 0); - } - } - return success; + return wifiManager.setWifiApEnabled(null, enable); } public static boolean isWifiTetherEnabled(Context context) { @@ -84,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 @@ -93,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); } diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index f6d787c..d5dc0a6 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -561,10 +561,10 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe * Otherwise, allow the connect on UUID change. */ if (!mProfiles.isEmpty() - && ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime() - || (mConnectAttempted == 0))) { + && ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime())) { connectWithoutResettingTimer(false); } + dispatchAttributesChanged(); } |