From 2c6a658dfb831d65391fb04c3223d74c4bc408d0 Mon Sep 17 00:00:00 2001 From: "chengzhi.hou" Date: Sat, 14 Nov 2015 15:19:09 +0800 Subject: SystemUI: Listen for phone state change Fix: mPhoneState value never change Change-Id: Ica51c1261aef15a0801e7089b788cd77c8d44d14 --- .../src/com/android/systemui/keyguard/KeyguardViewMediator.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages') 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); } } }; -- cgit v1.1