summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Daynard <nardholio@gmail.com>2014-09-02 19:14:08 -0400
committerMichael Bestas <mikeioannina@gmail.com>2015-09-17 23:26:03 +0300
commit335b416fbb319eeaba23e4054e3f98adcc90c99f (patch)
tree3aaa4423a0f6446b75c0ecacb7de6ad5cee664f2
parent2db625e1748d222bb2459f2eed286d16c8cffe12 (diff)
downloadandroid_packages_apps_Snap-335b416fbb319eeaba23e4054e3f98adcc90c99f.zip
android_packages_apps_Snap-335b416fbb319eeaba23e4054e3f98adcc90c99f.tar.gz
android_packages_apps_Snap-335b416fbb319eeaba23e4054e3f98adcc90c99f.tar.bz2
Camera2: Headset shutter mode
Use play button on headset to take a picture/video/panorama Use media next/previous for zoom Change-Id: I25c22646b041e5e0941fbe361eccfe77a2a1e42f
-rw-r--r--src/com/android/camera/PhotoModule.java5
-rw-r--r--src/com/android/camera/VideoModule.java6
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java5
3 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 8865d54..8d919b4 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2481,6 +2481,7 @@ public class PhotoModule
}
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
+ case KeyEvent.KEYCODE_MEDIA_NEXT:
if (mFirstTimeInitialized && (mUI.mMenuInitialized)) {
if (!CameraActivity.mPowerShutter && !CameraUtil.hasCameraKey()) {
onShutterButtonFocus(true);
@@ -2490,6 +2491,7 @@ public class PhotoModule
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
+ case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
if (mFirstTimeInitialized && (mUI.mMenuInitialized)) {
if (!CameraActivity.mPowerShutter && !CameraUtil.hasCameraKey()) {
onShutterButtonFocus(true);
@@ -2507,6 +2509,7 @@ public class PhotoModule
}
return false;
case KeyEvent.KEYCODE_CAMERA:
+ case KeyEvent.KEYCODE_HEADSETHOOK:
if (mFirstTimeInitialized && event.getRepeatCount() == 0) {
onShutterButtonClick();
}
@@ -2537,6 +2540,8 @@ public class PhotoModule
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
+ case KeyEvent.KEYCODE_MEDIA_NEXT:
+ case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
if (!CameraActivity.mPowerShutter && !CameraUtil.hasCameraKey()
&& mFirstTimeInitialized) {
onShutterButtonClick();
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index e6bf16d..038d0d6 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1207,6 +1207,7 @@ public class VideoModule implements CameraModule,
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
+ case KeyEvent.KEYCODE_MEDIA_NEXT:
if (event.getRepeatCount() == 0 && !CameraActivity.mPowerShutter &&
!CameraUtil.hasCameraKey()) {
mUI.clickShutter();
@@ -1215,6 +1216,7 @@ public class VideoModule implements CameraModule,
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
+ case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
if (event.getRepeatCount() == 0 && !CameraActivity.mPowerShutter &&
!CameraUtil.hasCameraKey()) {
mUI.clickShutter();
@@ -1223,6 +1225,7 @@ public class VideoModule implements CameraModule,
}
return true;
case KeyEvent.KEYCODE_CAMERA:
+ case KeyEvent.KEYCODE_HEADSETHOOK:
if (event.getRepeatCount() == 0) {
mUI.clickShutter();
}
@@ -1251,16 +1254,19 @@ public class VideoModule implements CameraModule,
public boolean onKeyUp(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
+ case KeyEvent.KEYCODE_MEDIA_NEXT:
if (!CameraActivity.mPowerShutter && !CameraUtil.hasCameraKey()) {
mUI.pressShutter(false);
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
+ case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
if (!CameraActivity.mPowerShutter && !CameraUtil.hasCameraKey()) {
mUI.pressShutter(false);
}
return true;
case KeyEvent.KEYCODE_CAMERA:
+ case KeyEvent.KEYCODE_HEADSETHOOK:
mUI.pressShutter(false);
return true;
case KeyEvent.KEYCODE_POWER:
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index e9090b7..0b2880c 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -1184,8 +1184,11 @@ public class WideAnglePanoramaModule
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
+ case KeyEvent.KEYCODE_MEDIA_NEXT:
+ case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
return true;
case KeyEvent.KEYCODE_CAMERA:
+ case KeyEvent.KEYCODE_HEADSETHOOK:
if (event.getRepeatCount() == 0) {
onShutterButtonClick();
}
@@ -1201,6 +1204,8 @@ public class WideAnglePanoramaModule
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
+ case KeyEvent.KEYCODE_MEDIA_NEXT:
+ case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
if (!CameraActivity.mPowerShutter && !CameraUtil.hasCameraKey()) {
onShutterButtonClick();
}