summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authornagarw <nagarw@codeaurora.org>2014-02-20 17:10:46 +0530
committerHariprasad Jayakumar <hjayak@codeaurora.org>2014-03-28 16:54:58 -0700
commitc3b7e6fd44593c3974e989d8ccf2097b4471b2b7 (patch)
tree144d6b0d065d6514323a11d2a6cb99f8f7069703 /policy
parent77ceb5e8f18608cdbf19831f6188db87a5e0c058 (diff)
downloadframeworks_base-c3b7e6fd44593c3974e989d8ccf2097b4471b2b7.zip
frameworks_base-c3b7e6fd44593c3974e989d8ccf2097b4471b2b7.tar.gz
frameworks_base-c3b7e6fd44593c3974e989d8ccf2097b4471b2b7.tar.bz2
GlobalActions: Fix Airplane Mode on/off issue
Issue: Unable to turn off Airplane mode from power button after phone reboot Fix: Initialize mHasTelephony before the PhoneStateListener is registered to the TelephonyManager so that correct value of mHasTelephony is reflected when onServiceStateChanged callback is called. Bug: 13697360 Change-Id: Ide8afd9c16ea90b98b5912dbff440c5fd67b178d
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/GlobalActions.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index 7c0735b..4db7d4d 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -121,13 +121,14 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
filter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
context.registerReceiver(mBroadcastReceiver, filter);
+ ConnectivityManager cm = (ConnectivityManager)
+ context.getSystemService(Context.CONNECTIVITY_SERVICE);
+ mHasTelephony = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
+
// get notified of phone state changes
TelephonyManager telephonyManager =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE);
- ConnectivityManager cm = (ConnectivityManager)
- context.getSystemService(Context.CONNECTIVITY_SERVICE);
- mHasTelephony = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
mContext.getContentResolver().registerContentObserver(
Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON), true,
mAirplaneModeObserver);