summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2014-12-10 17:24:18 -0500
committerJason Monk <jmonk@google.com>2014-12-11 15:14:51 -0500
commite69e5f87b3227bddc1315234218717ba3e8439c1 (patch)
treeb39de38c07099a297418cf7caa627fd4c79def55 /packages
parentc5c93edd9354e956d9b0a4d85fc8372907e2b011 (diff)
downloadframeworks_base-e69e5f87b3227bddc1315234218717ba3e8439c1.zip
frameworks_base-e69e5f87b3227bddc1315234218717ba3e8439c1.tar.gz
frameworks_base-e69e5f87b3227bddc1315234218717ba3e8439c1.tar.bz2
Add config to handle periodic check of tether provision
While here also update QS to handle the changes made for this new check. Bug: 18453076 Change-Id: I1f6e2d954562c5a16a0de60dac625005ec3e5c50
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) ||