summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Prevot <nprevot@google.com> 2016-04-14 10:11:21 +0100
committer Nicolas Prevot <nprevot@google.com> 2016-04-14 13:46:39 +0100
commitc662898a182ca8f13d73b71649feeeeceb574edd (patch)
tree06d9e319c4794d3ed327f32a002d2c86f93e67f9
parenta8c81c1a804cad61735753ff87ebb7bbf1a57383 (diff)
Call notifyLockedProfile in TrustManagerService instead of KeyguardViewMediator.
Setting the profile as locked is not synchronous. In some cases, KeyguardViewMediator called notifyLockedProfile before TrustManagerService had actually marked the profile as locked. BUG:28161912 Change-Id: Ic2ad302c74806ae368d56050eb31503a8ef0bd38
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java8
-rw-r--r--services/core/java/com/android/server/trust/TrustManagerService.java7
2 files changed, 7 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 66754a7fa80c..41926e06bbef 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1217,7 +1217,6 @@ public class KeyguardViewMediator extends SystemUI {
private void lockProfile(int userId) {
mTrustManager.setDeviceLockedForUser(userId, true);
- notifyLockedProfile(userId);
}
private boolean shouldWaitForProvisioning() {
@@ -1547,13 +1546,6 @@ public class KeyguardViewMediator extends SystemUI {
}
}
- private void notifyLockedProfile(@UserIdInt int userId) {
- try {
- ActivityManagerNative.getDefault().notifyLockedProfile(userId);
- } catch (RemoteException e) {
- }
- }
-
/**
* Handle message sent by {@link #showLocked}.
* @see #SHOW
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java
index 984fb7627fea..9b96154b40db 100644
--- a/services/core/java/com/android/server/trust/TrustManagerService.java
+++ b/services/core/java/com/android/server/trust/TrustManagerService.java
@@ -26,6 +26,7 @@ import org.xmlpull.v1.XmlPullParserException;
import android.Manifest;
import android.app.ActivityManager;
+import android.app.ActivityManagerNative;
import android.app.admin.DevicePolicyManager;
import android.app.trust.ITrustListener;
import android.app.trust.ITrustManager;
@@ -318,6 +319,12 @@ public class TrustManagerService extends SystemService {
synchronized (mDeviceLockedForUser) {
mDeviceLockedForUser.put(userId, locked);
}
+ if (locked) {
+ try {
+ ActivityManagerNative.getDefault().notifyLockedProfile(userId);
+ } catch (RemoteException e) {
+ }
+ }
}
}