From 935b61c16660341ada2c9b04121c581b3cfa3433 Mon Sep 17 00:00:00 2001 From: Fanhuitong <981964879@qq.com> Date: Tue, 1 Aug 2023 10:46:38 +0800 Subject: [PATCH] =?UTF-8?q?version:3.0.9=20fix:=20update:=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=BA=E8=87=AA=E5=AE=9A=E4=B9=89=E6=97=B6=E7=AE=A1?= =?UTF-8?q?=E6=8E=A7=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 +- .../fuying/sn/desktop/RunningAppManager.java | 67 ++++++++++--------- .../fuying/sn/desktop/TimeControlManager.java | 1 + 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bce1a8d..6f12943 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,8 +73,8 @@ android { official { flavorDimensions "default" - versionCode 48 - versionName "3.0.8" + versionCode 49 + versionName "3.0.9" } } diff --git a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java index f90739b..8255fd5 100644 --- a/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java +++ b/app/src/main/java/com/fuying/sn/desktop/RunningAppManager.java @@ -741,31 +741,22 @@ public class RunningAppManager { Log.e(TAG, "inControlTime: " + "应用始终可用"); return false; } - } - Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime); - if (globalRemainingTime <= 0) { - if (machineControl != null) { - if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { - return false; - } - } else { - ToastUtil.show("今日可使用时间已用完"); - return true; - } - } - if (havaConfigure) { - //有单独设置 不管是分类整机还是其他都是这个设置 - AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg); -// if (appTimeControl.getIs_control() == 0) { -// ToastUtil.show("应用已被禁用"); -// Log.e(TAG, "inControlTime: " + "应用已被禁用"); -// return true; -// } -// if (appTimeControl.getTc_use_type() == 0) { -// Log.e(TAG, "inControlTime: " + "应用始终可用"); -// return false; -// } + Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime); + if (appTimeControl.getTc_use_type() != 3) { + if (globalRemainingTime <= 0) { + if (machineControl != null) { + if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { + Log.e(TAG, "inControlTime: is_part = 0 is_quota = 0"); + //整机额度和时间段关闭不管控 + return false; + } + } else { + ToastUtil.show("今日可使用时间已用完"); + return true; + } + } + } //打开时间段管控 if (appTimeControl.getIs_part() == 1) { boolean inControlTime = inControlTime(machineControl, appTimeControl); @@ -791,6 +782,7 @@ public class RunningAppManager { } } } else { + //关闭时间段管控关闭额度开关为不管控 if (appTimeControl.getIs_quota() == 0) { Log.e(TAG, "inControlTime: " + "没有使用额度"); return false; @@ -809,6 +801,14 @@ public class RunningAppManager { if (machineControl == null) { return false; } + if (globalRemainingTime <= 0) { + if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { + Log.e(TAG, "inControlTime: is_part = 0 is_quota = 0"); + //整机额度和时间段关闭不管控 + return false; + } + } + if (machineControl.is_quota == 1) { if (haveUseTime(machineControl.getWork_time(), machineControl.getRest_time(), machineControl.getToday_time())) { return false; @@ -904,15 +904,16 @@ public class RunningAppManager { MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl(); Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime); - if (globalRemainingTime <= 0) { - if (machineControl != null) { - if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { - return ""; - } - } else { - return ""; - } - } +// if (globalRemainingTime <= 0) { +// if (machineControl != null) { +// if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) { +// return ""; +// } +// } else { +// return ""; +// } +// } + if (havaConfigure) { //有单独设置 不管是分类整机还是其他都是这个设置 AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg); diff --git a/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java b/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java index 613b6a9..6eeec5b 100644 --- a/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java +++ b/app/src/main/java/com/fuying/sn/desktop/TimeControlManager.java @@ -76,6 +76,7 @@ public class TimeControlManager { return false; } else { if (appTimeControl.getTc_use_type() == 1) { + //根据分类 Log.e(TAG, "havaConfigure: classify"); return mClassifyTimeControlHashMap.get(appTimeControl.getTc_class_id()) != null; }