代码优化

serial
BlueMatthew 1 year ago
parent 80b0a2f2cf
commit e6b688475c

@ -645,7 +645,7 @@ Java_com_xypower_mpapp_MicroPhotoService_recordingFinished(
extern "C" JNIEXPORT void JNICALL extern "C" JNIEXPORT void JNICALL
Java_com_xypower_mpapp_MicroPhotoService_updateConfigs( Java_com_xypower_mpapp_MicroPhotoService_reloadConfigs(
JNIEnv* env, JNIEnv* env,
jobject pThis, jlong handler) { jobject pThis, jlong handler) {

@ -406,9 +406,12 @@ public class MicroPhotoService extends Service {
mService.sendHeartbeat(mService.mNativeHandle, mService.getSignalLevel()); mService.sendHeartbeat(mService.mNativeHandle, mService.getSignalLevel());
} }
} else if (TextUtils.equals(ACTION_UPDATE_CONFIGS, action)) { } else if (TextUtils.equals(ACTION_UPDATE_CONFIGS, action)) {
Log.i(TAG, "UPD CFG Fired ACTION=" + action); int restart = intent.getIntExtra("restart", 0);
if (mService.mNativeHandle != 0) { Log.i(TAG, "UPD CFG Fired ACTION=" + action + " restart" + restart);
mService.updateConfigs(mService.mNativeHandle); if (restart != 0) {
MicroPhotoService.restartApp(context, context.getPackageName());
} else if (mService.mNativeHandle != 0) {
mService.reloadConfigs(mService.mNativeHandle);
} }
} else if (TextUtils.equals(ACTION_VIDEO_FINISHED, action)) { } else if (TextUtils.equals(ACTION_VIDEO_FINISHED, action)) {
boolean result = intent.getBooleanExtra("result", false); boolean result = intent.getBooleanExtra("result", false);
@ -1090,7 +1093,7 @@ 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 boolean sendHeartbeat(long handler, int signalLevel); protected native boolean sendHeartbeat(long handler, int signalLevel);
protected native boolean updateConfigs(long handler); protected native boolean reloadConfigs(long handler);
protected native void updatePosition(long handler, double lon, double lat, long ts); protected native void updatePosition(long handler, double lon, double lat, long ts);
protected native boolean uninit(long handler); protected native boolean uninit(long handler);
protected native void recordingFinished(long handler, boolean result, String path, long videoId); protected native void recordingFinished(long handler, boolean result, String path, long videoId);

Loading…
Cancel
Save