Aperture: Handle photo/video camera intents
Change-Id: I80cb1dc83258a70a5624f4ffbcf3e6818664de61
diff --git a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
index 84a8d1e..903f040 100644
--- a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
+++ b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
@@ -231,7 +231,19 @@
PauseToResume(R.drawable.avd_video_recording_resume),
}
- private val shortcutActions = mapOf(
+ private val intentActions = mapOf(
+ // Intents
+ MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA to {
+ cameraMode = CameraMode.PHOTO
+ },
+ MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE to {
+ cameraMode = CameraMode.PHOTO
+ },
+ MediaStore.INTENT_ACTION_VIDEO_CAMERA to {
+ cameraMode = CameraMode.VIDEO
+ },
+
+ // Shortcuts
ShortcutsUtils.SHORTCUT_ID_SELFIE to {
cameraMode = CameraMode.PHOTO
cameraFacing = CameraFacing.FRONT
@@ -282,7 +294,7 @@
// Handle intent
intent.action?.let {
- shortcutActions[it]?.invoke()
+ intentActions[it]?.invoke()
}
// Set secondary bar button callbacks