diff --git a/build.gradle b/build.gradle index 9134dab..025edcb 100644 --- a/build.gradle +++ b/build.gradle @@ -50,8 +50,8 @@ android { minSdkVersion 26 targetSdkVersion 28 - versionCode 23 - versionName "1.2.2" + versionCode 24 + versionName "1.2.3" ndk { //选择要添加的对应 cpu 类型的 .so 库。 diff --git a/src/com/uiuipad/os/manager/RunningAppManager.java b/src/com/uiuipad/os/manager/RunningAppManager.java index 75b86e0..573a460 100644 --- a/src/com/uiuipad/os/manager/RunningAppManager.java +++ b/src/com/uiuipad/os/manager/RunningAppManager.java @@ -765,19 +765,19 @@ public class RunningAppManager { if (getDayType() != partTime.getDay_type()) { continue; } - if (stringBuilder.length() == 0) { - if (appTimeControl.getTime_part() != null && appTimeControl.getTime_part().size() != 0) { - stringBuilder.append("仅限"); - } - } else { - stringBuilder.append(";"); - } +// if (stringBuilder.length() == 0) { +// if (appTimeControl.getTime_part() != null && appTimeControl.getTime_part().size() != 0) { +// stringBuilder.append("仅限"); +// } +// } else { +// stringBuilder.append(";"); +// } stringBuilder.append(partTime.getStart_time()) .append("-").append(partTime.getEnd_time()); } if (appTimeControl.getTime_part() != null && appTimeControl.getTime_part().size() != 0) { - stringBuilder.append("使用"); - } else { +// stringBuilder.append("使用"); +// } else { stringBuilder.append("禁止使用"); } return stringBuilder.toString(); @@ -1222,12 +1222,20 @@ public class RunningAppManager { Date startDate = dateFormat.parse(startTime); Date endDate = dateFormat.parse(endTime); Date nowDate = dateFormat.parse(time); + if (startDate.getTime() == endDate.getTime()) { + //相等返回不可用 + return true; + } if (startDate.getTime() > endDate.getTime()) { + if (nowDate.getTime() < endDate.getTime()) { + nowDate.setTime(nowDate.getTime() + dayTime); + } //开始时间大于结束时间 列 16:00-01:00 endDate.setTime(endDate.getTime() + dayTime); } Log.i(TAG, "inControlTime: " + (startDate.getTime() - minuteTime)); assert nowDate != null; + // if (nowDate.getTime() <= startDate.getTime() - minuteTime || nowDate.getTime() >= endDate.getTime()) { if (nowDate.getTime() >= startDate.getTime() && nowDate.getTime() <= endDate.getTime()) { return true; diff --git a/src/com/uiuipad/os/service/MainService.java b/src/com/uiuipad/os/service/MainService.java index 9647956..50d5559 100644 --- a/src/com/uiuipad/os/service/MainService.java +++ b/src/com/uiuipad/os/service/MainService.java @@ -6,6 +6,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Binder; +import android.os.Handler; import android.os.IBinder; import android.text.TextUtils; import android.util.Log; @@ -240,7 +241,12 @@ public class MainService extends Service implements MainSContact.MainView, Lifec String action = intent.getAction(); Log.e("RefreshReceiver", "onReceive: " + action); if (REFRESH_ACTION.equals(action)) { - mPresenter.getTimeManageSn(); + Handler.getMain().postDelayed(new Runnable() { + @Override + public void run() { + mPresenter.getTimeManageSn(); + } + }, 4321); } } }