summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com')
-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) ||