diff options
4 files changed, 17 insertions, 0 deletions
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml index 06acce2..ab5a8eb 100644 --- a/packages/SystemUI/res/values-zh-rCN/strings.xml +++ b/packages/SystemUI/res/values-zh-rCN/strings.xml @@ -433,4 +433,5 @@ <string name="enable_bluetooth_title" msgid="5027037706500635269">"要开启蓝牙吗?"</string> <string name="enable_bluetooth_message" msgid="9106595990708985385">"要将您的键盘连接到平板电脑,您必须先开启蓝牙。"</string> <string name="enable_bluetooth_confirmation_ok" msgid="6258074250948309715">"开启"</string> + <string name="hotspot_apm_message">"飞行模式开启的情况下不能够链接到移动网络,请关闭飞行模式后重试。"</string> </resources> diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml index ef5cd39..b1e53b1 100644 --- a/packages/SystemUI/res/values-zh-rHK/strings.xml +++ b/packages/SystemUI/res/values-zh-rHK/strings.xml @@ -433,4 +433,5 @@ <string name="enable_bluetooth_title" msgid="5027037706500635269">"要開啟藍牙嗎?"</string> <string name="enable_bluetooth_message" msgid="9106595990708985385">"如要將鍵盤連接至平板電腦,請先開啟藍牙。"</string> <string name="enable_bluetooth_confirmation_ok" msgid="6258074250948309715">"開啟"</string> + <string name="hotspot_apm_message">"飛行模式開啟的情況下不能夠鏈接到移動網絡,請關閉飛行模式後重試。"</string> </resources> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index dc9c9fd..2c3de9a 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1135,5 +1135,7 @@ <!-- Bluetooth enablement ok text [CHAR LIMIT=40] --> <string name="enable_bluetooth_confirmation_ok">Turn on</string> + <!-- Hotspot dialog message --> + <string name="hotspot_apm_message">Unable to connect to mobile networks while Airplane mode is enabled. Disable Airplane mode and try again.</string> </resources> 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); |