Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
  }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
   }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
  }
Ejemplo n.º 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);
 }
Ejemplo n.º 9
0
 @Override
 public IBinder asBinder() {
   return mService.asBinder();
 }
Ejemplo n.º 10
0
 @Override
 public void unregisterObserver(ILockSettingsObserver observer) throws RemoteException {
   mService.unregisterObserver(observer);
 }
Ejemplo n.º 11
0
 @Override
 public void removeUser(int userId) throws RemoteException {
   mService.removeUser(userId);
 }
Ejemplo n.º 12
0
 @Override
 public boolean checkVoldPassword(int userId) throws RemoteException {
   return mService.checkVoldPassword(userId);
 }
Ejemplo n.º 13
0
 @Override
 public boolean checkPassword(String password, int userId) throws RemoteException {
   return mService.checkPassword(password, userId);
 }
Ejemplo n.º 14
0
 @Override
 public boolean checkPattern(String pattern, int userId) throws RemoteException {
   return mService.checkPattern(pattern, userId);
 }