对运维的保活限制在特定时间段内

1:35-1:55
2:35-2:55
nx2024
Matthew 2 months ago
parent 8f254d8318
commit 8f6c7881e8

@ -440,11 +440,14 @@ public class MicroPhotoService extends Service {
}
try {
Date dt = new Date();
if ((dt.getHours() == 1 || dt.getHours() == 2) && dt.getMinutes() > 35 && dt.getMinutes() < 55) {
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
// launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (launchIntent != null) {
context.startActivity(launchIntent);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}

Loading…
Cancel
Save