|
|
|
@ -406,8 +406,8 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
try {
|
|
|
|
|
File mpmstLogFile = new File(MicroPhotoContext.buildMasterAppDir(context) + "logs/mlog.txt");
|
|
|
|
|
long mlogTime = mpmstLogFile.exists() ? mpmstLogFile.lastModified() : 0;
|
|
|
|
|
if ((ts - mlogTime) > 1800000 /*86400000*/) {
|
|
|
|
|
// More than 1 day, try restart it
|
|
|
|
|
if ((ts - mlogTime) > 21600000) {
|
|
|
|
|
// More than 6 hours, try restart it
|
|
|
|
|
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
|
if (launchIntent != null) {
|
|
|
|
|
launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
|