Loading services/core/java/com/android/server/trust/TrustAgentWrapper.java +8 −1 Original line number Diff line number Diff line Loading @@ -309,6 +309,7 @@ public class TrustAgentWrapper { mTrusted = false; mTrustable = false; mTrustManagerService.updateTrust(mUserId, 0 /* flags */); mTrustManagerService.mArchive.logUserLocked(mUserId, mName); mTrustManagerService.lockUser(mUserId); break; } Loading Loading @@ -615,6 +616,11 @@ public class TrustAgentWrapper { } } /** * Updates the trust agent's configuration based on the current device policy. * * @return true if the device policy features changed. */ boolean updateDevicePolicyFeatures() { boolean trustDisabled = false; if (DEBUG) Slog.d(TAG, "updateDevicePolicyFeatures(" + mName + ")"); Loading Loading @@ -658,8 +664,9 @@ public class TrustAgentWrapper { if (mTrustDisabledByDpm != trustDisabled) { mTrustDisabledByDpm = trustDisabled; mTrustManagerService.updateTrust(mUserId, 0); return true; } return trustDisabled; return false; } public boolean isTrusted() { Loading services/core/java/com/android/server/trust/TrustArchive.java +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class TrustArchive { private static final int TYPE_AGENT_STOPPED = 5; private static final int TYPE_MANAGING_TRUST = 6; private static final int TYPE_POLICY_CHANGED = 7; private static final int TYPE_USER_LOCKED = 8; private static final int HISTORY_LIMIT = 200; Loading Loading @@ -104,6 +105,10 @@ public class TrustArchive { addEvent(new Event(TYPE_POLICY_CHANGED, UserHandle.USER_ALL, null, null, 0, 0, false)); } public void logUserLocked(int userId, ComponentName agent) { addEvent(new Event(TYPE_USER_LOCKED, userId, agent, null, 0, 0, false)); } private void addEvent(Event e) { if (mEvents.size() >= HISTORY_LIMIT) { mEvents.removeFirst(); Loading Loading @@ -191,6 +196,8 @@ public class TrustArchive { return "ManagingTrust"; case TYPE_POLICY_CHANGED: return "DevicePolicyChanged"; case TYPE_USER_LOCKED: return "UserLocked"; default: return "Unknown(" + type + ")"; } Loading services/core/java/com/android/server/trust/TrustManagerService.java +1 −2 Original line number Diff line number Diff line Loading @@ -1162,8 +1162,7 @@ public class TrustManagerService extends SystemService { for (int i = 0; i < mActiveAgents.size(); i++) { AgentInfo info = mActiveAgents.valueAt(i); if (info.agent.isConnected()) { info.agent.updateDevicePolicyFeatures(); changed = true; changed |= info.agent.updateDevicePolicyFeatures(); } } if (changed) { Loading Loading
services/core/java/com/android/server/trust/TrustAgentWrapper.java +8 −1 Original line number Diff line number Diff line Loading @@ -309,6 +309,7 @@ public class TrustAgentWrapper { mTrusted = false; mTrustable = false; mTrustManagerService.updateTrust(mUserId, 0 /* flags */); mTrustManagerService.mArchive.logUserLocked(mUserId, mName); mTrustManagerService.lockUser(mUserId); break; } Loading Loading @@ -615,6 +616,11 @@ public class TrustAgentWrapper { } } /** * Updates the trust agent's configuration based on the current device policy. * * @return true if the device policy features changed. */ boolean updateDevicePolicyFeatures() { boolean trustDisabled = false; if (DEBUG) Slog.d(TAG, "updateDevicePolicyFeatures(" + mName + ")"); Loading Loading @@ -658,8 +664,9 @@ public class TrustAgentWrapper { if (mTrustDisabledByDpm != trustDisabled) { mTrustDisabledByDpm = trustDisabled; mTrustManagerService.updateTrust(mUserId, 0); return true; } return trustDisabled; return false; } public boolean isTrusted() { Loading
services/core/java/com/android/server/trust/TrustArchive.java +7 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class TrustArchive { private static final int TYPE_AGENT_STOPPED = 5; private static final int TYPE_MANAGING_TRUST = 6; private static final int TYPE_POLICY_CHANGED = 7; private static final int TYPE_USER_LOCKED = 8; private static final int HISTORY_LIMIT = 200; Loading Loading @@ -104,6 +105,10 @@ public class TrustArchive { addEvent(new Event(TYPE_POLICY_CHANGED, UserHandle.USER_ALL, null, null, 0, 0, false)); } public void logUserLocked(int userId, ComponentName agent) { addEvent(new Event(TYPE_USER_LOCKED, userId, agent, null, 0, 0, false)); } private void addEvent(Event e) { if (mEvents.size() >= HISTORY_LIMIT) { mEvents.removeFirst(); Loading Loading @@ -191,6 +196,8 @@ public class TrustArchive { return "ManagingTrust"; case TYPE_POLICY_CHANGED: return "DevicePolicyChanged"; case TYPE_USER_LOCKED: return "UserLocked"; default: return "Unknown(" + type + ")"; } Loading
services/core/java/com/android/server/trust/TrustManagerService.java +1 −2 Original line number Diff line number Diff line Loading @@ -1162,8 +1162,7 @@ public class TrustManagerService extends SystemService { for (int i = 0; i < mActiveAgents.size(); i++) { AgentInfo info = mActiveAgents.valueAt(i); if (info.agent.isConnected()) { info.agent.updateDevicePolicyFeatures(); changed = true; changed |= info.agent.updateDevicePolicyFeatures(); } } if (changed) { Loading