summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Aminzade <monzy@google.com>2013-08-14 17:36:56 -0700
committerDan Aminzade <monzy@google.com>2013-08-15 10:53:19 -0700
commitfca1c5ece5450914ed49115443e1d45737f2ee40 (patch)
tree70ddfe9e891e43c9136fb125cfa22b33018f6fb5
parent7e1c5fe26bc861d979b85014a511ba35bc1f4110 (diff)
downloadandroid_packages_apps_Snap-fca1c5ece5450914ed49115443e1d45737f2ee40.tar.gz
android_packages_apps_Snap-fca1c5ece5450914ed49115443e1d45737f2ee40.tar.bz2
android_packages_apps_Snap-fca1c5ece5450914ed49115443e1d45737f2ee40.zip
Defining broadcast intent strings as constants in CameraUtil.java.
For now I'm leaving the definition within the Camera application. If we decide we want to publicize and document these intents as part of the Android API, we could move the definitions to Camera.java. Change-Id: Ia198b843245b70d7378e1ea81ecb8b7983486446
-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";