@AnyThread
private void writeState(@Nullable AuthState state) {
mPrefsLock.lock();
try {
if (state == null) {
if (!mPrefs.edit().remove(KEY_STATE).commit()) {
throw new IllegalStateException("Failed to write state to shared prefs");
}
} else {
if(!mPrefs.edit().putString(KEY_STATE, state.jsonSerializeString()).commit()) {
throw new IllegalStateException("Failed to write state to shared prefs");
}
}
} finally {
mPrefsLock.unlock();
}
}
AuthStateManager.java 文件源码
java
阅读 42
收藏 0
点赞 0
评论 0
项目:7pass-android-sample
作者:
评论列表
文章目录