diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index ca222124..5355f78d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -54,7 +54,7 @@
-
+
@@ -74,6 +74,7 @@
+
+
@@ -94,17 +98,11 @@
-
+ android:screenOrientation="landscape" />
-
+ android:screenOrientation="landscape" />
0) {
+ configJson.put("resolutionCX", width);
+ }
+ if (height > 0) {
+ configJson.put("resolutionCY", height);
+ }
+
+ JSONObject osdJson = configJson.getJSONObject("osd");
+ if (osdJson == null) {
+ osdJson = configJson.put("osd", new JSONObject());
+ }
+ osdJson.put("leftTop", TextUtils.isEmpty(leftTopOsd) ? "" : leftTopOsd);
+ osdJson.put("rightTop", TextUtils.isEmpty(rightTopOsd) ? "" : rightTopOsd);
+ osdJson.put("rightBottom", TextUtils.isEmpty(rightBottomOsd) ? "" : rightBottomOsd);
+ osdJson.put("leftBottom", TextUtils.isEmpty(leftBottomOsd) ? "" : leftBottomOsd);
+
+ JSONUtils.saveJson(tmpConfigFile.getAbsolutePath(), configJson);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ File file = new File(path);
+ if (file.exists()) {
+ file.delete();
+ } else {
+ FileUtils.ensureParentDirectoryExisted(path);
+ }
+
+ MicroPhotoService.takePhoto(channel, preset, true, tmpConfigFile.getAbsolutePath(), path);
+ if (tmpConfigFile.exists()) {
+ tmpConfigFile.delete();
+ }
+
+ } else if (TextUtils.equals(action, ACTION_RECORDING)) {
+ String path = intent.getStringExtra("path");
+ int channel = intent.getIntExtra("channel", 1);
+ int cameraId = intent.getIntExtra("cameraId", -1);
+ int quality = intent.getIntExtra("quality", 0);
+ int width = intent.getIntExtra("width", 1280);
+ int height = intent.getIntExtra("height", 720);
+ int duration = intent.getIntExtra("duration", 15);
+ int orientation = intent.getIntExtra("orientation", 0);
+ long videoId = System.currentTimeMillis() / 1000;
+
+ String leftTopOsd = intent.getStringExtra("leftTopOsd");
+ String rightTopOsd = intent.getStringExtra("rightTopOsd");
+ String rightBottomOsd = intent.getStringExtra("rightBottomOsd");
+ String leftBottomOsd = intent.getStringExtra("leftBottomOsd");
+
+ if (cameraId == -1) {
+ cameraId = channel - 1;
+ }
+
+ Intent recordingIntent = MicroPhotoService.makeRecordingIntent(getApplicationContext(),
+ cameraId, videoId, duration, width, height, quality, orientation,
+ leftTopOsd, rightTopOsd, rightBottomOsd, leftBottomOsd);
+
+ mVideoFilePath = path;
+ mAutoClose = false;
+
+ recordingIntent.putExtra("ActivityResult", true);
+ // startActivityForResult(recordingIntent, REQUEST_CODE_RECORDING);
+ }
+ }
+
+ if (mAutoClose) {
+ mHandler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ Log.i(TAG, "BridgeActivity will finish automatically");
+ stopSelf();
+ }
+ }, 200);
+ }
+
+ return super.onStartCommand(intent, flags, startId);
+ }
+
+ /**
+ * 服务销毁时的回调
+ */
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ }
+
+ @Nullable
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+
+}
\ No newline at end of file