diff options
author | Adrian Roos <roosa@google.com> | 2014-05-16 21:20:54 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-05-16 21:24:29 +0200 |
commit | 7046bfd054b67fd3cfe8f462f7b9ea126652610f (patch) | |
tree | 855faab3db922ea72bd48e817ebe804659104e5c /services | |
parent | ca36b95bd3e0cc8b6f1685bd57a09419db756b91 (diff) | |
download | frameworks_base-7046bfd054b67fd3cfe8f462f7b9ea126652610f.zip frameworks_base-7046bfd054b67fd3cfe8f462f7b9ea126652610f.tar.gz frameworks_base-7046bfd054b67fd3cfe8f462f7b9ea126652610f.tar.bz2 |
Trust Agents: Withhold trust until user has authenticated
Bug: 14229695
Change-Id: I40d9fa442aa05437c20081c007ed64f984042418
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/trust/TrustManagerService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java index 44af41c..c1b9a33 100644 --- a/services/core/java/com/android/server/trust/TrustManagerService.java +++ b/services/core/java/com/android/server/trust/TrustManagerService.java @@ -49,6 +49,7 @@ import android.service.trust.TrustAgentService; import android.util.ArraySet; import android.util.AttributeSet; import android.util.Slog; +import android.util.SparseBooleanArray; import android.util.Xml; import java.io.IOException; @@ -85,6 +86,7 @@ public class TrustManagerService extends SystemService { private final ArraySet<AgentInfo> mActiveAgents = new ArraySet<AgentInfo>(); private final ArrayList<ITrustListener> mTrustListeners = new ArrayList<ITrustListener>(); private final DevicePolicyReceiver mDevicePolicyReceiver = new DevicePolicyReceiver(); + private final SparseBooleanArray mUserHasAuthenticatedSinceBoot = new SparseBooleanArray(); private final Context mContext; private UserManager mUserManager; @@ -268,6 +270,9 @@ public class TrustManagerService extends SystemService { // Agent dispatch and aggregation private boolean aggregateIsTrusted(int userId) { + if (!mUserHasAuthenticatedSinceBoot.get(userId)) { + return false; + } for (int i = 0; i < mActiveAgents.size(); i++) { AgentInfo info = mActiveAgents.valueAt(i); if (info.userId == userId) { @@ -286,6 +291,11 @@ public class TrustManagerService extends SystemService { info.agent.onUnlockAttempt(successful); } } + + if (successful && !mUserHasAuthenticatedSinceBoot.get(userId)) { + mUserHasAuthenticatedSinceBoot.put(userId, true); + updateTrust(userId); + } } // Listeners |