|
|
@ -119,6 +119,7 @@ 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";
|
|
|
|
|
|
|
|
|
|
|
|
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";
|
|
|
@ -272,11 +273,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_HEARTBEAT_MANUALLY);
|
|
|
|
intentFilter.addAction(Intent.ACTION_TIME_CHANGED);
|
|
|
|
// intentFilter.addAction(ACTION_MSG_BROADCAST);
|
|
|
|
|
|
|
|
// intentFilter.addAction(ACTION_VIDEO_FINISHED);
|
|
|
|
|
|
|
|
// intentFilter.addAction(ACTION_STOP);
|
|
|
|
|
|
|
|
// intentFilter.addCategory(Intent.CATEGORY_DEFAULT);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
// IntentFilter intentFilter2 = new IntentFilter(ACTION_MSG_BROADCAST);
|
|
|
|
// IntentFilter intentFilter2 = new IntentFilter(ACTION_MSG_BROADCAST);
|
|
|
@ -622,7 +619,12 @@ public class MicroPhotoService extends Service {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MicroPhotoService.restartApp(context.getApplicationContext(), MicroPhotoContext.PACKAGE_NAME_MPAPP, "Restart Cmd");
|
|
|
|
restartSelfImpl(context, reason);
|
|
|
|
|
|
|
|
} else if (TextUtils.equals(Intent.ACTION_TIME_CHANGED, action)) {
|
|
|
|
|
|
|
|
mService.notifyTimeUpdated(mService.mNativeHandle);
|
|
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
|
|
|
long startTime = (date.getTime() + 999) / 1000;
|
|
|
|
|
|
|
|
mService.updateCaptureSchedule(startTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1496,6 +1498,8 @@ cellSignalStrengthGsm.getDbm();
|
|
|
|
// protected native long[] getNextScheduleItem(long handler);
|
|
|
|
// protected native long[] getNextScheduleItem(long handler);
|
|
|
|
protected native boolean notifyToTakePhoto(long handler, int channel, int preset, long scheduleTime, boolean photoOrVideo);
|
|
|
|
protected native boolean notifyToTakePhoto(long handler, int channel, int preset, long scheduleTime, boolean photoOrVideo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected native void notifyTimeUpdated(long handler);
|
|
|
|
|
|
|
|
|
|
|
|
protected native boolean sendHeartbeat(long handler, int signalLevel);
|
|
|
|
protected native boolean sendHeartbeat(long handler, int signalLevel);
|
|
|
|
protected native boolean reloadConfigs(long handler);
|
|
|
|
protected native boolean reloadConfigs(long handler);
|
|
|
|
protected native void updatePosition(long handler, double lon, double lat, double radius, long ts);
|
|
|
|
protected native void updatePosition(long handler, double lon, double lat, double radius, long ts);
|
|
|
|