summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-05-16 20:13:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-16 20:13:30 +0000
commit4b0ec7e924a9d0665cc44dfed17d85c00ba9b0ce (patch)
tree867bf35832ab530ba8288b404ce724f93b18830e /services
parentdc0d5d185003ed1e375e727e2fa9bbc084c65180 (diff)
parent7046bfd054b67fd3cfe8f462f7b9ea126652610f (diff)
downloadframeworks_base-4b0ec7e924a9d0665cc44dfed17d85c00ba9b0ce.zip
frameworks_base-4b0ec7e924a9d0665cc44dfed17d85c00ba9b0ce.tar.gz
frameworks_base-4b0ec7e924a9d0665cc44dfed17d85c00ba9b0ce.tar.bz2
Merge "Trust Agents: Withhold trust until user has authenticated"
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/trust/TrustManagerService.java10
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