diff options
author | Shufeng Hou <shou@codeaurora.org> | 2015-12-04 16:38:52 +0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-01-23 23:28:18 -0800 |
commit | 8c78865c55eca516154ae6ca1ff51f560bb1f7fb (patch) | |
tree | d876b7bbb0717ca1980288a7634eea2cfb5c3bfd /packages/SystemUI/src | |
parent | d97c3417adfa64530af18afde74d198349e09b0a (diff) | |
download | frameworks_base-8c78865c55eca516154ae6ca1ff51f560bb1f7fb.zip frameworks_base-8c78865c55eca516154ae6ca1ff51f560bb1f7fb.tar.gz frameworks_base-8c78865c55eca516154ae6ca1ff51f560bb1f7fb.tar.bz2 |
SystemUI: Do not turn on Wifi hotspot in APM Mode
Do not turn on hotspot in APM Mode and show clear alert message
Change-Id: I3afcc92a93707e15cd436ebc1cffb74567443483
CRs-Fixed: 926474
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java | 13 |
1 files changed, 13 insertions, 0 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 4173efc..d1b167e 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java @@ -21,12 +21,14 @@ import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.provider.Settings; import com.android.internal.logging.MetricsLogger; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.qs.QSTile; import com.android.systemui.qs.UsageTracker; +import com.android.systemui.statusbar.phone.SystemUIDialog; import com.android.systemui.statusbar.policy.HotspotController; /** Quick settings tile: Hotspot **/ @@ -72,6 +74,17 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { + boolean airplaneMode = (Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.AIRPLANE_MODE_ON, 0) == 1); + if (airplaneMode) { + SystemUIDialog d = new SystemUIDialog(mContext); + d.setTitle(R.string.quick_settings_hotspot_label); + d.setMessage(R.string.hotspot_apm_message); + d.setPositiveButton(com.android.internal.R.string.ok, null); + d.setShowForAllUsers(true); + d.show(); + return; + } final boolean isEnabled = (Boolean) mState.value; MetricsLogger.action(mContext, getMetricsCategory(), !isEnabled); mController.setHotspotEnabled(!isEnabled); |