feat: 基本功能逻辑没有问题
在自动返回到桌面时,后端说有接口没有传上去,待修复。 准备升级Android Studio版本
This commit is contained in:
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.disklrucache.CacheHelper;
|
||||
import com.fuying.sn.network.UrlAddress;
|
||||
import com.google.gson.Gson;
|
||||
@@ -20,7 +21,7 @@ public class TimeControlManager {
|
||||
private static final String TAG = "TimeControlManager";
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static TimeControlManager mTimeControlManager;
|
||||
private static TimeControlManager sInstance;
|
||||
private Context mContext;
|
||||
private CacheHelper mCacheHelper;
|
||||
|
||||
@@ -47,16 +48,16 @@ public class TimeControlManager {
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (mTimeControlManager == null) {
|
||||
mTimeControlManager = new TimeControlManager(context);
|
||||
if (sInstance == null) {
|
||||
sInstance = new TimeControlManager(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static TimeControlManager getInstance() {
|
||||
if (mTimeControlManager == null) {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init TimeControlManager first");
|
||||
}
|
||||
return mTimeControlManager;
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public HashMap<String, AppTimeControl> getAppTimeControlMap() {
|
||||
@@ -111,7 +112,9 @@ public class TimeControlManager {
|
||||
public void setGlobalMachineControl(MachineControl machineControl) {
|
||||
this.mGlobalMachineControl = machineControl;
|
||||
if (machineControl != null) {
|
||||
RunningAppManager.getInstance().setGlobalUsageTime(machineControl.getToday_time());
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
RunningAppManager.getInstance().setGlobalUsageTime(machineControl.getToday_time());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +186,9 @@ public class TimeControlManager {
|
||||
appTimeControls.add(appTimeControl);
|
||||
// }
|
||||
}
|
||||
RunningAppManager.getInstance().syncAppRemainingTime(appTimeControls);
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
RunningAppManager.getInstance().syncAppRemainingTime(appTimeControls);
|
||||
}
|
||||
this.mAppTimeControlMap = appTimeControlMap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user