diff --git a/app/src/main/cpp/MicroPhoto.cpp b/app/src/main/cpp/MicroPhoto.cpp index da3ba82c..957efd81 100644 --- a/app/src/main/cpp/MicroPhoto.cpp +++ b/app/src/main/cpp/MicroPhoto.cpp @@ -645,7 +645,7 @@ Java_com_xypower_mpapp_MicroPhotoService_recordingFinished( extern "C" JNIEXPORT void JNICALL -Java_com_xypower_mpapp_MicroPhotoService_updateConfigs( +Java_com_xypower_mpapp_MicroPhotoService_reloadConfigs( JNIEnv* env, jobject pThis, jlong handler) { diff --git a/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java b/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java index 4e1eef74..ea0ad3aa 100644 --- a/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java +++ b/app/src/main/java/com/xypower/mpapp/MicroPhotoService.java @@ -406,9 +406,12 @@ public class MicroPhotoService extends Service { mService.sendHeartbeat(mService.mNativeHandle, mService.getSignalLevel()); } } else if (TextUtils.equals(ACTION_UPDATE_CONFIGS, action)) { - Log.i(TAG, "UPD CFG Fired ACTION=" + action); - if (mService.mNativeHandle != 0) { - mService.updateConfigs(mService.mNativeHandle); + int restart = intent.getIntExtra("restart", 0); + Log.i(TAG, "UPD CFG Fired ACTION=" + action + " restart" + restart); + 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)) { boolean result = intent.getBooleanExtra("result", false); @@ -1090,7 +1093,7 @@ cellSignalStrengthGsm.getDbm(); // protected native long[] getNextScheduleItem(long handler); 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 updateConfigs(long handler); + protected native boolean reloadConfigs(long handler); protected native void updatePosition(long handler, double lon, double lat, long ts); protected native boolean uninit(long handler); protected native void recordingFinished(long handler, boolean result, String path, long videoId);