From 11812e34565ededb74b0d6c8868f8c1892264420 Mon Sep 17 00:00:00 2001 From: Shalaj Jain Date: Mon, 10 Nov 2014 14:01:09 -0800 Subject: SnapdragonCamera: Improve app stop latency Disable shutter button before starting/stopping recording on a shutter button click and enable it after without any delay. Add logs to know when shutter button is disabled/enabled. Change-Id: Ibca1e964d2e2fc1c1bd47c104f87289eb2a507bf --- src/com/android/camera/VideoModule.java | 5 +++-- src/com/android/camera/VideoUI.java | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index e66d529b3..39a30302c 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -96,7 +96,7 @@ public class VideoModule implements CameraModule, private static final int SCREEN_DELAY = 2 * 60 * 1000; - private static final long SHUTTER_BUTTON_TIMEOUT = 500L; // 500ms + private static final long SHUTTER_BUTTON_TIMEOUT = 0L; // 0ms /** * An unpublished intent flag requesting to start recording straight away @@ -684,6 +684,8 @@ public class VideoModule implements CameraModule, if (isRecorderReady() == false) return; + mUI.enableShutter(false); + if (stop) { onStopVideoRecording(); mUI.showUIafterRecording(); @@ -691,7 +693,6 @@ public class VideoModule implements CameraModule, startVideoRecording(); mUI.hideUIwhileRecording(); } - mUI.enableShutter(false); // Keep the shutter button disabled when in video capture intent // mode and recording is stopped. It'll be re-enabled when diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 3e23fca83..91ccd452a 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -785,6 +785,11 @@ public class VideoUI implements PieRenderer.PieListener, public void enableShutter(boolean enable) { if (mShutterButton != null) { + if (enable) { + Log.v(TAG, "Shutter Button enabled !!"); + } else { + Log.v(TAG, "Shutter Button disabled !!"); + } mShutterButton.setEnabled(enable); } } -- cgit v1.2.3