五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

storage

2022-12-16 10:37 作者:Vexpaer  | 我要投稿

package com.android.settings.deviceinfo.storage; import android.content.Context; import android.content.SharedPreferences; import android.provider.Settings.Global; import android.support.annotation.VisibleForTesting; import android.util.SparseArray; import com.android.settings.deviceinfo.storage.StorageAsyncLoader.AppsStorageResult; import com.android.settingslib.applications.StorageStatsSource.ExternalStorageStats; import com.android.settingslib.deviceinfo.PrivateStorageInfo; import java.util.concurrent.TimeUnit; public class CachedStorageValuesHelper { ??@VisibleForTesting ??public static final String SHARED_PREFERENCES_NAME = "CachedStorageValues"; ??private final Long mClobberThreshold; ??protected Clock mClock = new Clock(); ??private final SharedPreferences mSharedPreferences; ??private final int mUserId; ??public CachedStorageValuesHelper(Context context, int i) { ????this.mSharedPreferences = context.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); ????this.mUserId = i; ????this.mClobberThreshold = Long.valueOf(Global.getLong(context.getContentResolver(), "storage_settings_clobber_threshold", TimeUnit.MINUTES.toMillis(5))); ??} ??private boolean isDataValid() { ????if (this.mSharedPreferences.getInt("user_id", -1) != this.mUserId) { ??????return false; ????} ????return this.mClock.getCurrentTime() - this.mSharedPreferences.getLong("last_query_timestamp", Long.MAX_VALUE) < this.mClobberThreshold.longValue(); ??} ??public void cacheResult(PrivateStorageInfo privateStorageInfo, AppsStorageResult appsStorageResult) { ????this.mSharedPreferences.edit().putLong("free_bytes", privateStorageInfo.freeBytes).putLong("total_bytes", privateStorageInfo.totalBytes).putLong("game_apps_size", appsStorageResult.gamesSize).putLong("music_apps_size", appsStorageResult.musicAppsSize).putLong("video_apps_size", appsStorageResult.videoAppsSize).putLong("photo_apps_size", appsStorageResult.photosAppsSize).putLong("other_apps_size", appsStorageResult.otherAppsSize).putLong("cache_apps_size", appsStorageResult.cacheSize).putLong("external_total_bytes", appsStorageResult.externalStats.totalBytes).putLong("external_audio_bytes", appsStorageResult.externalStats.audioBytes).putLong("external_video_bytes", appsStorageResult.externalStats.videoBytes).putLong("external_image_bytes", appsStorageResult.externalStats.imageBytes).putLong("external_apps_bytes", appsStorageResult.externalStats.appBytes).putInt("user_id", this.mUserId).putLong("last_query_timestamp", this.mClock.getCurrentTime()).apply(); ??} ??public SparseArray getCachedAppsStorageResult() { ????if (!isDataValid()) { ??????return null; ????} ????long j = this.mSharedPreferences.getLong("game_apps_size", -1); ????long j2 = this.mSharedPreferences.getLong("music_apps_size", -1); ????long j3 = this.mSharedPreferences.getLong("video_apps_size", -1); ????long j4 = this.mSharedPreferences.getLong("photo_apps_size", -1); ????long j5 = this.mSharedPreferences.getLong("other_apps_size", -1); ????long j6 = this.mSharedPreferences.getLong("cache_apps_size", -1); ????if (j < 0 || j2 < 0 || j3 < 0 || j4 < 0 || j5 < 0 || j6 < 0) { ??????return null; ????} ????long j7 = this.mSharedPreferences.getLong("external_total_bytes", -1); ????long j8 = this.mSharedPreferences.getLong("external_audio_bytes", -1); ????long j9 = this.mSharedPreferences.getLong("external_video_bytes", -1); ????long j10 = this.mSharedPreferences.getLong("external_image_bytes", -1); ????long j11 = this.mSharedPreferences.getLong("external_apps_bytes", -1); ????if (j7 < 0 || j8 < 0 || j9 < 0 || j10 < 0 || j11 < 0) { ??????return null; ????} ????ExternalStorageStats externalStorageStats = new ExternalStorageStats(j7, j8, j9, j10, j11); ????AppsStorageResult appsStorageResult = new AppsStorageResult(); ????appsStorageResult.gamesSize = j; ????appsStorageResult.musicAppsSize = j2; ????appsStorageResult.videoAppsSize = j3; ????appsStorageResult.photosAppsSize = j4; ????appsStorageResult.otherAppsSize = j5; ????appsStorageResult.cacheSize = j6; ????appsStorageResult.externalStats = externalStorageStats; ????SparseArray sparseArray = new SparseArray(); ????sparseArray.append(this.mUserId, appsStorageResult); ????return sparseArray; ??} ??public PrivateStorageInfo getCachedPrivateStorageInfo() { ????if (!isDataValid()) { ??????return null; ????} ????long j = this.mSharedPreferences.getLong("free_bytes", -1); ????long j2 = this.mSharedPreferences.getLong("total_bytes", -1); ????return (j < 0 || j2 < 0) ? null : new PrivateStorageInfo(j, j2); ??} }

storage的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
西吉县| 四子王旗| 年辖:市辖区| 诸暨市| 永年县| 深水埗区| 色达县| 安康市| 乐清市| 乐亭县| 青岛市| 灵璧县| 海晏县| 青州市| 太原市| 边坝县| 临洮县| 南澳县| 惠东县| 长治县| 梅州市| 博野县| 西平县| 娱乐| 汝南县| 沽源县| 阜新市| 麻江县| 云阳县| 南岸区| 米易县| 镇巴县| 宁明县| 澎湖县| 永登县| 宜章县| 比如县| 舞钢市| 南宁市| 晋宁县| 漳州市|