コード例 #1
0
 @Override
 public void setLockPattern(String pattern, int userId) throws RemoteException {
   Log.d(TAG, "setLockPattern(pt = " + pattern + ")");
   mService.setLockPattern(pattern, userId);
   boolean result = (pattern != null);
   Log.d(TAG, "setLockPattern() - set val = " + result);
   setBoolean(HAS_LOCK_PATTERN_CACHE_KEY, result, userId);
 }
コード例 #2
0
 public String getString(String key, String defaultValue, int userId) throws RemoteException {
   Object value = peekCache(key, userId);
   if (value instanceof String) {
     return (String) value;
   }
   String result = mService.getString(key, defaultValue, userId);
   putCache(key, userId, result);
   return result;
 }
コード例 #3
0
  @Override
  public void setLockPassword(String password, int userId) throws RemoteException {
    if (TextUtils.isEmpty(password)) {
      password = null;
    }

    mService.setLockPassword(password, userId);
    setBoolean(HAS_LOCK_PASSWORD_CACHE_KEY, password != null, userId);
  }
コード例 #4
0
 public boolean getBoolean(String key, boolean defaultValue, int userId) throws RemoteException {
   Object value = peekCache(key, userId);
   if (value instanceof Boolean) {
     return (boolean) value;
   }
   boolean result = mService.getBoolean(key, defaultValue, userId);
   putCache(key, userId, result);
   return result;
 }
コード例 #5
0
 private LockPatternUtilsCache(ILockSettings service) {
   mService = service;
   try {
     service.registerObserver(mObserver);
   } catch (RemoteException e) {
     // Not safe to do caching without the observer. System process has probably died
     // anyway, so crashing here is fine.
     throw new RuntimeException(e);
   }
 }
コード例 #6
0
 @Override
 public boolean havePassword(int userId) throws RemoteException {
   Object value = peekCache(HAS_LOCK_PASSWORD_CACHE_KEY, userId);
   if (value instanceof Boolean) {
     return (boolean) value;
   }
   boolean result = mService.havePassword(userId);
   putCache(HAS_LOCK_PASSWORD_CACHE_KEY, userId, result);
   return result;
 }
コード例 #7
0
  @Override
  public boolean havePattern(int userId) throws RemoteException {
    Object value = peekCache(HAS_LOCK_PATTERN_CACHE_KEY, userId);
    if (value instanceof Boolean) {
      Log.d(TAG, "havePattern() - cache = " + (boolean) value);
      return (boolean) value;
    }

    boolean result = mService.havePattern(userId);
    Log.d(TAG, "havePattern() - service = " + result);
    putCache(HAS_LOCK_PATTERN_CACHE_KEY, userId, result);

    return result;
  }
コード例 #8
0
 public void setString(String key, String value, int userId) throws RemoteException {
   invalidateCache(key, userId);
   mService.setString(key, value, userId);
   putCache(key, userId, value);
 }
コード例 #9
0
 @Override
 public IBinder asBinder() {
   return mService.asBinder();
 }
コード例 #10
0
 @Override
 public void unregisterObserver(ILockSettingsObserver observer) throws RemoteException {
   mService.unregisterObserver(observer);
 }
コード例 #11
0
 @Override
 public void removeUser(int userId) throws RemoteException {
   mService.removeUser(userId);
 }
コード例 #12
0
 @Override
 public boolean checkVoldPassword(int userId) throws RemoteException {
   return mService.checkVoldPassword(userId);
 }
コード例 #13
0
 @Override
 public boolean checkPassword(String password, int userId) throws RemoteException {
   return mService.checkPassword(password, userId);
 }
コード例 #14
0
 @Override
 public boolean checkPattern(String pattern, int userId) throws RemoteException {
   return mService.checkPattern(pattern, userId);
 }