AuthStateManager.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:7pass-android-sample 作者:
@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();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号