Home | History | Annotate | Download | only in server

Lines Matching full:userid

79         void setCredential(String credential, String savedCredential, int userId)
81 byte[] toHash(String credential, int userId);
168 final int userId = users.get(user).id;
170 String ownerInfo = Settings.Secure.getStringForUser(cr, OWNER_INFO, userId);
172 setString(OWNER_INFO, ownerInfo, userId);
173 Settings.Secure.putStringForUser(cr, ownerInfo, "", userId);
182 int ivalue = Settings.Secure.getIntForUser(cr, OWNER_INFO_ENABLED, userId);
184 setLong(OWNER_INFO_ENABLED, enabled ? 1 : 0, userId);
188 setLong(OWNER_INFO_ENABLED, 1, userId);
191 Settings.Secure.putIntForUser(cr, OWNER_INFO_ENABLED, 0, userId);
203 int userId = users.get(i).id;
206 userId);
209 userId);
213 userId);
217 userId);
256 private final void checkWritePermission(int userId) {
260 private final void checkPasswordReadPermission(int userId) {
264 private final void checkReadPermission(String requestedKey, int userId) {
273 + requestedKey + " for user " + userId);
283 + requestedKey + " for user " + userId);
289 public void setBoolean(String key, boolean value, int userId) throws RemoteException {
290 checkWritePermission(userId);
291 setStringUnchecked(key, userId, value ? "1" : "0");
295 public void setLong(String key, long value, int userId) throws RemoteException {
296 checkWritePermission(userId);
297 setStringUnchecked(key, userId, Long.toString(value));
301 public void setString(String key, String value, int userId) throws RemoteException {
302 checkWritePermission(userId);
303 setStringUnchecked(key, userId, value);
306 private void setStringUnchecked(String key, int userId, String value) {
307 mStorage.writeKeyValue(key, value, userId);
314 public boolean getBoolean(String key, boolean defaultValue, int userId) throws RemoteException {
315 checkReadPermission(key, userId);
316 String value = getStringUnchecked(key, null, userId);
322 public long getLong(String key, long defaultValue, int userId) throws RemoteException {
323 checkReadPermission(key, userId);
325 String value = getStringUnchecked(key, null, userId);
330 public String getString(String key, String defaultValue, int userId) throws RemoteException {
331 checkReadPermission(key, userId);
333 return getStringUnchecked(key, defaultValue, userId);
336 public String getStringUnchecked(String key, String defaultValue, int userId) {
340 return mLockPatternUtils.isLockPatternEnabled(userId) ? "1" : "0";
346 return mStorage.readKeyValue(key, defaultValue, userId);
350 public boolean havePassword(int userId) throws RemoteException {
353 return mStorage.hasPassword(userId);
357 public boolean havePattern(int userId) throws RemoteException {
360 return mStorage.hasPattern(userId);
384 private byte[] getCurrentHandle(int userId) {
388 int currentHandleType = mStorage.getStoredCredentialType(userId);
391 credential = mStorage.readPatternHash(userId);
397 credential = mStorage.readPasswordHash(userId);
418 public void setLockPattern(String pattern, String savedCredential, int userId)
420 byte[] currentHandle = getCurrentHandle(userId);
423 getGateKeeperService().clearSecureUserId(userId);
424 mStorage.writePatternHash(null, userId);
425 setKeystorePassword(null, userId);
436 byte[] enrolledHandle = enrollCredential(currentHandle, savedCredential, pattern, userId);
438 mStorage.writePatternHash(enrolledHandle, userId);
446 public void setLockPassword(String password, String savedCredential, int userId)
448 byte[] currentHandle = getCurrentHandle(userId);
451 getGateKeeperService().clearSecureUserId(userId);
452 mStorage.writePasswordHash(null, userId);
453 setKeystorePassword(null, userId);
464 byte[] enrolledHandle = enrollCredential(currentHandle, savedCredential, password, userId);
466 mStorage.writePasswordHash(enrolledHandle, userId);
473 String enrolledCredential, String toEnroll, int userId)
475 checkWritePermission(userId);
482 GateKeeperResponse response = getGateKeeperService().enroll(userId, enrolledHandle,
491 setKeystorePassword(toEnroll, userId);
500 public VerifyCredentialResponse checkPattern(String pattern, int userId) throws RemoteException {
501 return doVerifyPattern(pattern, false, 0, userId);
505 public VerifyCredentialResponse verifyPattern(String pattern, long challenge, int userId)
507 return doVerifyPattern(pattern, true, challenge, userId);
511 long challenge, int userId) throws RemoteException {
512 checkPasswordReadPermission(userId);
513 CredentialHash storedHash = mStorage.readPatternHash(userId);
523 VerifyCredentialResponse response = verifyCredential(userId, storedHash, patternToVerify,
527 public void setCredential(String pattern, String oldPattern, int userId)
529 setLockPattern(pattern, oldPattern, userId);
533 public byte[] toHash(String pattern, int userId) {
547 setLockPattern(pattern, patternToVerify, userId);
555 public VerifyCredentialResponse checkPassword(String password, int userId)
557 return doVerifyPassword(password, false, 0, userId);
561 public VerifyCredentialResponse verifyPassword(String password, long challenge, int userId)
563 return doVerifyPassword(password, true, challenge, userId);
567 long challenge, int userId) throws RemoteException {
568 checkPasswordReadPermission(userId);
569 CredentialHash storedHash = mStorage.readPasswordHash(userId);
570 return verifyCredential(userId, storedHash, password, hasChallenge, challenge,
573 public void setCredential(String password, String oldPassword, int userId)
575 setLockPassword(password, oldPassword, userId);
579 public byte[] toHash(String password, int userId) {
580 return mLockPatternUtils.passwordToHash(password, userId);
591 private VerifyCredentialResponse verifyCredential(int userId, CredentialHash storedHash,
604 byte[] hash = credentialUtil.toHash(credential, userId);
606 unlockKeystore(credentialUtil.adjustForKeystore(credential), userId);
608 credentialUtil.setCredential(credential, null, userId);
625 .verifyChallenge(userId, challenge, storedHash.hash, credential.getBytes());
644 userId, storedHash.hash, credential.getBytes());
658 unlockKeystore(credential, userId);
660 credentialUtil.setCredential(credential, credential, userId);
668 public boolean checkVoldPassword(int userId) throws RemoteException {
674 checkPasswordReadPermission(userId);
692 if (mLockPatternUtils.isLockPatternEnabled(userId)) {
693 if (checkPattern(password, userId).getResponseCode()
702 if (mLockPatternUtils.isLockPasswordEnabled(userId)) {
703 if (checkPassword(password, userId).getResponseCode()
714 private void removeUser(int userId) {
715 mStorage.removeUser(userId);
718 ks.onUserRemoved(userId);
723 gk.clearSecureUserId(userId);