Home | History | Annotate | Download | only in trust

Lines Matching full:userid

165         int userId;
173 return component.equals(o.component) && userId == o.userId;
178 return component.hashCode() * 31 + userId;
189 public void updateTrust(int userId, int flags) {
190 dispatchOnTrustManagedChanged(aggregateIsTrustManaged(userId), userId);
191 boolean trusted = aggregateIsTrusted(userId);
194 changed = mUserIsTrusted.get(userId) != trusted;
195 mUserIsTrusted.put(userId, trusted);
197 dispatchOnTrustChanged(trusted, userId, flags);
199 refreshDeviceLockedForUser(userId);
203 void refreshAgentList(int userId) {
208 if (userId != UserHandle.USER_ALL && userId < UserHandle.USER_OWNER) {
209 Log.e(TAG, "refreshAgentList(userId=" + userId + "): Invalid user handle,"
211 userId = UserHandle.USER_ALL;
216 if (userId == UserHandle.USER_ALL) {
220 userInfos.add(mUserManager.getUserInfo(userId));
257 agentInfo.userId = userInfo.id;
274 if (userId == UserHandle.USER_ALL || userId == info.userId) {
284 if (userId == UserHandle.USER_ALL) {
287 updateTrust(userId, 0);
292 boolean isDeviceLockedInner(int userId) {
294 return mDeviceLockedForUser.get(userId, true);
298 private void refreshDeviceLockedForUser(int userId) {
299 if (userId != UserHandle.USER_ALL && userId < UserHandle.USER_OWNER) {
300 Log.e(TAG, "refreshDeviceLockedForUser(userId=" + userId + "): Invalid user handle,"
302 userId = UserHandle.USER_ALL;
306 if (userId == UserHandle.USER_ALL) {
310 userInfos.add(mUserManager.getUserInfo(userId));
346 private void dispatchDeviceLocked(int userId, boolean isLocked) {
349 if (agent.userId == userId) {
386 public void resetAgent(ComponentName name, int userId) {
390 if (name.equals(info.component) && userId == info.userId) {
400 updateTrust(userId, 0);
402 refreshAgentList(userId);
461 private void maybeEnableFactoryTrustAgents(LockPatternUtils utils, int userId) {
463 Settings.Secure.TRUST_AGENTS_INITIALIZED, 0, userId)) {
467 List<ResolveInfo> resolveInfos = resolveAllowedTrustAgents(pm, userId);
480 List<ComponentName> previouslyEnabledAgents = utils.getEnabledTrustAgents(userId);
484 utils.setEnabledTrustAgents(discoveredAgents, userId);
486 Settings.Secure.TRUST_AGENTS_INITIALIZED, 1, userId);
489 private List<ResolveInfo> resolveAllowedTrustAgents(PackageManager pm, int userId) {
491 0 /* flags */, userId);
511 private boolean aggregateIsTrusted(int userId) {
512 if (!getUserHasAuthenticated(userId)) {
517 if (info.userId == userId) {
526 private boolean aggregateIsTrustManaged(int userId) {
527 if (!getUserHasAuthenticated(userId)) {
532 if (info.userId == userId) {
541 private void dispatchUnlockAttempt(boolean successful, int userId) {
544 if (info.userId == userId) {
550 updateUserHasAuthenticated(userId);
554 private void updateUserHasAuthenticated(int userId) {
555 boolean changed = setUserHasAuthenticated(userId);
557 refreshAgentList(userId);
561 private boolean getUserHasAuthenticated(int userId) {
562 return mUserHasAuthenticated.get(userId);
568 private boolean setUserHasAuthenticated(int userId) {
569 if (!mUserHasAuthenticated.get(userId)) {
570 mUserHasAuthenticated.put(userId, true);
572 mUserHasAuthenticatedSinceBoot.put(userId, true);
579 private void clearUserHasAuthenticated(int userId) {
580 if (userId == UserHandle.USER_ALL) {
583 mUserHasAuthenticated.put(userId, false);
587 private boolean getUserHasAuthenticatedSinceBoot(int userId) {
589 return mUserHasAuthenticatedSinceBoot.get(userId);
593 private void requireCredentialEntry(int userId) {
594 clearUserHasAuthenticated(userId);
595 refreshAgentList(userId);
619 private void dispatchOnTrustChanged(boolean enabled, int userId, int flags) {
623 mTrustListeners.get(i).onTrustChanged(enabled, userId, flags);
634 private void dispatchOnTrustManagedChanged(boolean managed, int userId) {
637 mTrustListeners.get(i).onTrustManagedChanged(managed, userId);
651 public void onStartUser(int userId) {
652 mHandler.obtainMessage(MSG_START_USER, userId, 0, null).sendToTarget();
656 public void onCleanupUser(int userId) {
657 mHandler.obtainMessage(MSG_CLEANUP_USER, userId, 0, null).sendToTarget();
661 public void onSwitchUser(int userId) {
662 mHandler.obtainMessage(MSG_SWITCH_USER, userId, 0, null).sendToTarget();
669 public void reportUnlockAttempt(boolean authenticated, int userId) throws RemoteException {
671 mHandler.obtainMessage(MSG_DISPATCH_UNLOCK_ATTEMPT, authenticated ? 1 : 0, userId)
676 public void reportEnabledTrustAgentsChanged(int userId) throws RemoteException {
684 public void reportRequireCredentialEntry(int userId) throws RemoteException {
686 if (userId == UserHandle.USER_ALL || userId >= UserHandle.USER_OWNER) {
687 mHandler.obtainMessage(MSG_REQUIRE_CREDENTIAL_ENTRY, userId, 0).sendToTarget();
690 "userId must be an explicit user id or USER_ALL");
715 public boolean isDeviceLocked(int userId) throws RemoteException {
716 userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId,
718 userId = resolveProfileParent(userId);
720 return isDeviceLockedInner(userId);
724 public boolean isDeviceSecure(int userId) throws RemoteException {
725 userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId,
727 userId = resolveProfileParent(userId);
731 return new LockPatternUtils(mContext).isSecure(userId);
738 public boolean hasUserAuthenticatedSinceBoot(int userId) throws RemoteException {
743 return getUserHasAuthenticatedSinceBoot(userId);
805 if (info.userId != user.id) { continue; }
836 private int resolveProfileParent(int userId) {
839 UserInfo parent = mUserManager.getProfileParent(userId);
843 return userId;
914 int userId = getUserId(intent);
915 if (userId > 0) {
916 maybeEnableFactoryTrustAgents(mLockPatternUtils, userId);
919 int userId = getUserId(intent);
920 if (userId > 0) {
921 mUserHasAuthenticated.delete(userId);
923 mUserIsTrusted.delete(userId);
926 mDeviceLockedForUser.delete(userId);
928 refreshAgentList(userId);
929 refreshDeviceLockedForUser(userId);
935 int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -100);
936 if (userId > 0) {
937 return userId;
939 Slog.wtf(TAG, "EXTRA_USER_HANDLE missing or invalid, value=" + userId);