summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/PhotoModule.java8
-rw-r--r--src/com/android/camera/util/CameraUtil.java10
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 1e50d93fd..6098d01f3 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -343,7 +343,7 @@ public class PhotoModule
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
- if (action.equals("com.android.camera.SHUTTER")) {
+ if (action.equals(CameraUtil.ACTION_CAMERA_SHUTTER_CLICK)) {
onShutterButtonFocus(true);
onShutterButtonClick();
}
@@ -1144,7 +1144,7 @@ public class PhotoModule
public void installIntentFilter() {
// Install an intent filter to receive remote shutter events.
IntentFilter intentFilter =
- new IntentFilter("com.android.camera.SHUTTER");
+ new IntentFilter(CameraUtil.ACTION_CAMERA_SHUTTER_CLICK);
mReceiver = new ShutterBroadcastReceiver();
mActivity.registerReceiver(mReceiver, intentFilter);
}
@@ -1220,14 +1220,14 @@ public class PhotoModule
}
installIntentFilter();
- Intent intent = new Intent("com.android.camera.CAMERA_STARTED");
+ Intent intent = new Intent(CameraUtil.ACTION_CAMERA_STARTED);
mActivity.sendBroadcast(intent);
}
@Override
public void onPauseBeforeSuper() {
- Intent intent = new Intent("com.android.camera.CAMERA_STOPPED");
+ Intent intent = new Intent(CameraUtil.ACTION_CAMERA_STOPPED);
mActivity.sendBroadcast(intent);
if (mReceiver != null) {
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 736235bcd..a5d416160 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -86,6 +86,16 @@ public class CameraUtil {
// See android.hardware.Camera.ACTION_NEW_VIDEO.
public static final String ACTION_NEW_VIDEO = "android.hardware.action.NEW_VIDEO";
+ // Broadcast Action: The camera application has become active in picture-taking mode.
+ public static final String ACTION_CAMERA_STARTED = "com.android.camera.action.CAMERA_STARTED";
+ // Broadcast Action: The camera application is no longer in active picture-taking mode.
+ public static final String ACTION_CAMERA_STOPPED = "com.android.camera.action.CAMERA_STOPPED";
+ // When the camera application is active in picture-taking mode, it listens for this intent,
+ // which upon receipt will trigger the shutter to capture a new picture, as if the user had
+ // pressed the shutter button.
+ public static final String ACTION_CAMERA_SHUTTER_CLICK =
+ "com.android.camera.action.SHUTTER_CLICK";
+
// Fields from android.hardware.Camera.Parameters
public static final String FOCUS_MODE_CONTINUOUS_PICTURE = "continuous-picture";
public static final String RECORDING_HINT = "recording-hint";