diff options
| author | Michael Bestas <mikeioannina@gmail.com> | 2014-01-20 20:40:32 +0200 |
|---|---|---|
| committer | fuzz <fuzzzzzzzzzzzzzzzzzz@gmail.com> | 2014-02-02 12:00:43 +0900 |
| commit | 3efe00b0974074e15d40fc6b6882c7c0e161319c (patch) | |
| tree | e9b23eb2ab1a1385b03f62450d71eac0f7f084bf /src/com/android/camera/VideoModule.java | |
| parent | abd9f911d949da03b2811b6d7be4e0f017a9f042 (diff) | |
Camera: Powerkey shutter (2/2)
Ported from cm-10.1
Including cm-10.1 camera commit:
aa4ae80a41fbab763891c5ef6d67a9e5b4bb981b Don't mess around with pref local ID for power shutter initialization.
Includes http://review.cyanogenmod.org/56986
PS2: Make Camera2 a privileged app
PS5: Sign with platform certificate instead of making it a privileged app.
PS6: Add write permission to PREVENT_POWER_KEY
PS7: Move PREVENT_POWER_KEY permission to CameraActivity
PS8: Revert to PS5
Signed-off-by: Michael Bestas <mikeioannina@gmail.com>
Change-Id: I0992baa558eefd306d00fbece59cb5c512d9448b
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
| -rw-r--r-- | src/com/android/camera/VideoModule.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 858e4f4f..b62d26cd 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2012 The Android Open Source Project + * Copyright (C) 2013 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -435,6 +436,9 @@ public class VideoModule implements CameraModule, mActivity.updateStorageSpaceAndHint(); } + // Power shutter + mActivity.initPowerShutter(mPreferences); + /* * To reduce startup time, we start the preview in another thread. * We make sure the preview is started at the end of onCreate. @@ -1196,6 +1200,11 @@ public class VideoModule implements CameraModule, case KeyEvent.KEYCODE_CAMERA: mUI.pressShutter(false); return true; + case KeyEvent.KEYCODE_POWER: + if (CameraActivity.mPowerShutter) { + onShutterButtonClick(); + } + return true; } return false; } @@ -2135,6 +2144,7 @@ public class VideoModule implements CameraModule, setCameraParameters(); } mUI.updateOnScreenIndicators(mParameters, mPreferences); + mActivity.initPowerShutter(mPreferences); } } |
