From 829f7c72e56710763f1225bbc1efb53956cca83c Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Mon, 29 Feb 2016 14:38:17 +0000 Subject: [PATCH] ConnectivityService: listen to USER_UNLOCKED too When the credential-encrypted private storage for the target user is unlocked, we should try to start up VPN for them. Bug: 27357283 Change-Id: Id9079230d00e3cea08a49ae66bd1f553416b4f54 --- .../core/java/com/android/server/ConnectivityService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 430092071d..25b6fdd4c3 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -750,7 +750,7 @@ public class ConnectivityService extends IConnectivityManager.Stub intentFilter.addAction(Intent.ACTION_USER_STOPPING); intentFilter.addAction(Intent.ACTION_USER_ADDED); intentFilter.addAction(Intent.ACTION_USER_REMOVED); - intentFilter.addAction(Intent.ACTION_USER_PRESENT); + intentFilter.addAction(Intent.ACTION_USER_UNLOCKED); mContext.registerReceiverAsUser( mUserIntentReceiver, UserHandle.ALL, intentFilter, null, null); @@ -3633,7 +3633,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } } - private void onUserPresent(int userId) { + private void onUserUnlocked(int userId) { // User present may be sent because of an unlock, which might mean an unlocked keystore. if (mUserManager.getUserInfo(userId).isPrimary() && LockdownVpnTracker.isEnabled()) { updateLockdownVpn(); @@ -3657,8 +3657,8 @@ public class ConnectivityService extends IConnectivityManager.Stub onUserAdded(userId); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { onUserRemoved(userId); - } else if (Intent.ACTION_USER_PRESENT.equals(action)) { - onUserPresent(userId); + } else if (Intent.ACTION_USER_UNLOCKED.equals(action)) { + onUserUnlocked(userId); } } };