|
|
@ -135,8 +135,6 @@ public class MicroPhotoService extends Service {
|
|
|
|
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";
|
|
|
@ -298,7 +296,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);
|
|
|
|
intentFilter.addAction(Intent.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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -662,8 +660,11 @@ public class MicroPhotoService extends Service {
|
|
|
|
ex.printStackTrace();
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
restartSelfImpl(context, reason);
|
|
|
|
restartSelfImpl(context, reason);
|
|
|
|
} else if (TextUtils.equals(ACTION_TIME_CHANGED, action)) {
|
|
|
|
} 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1603,6 +1604,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, String url, int mediaType);
|
|
|
|
protected native boolean notifyToTakePhoto(long handler, int channel, int preset, long scheduleTime, String url, int mediaType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|