summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2014-12-16 15:44:04 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-16 15:44:07 +0000
commit052e9b12f5fc7a1e3ecdd126ca8c07298941f291 (patch)
treeccc32f7644271cf1eed362219ceba0dfe396a954 /packages
parent48f9c8e48c5d765afc025c2bda3695d0dd13388e (diff)
parente69e5f87b3227bddc1315234218717ba3e8439c1 (diff)
downloadframeworks_base-052e9b12f5fc7a1e3ecdd126ca8c07298941f291.zip
frameworks_base-052e9b12f5fc7a1e3ecdd126ca8c07298941f291.tar.gz
frameworks_base-052e9b12f5fc7a1e3ecdd126ca8c07298941f291.tar.bz2
Merge "Add config to handle periodic check of tether provision" into lmp-mr1-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java14
2 files changed, 14 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index 6e710ef..fcc517f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -88,9 +88,7 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleUpdateState(BooleanState state, Object arg) {
- state.visible = mController.isHotspotSupported() && mUsageTracker.isRecentlyUsed()
- && !(mController.isProvisioningNeeded() && mKeyguard.isSecure()
- && mKeyguard.isShowing());
+ state.visible = mController.isHotspotSupported() && mUsageTracker.isRecentlyUsed();
state.label = mContext.getString(R.string.quick_settings_hotspot_label);
state.value = mController.isHotspotEnabled();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
index b05cb31..5f7d452 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
@@ -36,6 +36,14 @@ public class HotspotControllerImpl implements HotspotController {
private static final String TAG = "HotspotController";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+ // Keep these in sync with Settings TetherService.java
+ public static final String EXTRA_ADD_TETHER_TYPE = "extraAddTetherType";
+ public static final String EXTRA_SET_ALARM = "extraSetAlarm";
+ public static final String EXTRA_RUN_PROVISION = "extraRunProvision";
+ public static final String EXTRA_ENABLE_WIFI_TETHER = "extraEnableWifiTether";
+ // Keep this in sync with Settings TetherSettings.java
+ public static final int WIFI_TETHERING = 0;
+
private final ArrayList<Callback> mCallbacks = new ArrayList<Callback>();
private final Receiver mReceiver = new Receiver();
private final Context mContext;
@@ -97,9 +105,13 @@ public class HotspotControllerImpl implements HotspotController {
String tetherEnable = mContext.getResources().getString(
com.android.internal.R.string.config_wifi_tether_enable);
Intent intent = new Intent();
+ intent.putExtra(EXTRA_ADD_TETHER_TYPE, WIFI_TETHERING);
+ intent.putExtra(EXTRA_SET_ALARM, true);
+ intent.putExtra(EXTRA_RUN_PROVISION, true);
+ intent.putExtra(EXTRA_ENABLE_WIFI_TETHER, true);
intent.setComponent(ComponentName.unflattenFromString(tetherEnable));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- mContext.startActivityAsUser(intent, UserHandle.CURRENT);
+ mContext.startServiceAsUser(intent, UserHandle.CURRENT);
} else {
int wifiState = mWifiManager.getWifiState();
if ((wifiState == WifiManager.WIFI_STATE_ENABLING) ||