예제 #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);
 }