* commit '44b43a51c7d7e5c2cbe1d9912ee4a21686fa1a58': GlobalActions: Fix Airplane Mode on/off issue
This commit is contained in:
@@ -121,13 +121,14 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
|
|||||||
filter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
filter.addAction(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
||||||
context.registerReceiver(mBroadcastReceiver, filter);
|
context.registerReceiver(mBroadcastReceiver, filter);
|
||||||
|
|
||||||
|
ConnectivityManager cm = (ConnectivityManager)
|
||||||
|
context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
mHasTelephony = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
|
||||||
|
|
||||||
// get notified of phone state changes
|
// get notified of phone state changes
|
||||||
TelephonyManager telephonyManager =
|
TelephonyManager telephonyManager =
|
||||||
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
telephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE);
|
telephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE);
|
||||||
ConnectivityManager cm = (ConnectivityManager)
|
|
||||||
context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
||||||
mHasTelephony = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
|
|
||||||
mContext.getContentResolver().registerContentObserver(
|
mContext.getContentResolver().registerContentObserver(
|
||||||
Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON), true,
|
Settings.Global.getUriFor(Settings.Global.AIRPLANE_MODE_ON), true,
|
||||||
mAirplaneModeObserver);
|
mAirplaneModeObserver);
|
||||||
|
|||||||
Reference in New Issue
Block a user