|
|
@ -134,6 +134,9 @@ public class MicroPhotoService extends Service {
|
|
|
|
private static final String ACTION_HEARTBEAT_MANUALLY = "com.xypower.mpapp.ACT_HB_M";
|
|
|
|
private static final String ACTION_HEARTBEAT_MANUALLY = "com.xypower.mpapp.ACT_HB_M";
|
|
|
|
private static final String ACTION_UPDATE_CONFIGS = "com.xypower.mpapp.ACT_UPD_CFG";
|
|
|
|
private static final String ACTION_UPDATE_CONFIGS = "com.xypower.mpapp.ACT_UPD_CFG";
|
|
|
|
public static final String ACTION_VIDEO_FINISHED = "com.xypower.mpapp.ACT_V_FINISHED";
|
|
|
|
public static final String ACTION_VIDEO_FINISHED = "com.xypower.mpapp.ACT_V_FINISHED";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String ACTION_TIME_CHANGED = "android.intent.action.TIME_CHANGED";
|
|
|
|
|
|
|
|
|
|
|
|
private static final String EXTRA_PARAM_CHANNEL = "Channel";
|
|
|
|
private static final String EXTRA_PARAM_CHANNEL = "Channel";
|
|
|
|
private static final String EXTRA_PARAM_PRESET = "Preset";
|
|
|
|
private static final String EXTRA_PARAM_PRESET = "Preset";
|
|
|
|
private static final String EXTRA_PARAM_PHOTO_OR_VIDEO = "PhotoOrVideo";
|
|
|
|
private static final String EXTRA_PARAM_PHOTO_OR_VIDEO = "PhotoOrVideo";
|
|
|
@ -332,6 +335,7 @@ public class MicroPhotoService extends Service {
|
|
|
|
intentFilter.addAction(ACTION_HEARTBEAT_MANUALLY);
|
|
|
|
intentFilter.addAction(ACTION_HEARTBEAT_MANUALLY);
|
|
|
|
intentFilter.addAction(ACTION_GPS_TIMEOUT);
|
|
|
|
intentFilter.addAction(ACTION_GPS_TIMEOUT);
|
|
|
|
intentFilter.addAction(ACTION_RESTART);
|
|
|
|
intentFilter.addAction(ACTION_RESTART);
|
|
|
|
|
|
|
|
intentFilter.addAction(ACTION_TIME_CHANGED);
|
|
|
|
getApplicationContext().registerReceiver(mAlarmReceiver, intentFilter, Context.RECEIVER_EXPORTED | Context.RECEIVER_VISIBLE_TO_INSTANT_APPS);
|
|
|
|
getApplicationContext().registerReceiver(mAlarmReceiver, intentFilter, Context.RECEIVER_EXPORTED | Context.RECEIVER_VISIBLE_TO_INSTANT_APPS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -518,11 +522,14 @@ public class MicroPhotoService extends Service {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
boolean mpmstAlive = MicroPhotoContext.isAppAlive(context, MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
|
|
|
|
if (!mpmstAlive) {
|
|
|
|
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
// launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
// launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
if (launchIntent != null) {
|
|
|
|
if (launchIntent != null) {
|
|
|
|
context.startActivity(launchIntent);
|
|
|
|
context.startActivity(launchIntent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -703,6 +710,8 @@ public class MicroPhotoService extends Service {
|
|
|
|
ex.printStackTrace();
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
restartSelfImpl(context, reason);
|
|
|
|
restartSelfImpl(context, reason);
|
|
|
|
|
|
|
|
} else if (TextUtils.equals(ACTION_TIME_CHANGED, action)) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|