コード例 #1
0
 public void clearUserColor(final long userId) {
   if (userId < 0) return;
   mUserColors.remove(userId);
   final SharedPreferences.Editor editor = mColorPreferences.edit();
   editor.remove(Long.toString(userId));
   editor.apply();
 }
コード例 #2
0
  /** Called when one specific passphrase for keyId timed out. */
  private void removeTimeoutedPassphrase(long keyId) {

    CachedPassphrase cPass = mPassphraseCache.get(keyId);
    if (cPass != null) {
      if (cPass.mPassphrase != null) {
        // clean internal char[] from memory!
        cPass.mPassphrase.removeFromMemory();
      }
      // remove passphrase object
      mPassphraseCache.remove(keyId);
    }

    Log.d(
        Constants.TAG,
        "PassphraseCacheService Timeout of keyId " + keyId + ", removed from memory!");

    updateService();
  }