summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2014-09-01 14:59:23 +0200
committer Adrian Roos <roosa@google.com> 2014-09-01 16:03:38 +0200
commit48c796cad62b5dcd488a6018cb0289baa0e442db (patch)
tree3c5e7cb609c4858dbaf1513a02c0184ef93d7e4c
parent8591fb27c01f340edb390e689658a9a4591a52e7 (diff)
Keyguard: Register user specific broadcasts correctly
Fixes the face unlock indicator only working for the owner user. While we're at it, also fix other broadcasts that should have been registered for all users and not just the owner. Bug: 17251445 Change-Id: I53cad656d7d1e1d312bff2eebfc0c23ea467e0b7
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java38
1 files changed, 20 insertions, 18 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index dc12cc799fba..2da3b27a2f0b 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -367,8 +367,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
if (Intent.ACTION_TIME_TICK.equals(action)
|| Intent.ACTION_TIME_CHANGED.equals(action)
- || Intent.ACTION_TIMEZONE_CHANGED.equals(action)
- || AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED.equals(action)) {
+ || Intent.ACTION_TIMEZONE_CHANGED.equals(action)) {
mHandler.sendEmptyMessage(MSG_TIME_UPDATE);
} else if (TelephonyIntents.SPN_STRINGS_UPDATED_ACTION.equals(action)) {
mTelephonyPlmn = getTelephonyPlmnFrom(intent);
@@ -395,20 +394,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
} else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action)) {
String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
mHandler.sendMessage(mHandler.obtainMessage(MSG_PHONE_STATE_CHANGED, state));
- } else if (DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED
- .equals(action)) {
- mHandler.sendEmptyMessage(MSG_DPM_STATE_CHANGED);
} else if (Intent.ACTION_USER_REMOVED.equals(action)) {
mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_REMOVED,
intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0), 0));
} else if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
dispatchBootCompleted();
- } else if (ACTION_FACE_UNLOCK_STARTED.equals(action)) {
- mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 1,
- getSendingUserId()));
- } else if (ACTION_FACE_UNLOCK_STOPPED.equals(action)) {
- mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 0,
- getSendingUserId()));
}
}
};
@@ -417,9 +407,20 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
- if (Intent.ACTION_USER_INFO_CHANGED.equals(action)) {
+ if (AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED.equals(action)) {
+ mHandler.sendEmptyMessage(MSG_TIME_UPDATE);
+ } else if (Intent.ACTION_USER_INFO_CHANGED.equals(action)) {
mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_INFO_CHANGED,
intent.getIntExtra(Intent.EXTRA_USER_HANDLE, getSendingUserId()), 0));
+ } else if (ACTION_FACE_UNLOCK_STARTED.equals(action)) {
+ mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 1,
+ getSendingUserId()));
+ } else if (ACTION_FACE_UNLOCK_STOPPED.equals(action)) {
+ mHandler.sendMessage(mHandler.obtainMessage(MSG_FACE_UNLOCK_STATE_CHANGED, 0,
+ getSendingUserId()));
+ } else if (DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED
+ .equals(action)) {
+ mHandler.sendEmptyMessage(MSG_DPM_STATE_CHANGED);
}
}
};
@@ -618,11 +619,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
filter.addAction(TelephonyIntents.SPN_STRINGS_UPDATED_ACTION);
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
- filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
filter.addAction(Intent.ACTION_USER_REMOVED);
- filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
- filter.addAction(ACTION_FACE_UNLOCK_STARTED);
- filter.addAction(ACTION_FACE_UNLOCK_STOPPED);
context.registerReceiver(mBroadcastReceiver, filter);
final IntentFilter bootCompleteFilter = new IntentFilter();
@@ -630,8 +627,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
bootCompleteFilter.addAction(Intent.ACTION_BOOT_COMPLETED);
context.registerReceiver(mBroadcastReceiver, bootCompleteFilter);
- final IntentFilter userInfoFilter = new IntentFilter(Intent.ACTION_USER_INFO_CHANGED);
- context.registerReceiverAsUser(mBroadcastAllReceiver, UserHandle.ALL, userInfoFilter,
+ final IntentFilter allUserFilter = new IntentFilter();
+ allUserFilter.addAction(Intent.ACTION_USER_INFO_CHANGED);
+ allUserFilter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
+ allUserFilter.addAction(ACTION_FACE_UNLOCK_STARTED);
+ allUserFilter.addAction(ACTION_FACE_UNLOCK_STOPPED);
+ allUserFilter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
+ context.registerReceiverAsUser(mBroadcastAllReceiver, UserHandle.ALL, allUserFilter,
null, null);
try {