refactor(app): 统一工具类并简化服务架构
- 移除 GuardService、StepService、ControlPanelService,替换为 SocketService - 将 QR 码生成从 Utils 迁移到 BitmapUtils - 将缓存目录选择逻辑统一到 FileUtils.getCacheFileDir - 将 ServiceAliveUtils、NetStateUtils 合并到 SystemUtils - 将 CacheUtils 同步清理替换为 ApkUtils.cleanApplicationUserDataAsync - 用 EncryptUtils 替代自定义 MD5Util - 重写 catchException 支持主线程兜底循环与子线程 Bugly 上报 - 移除 RunningAppManager 中未使用的 killBackgroundProcesses 方法 - 移除 ControlManager 中冗余的 hideSystemSettingAPP 调用 - MyGlideModule 重命名为 BaseGlideModule
This commit is contained in:
1 parent
df8a7bc153
commit
a972ce7b89
46 files changed
+1583
-1812
No files matched your search
@@ -3,9 +3,9 @@ package com.fuying.sn.disklrucache;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fuying.sn.utils.FileUtils;
|
||||
import com.jakewharton.disklrucache.DiskLruCache;
|
||||
|
||||
import org.json.JSONArray;
|
||||
@@ -460,17 +460,8 @@ public class CacheHelper {
|
||||
// =======================================
|
||||
|
||||
private File getDiskCacheDir(Context context, String uniqueName) {
|
||||
File cacheDir;
|
||||
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|
||||
|| !Environment.isExternalStorageRemovable()) {
|
||||
cacheDir = context.getExternalCacheDir();
|
||||
if (cacheDir == null) {
|
||||
cacheDir = context.getCacheDir();
|
||||
}
|
||||
} else {
|
||||
cacheDir = context.getCacheDir();
|
||||
}
|
||||
return new File(cacheDir, uniqueName);
|
||||
// 与 FileUtils 共用同一套缓存目录选择逻辑,避免两处判定不一致
|
||||
return new File(FileUtils.getCacheFileDir(context), uniqueName);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user