Loading services/core/java/com/android/server/trust/TrustManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1573,7 +1573,7 @@ public class TrustManagerService extends SystemService { @Override public void reportUserMayRequestUnlock(int userId) throws RemoteException { enforceReportPermission(); mHandler.obtainMessage(MSG_USER_MAY_REQUEST_UNLOCK, userId).sendToTarget(); mHandler.obtainMessage(MSG_USER_MAY_REQUEST_UNLOCK, userId, /*arg2=*/ 0).sendToTarget(); } @Override Loading tests/TrustTests/src/android/trust/test/UserUnlockRequestTest.kt +10 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,16 @@ class UserUnlockRequestTest { .isEqualTo(oldCount + 1) } @Test fun reportUserMayRequestUnlock_differentUserId_doesNotPropagateToAgent() { val oldCount = trustAgentRule.agent.onUserMayRequestUnlockCallCount trustManager.reportUserMayRequestUnlock(userId + 1) await() assertThat(trustAgentRule.agent.onUserMayRequestUnlockCallCount) .isEqualTo(oldCount) } companion object { private const val TAG = "UserUnlockRequestTest" private fun await() = Thread.sleep(250) Loading Loading
services/core/java/com/android/server/trust/TrustManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1573,7 +1573,7 @@ public class TrustManagerService extends SystemService { @Override public void reportUserMayRequestUnlock(int userId) throws RemoteException { enforceReportPermission(); mHandler.obtainMessage(MSG_USER_MAY_REQUEST_UNLOCK, userId).sendToTarget(); mHandler.obtainMessage(MSG_USER_MAY_REQUEST_UNLOCK, userId, /*arg2=*/ 0).sendToTarget(); } @Override Loading
tests/TrustTests/src/android/trust/test/UserUnlockRequestTest.kt +10 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,16 @@ class UserUnlockRequestTest { .isEqualTo(oldCount + 1) } @Test fun reportUserMayRequestUnlock_differentUserId_doesNotPropagateToAgent() { val oldCount = trustAgentRule.agent.onUserMayRequestUnlockCallCount trustManager.reportUserMayRequestUnlock(userId + 1) await() assertThat(trustAgentRule.agent.onUserMayRequestUnlockCallCount) .isEqualTo(oldCount) } companion object { private const val TAG = "UserUnlockRequestTest" private fun await() = Thread.sleep(250) Loading