diff options
author | chengzhi.hou <hcz017@gmail.com> | 2015-11-14 15:19:09 +0800 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-02-23 13:47:58 -0800 |
commit | 2c6a658dfb831d65391fb04c3223d74c4bc408d0 (patch) | |
tree | 0c2e28cf659c2f7a0e5bfb593e836a1f20ff5963 /packages/SystemUI | |
parent | e30cc7ef23cf4a558d9e77080e56f0a06fb36475 (diff) | |
download | frameworks_base-2c6a658dfb831d65391fb04c3223d74c4bc408d0.zip frameworks_base-2c6a658dfb831d65391fb04c3223d74c4bc408d0.tar.gz frameworks_base-2c6a658dfb831d65391fb04c3223d74c4bc408d0.tar.bz2 |
SystemUI: Listen for phone state change
Fix: mPhoneState value never change
Change-Id: Ica51c1261aef15a0801e7089b788cd77c8d44d14
Diffstat (limited to 'packages/SystemUI')
-rwxr-xr-x | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 52661e6..2152ede6 100755 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -632,6 +632,7 @@ public class KeyguardViewMediator extends SystemUI { android.Manifest.permission.CONTROL_KEYGUARD, null); mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(KEYGUARD_SERVICE_ACTION_STATE_CHANGE), android.Manifest.permission.CONTROL_KEYGUARD, null); + mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(TelephonyManager.ACTION_PHONE_STATE_CHANGED)); mKeyguardDisplayManager = new KeyguardDisplayManager(mContext); @@ -1379,6 +1380,9 @@ public class KeyguardViewMediator extends SystemUI { } else { mSettingsObserver.unobserve(); } + } else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(intent.getAction())) { + mPhoneState = intent.getStringExtra(TelephonyManager.EXTRA_STATE); + if (DEBUG) Log.d(TAG, "phone state change, new state: " + mPhoneState); } } }; |