From 3299216872a72c658b1d5c79c738d544aae4b7aa Mon Sep 17 00:00:00 2001 From: Austin Borger Date: Wed, 30 Nov 2022 16:19:07 -0800 Subject: [PATCH] Create a new system property for the landscape to portrait override. Apps commonly do not handle landscape orientation cameras correctly. In order to prevent stretching and rotation issues in these apps, this patch adds a flag to override the behavior of these landscape cameras to produce a portrait image instead by changing the SENSOR_ORIENTATION reported by CameraCharacteristics and applying a 90 degree rotate and crop. The camera2 framework needs to be able to turn this on only for certain devices. Hence, this patch adds a system property for it. Test: Ran on foldable device with several camera apps to verify behavior. Bug: 250678880 Change-Id: I13783d81f5fada71805865a840e4135580f1d876 Merged-In: I13783d81f5fada71805865a840e4135580f1d876 --- prebuilts/api/33.0/private/property_contexts | 1 + private/property_contexts | 1 + 2 files changed, 2 insertions(+) diff --git a/prebuilts/api/33.0/private/property_contexts b/prebuilts/api/33.0/private/property_contexts index f65b5cc8b..c5b72821c 100644 --- a/prebuilts/api/33.0/private/property_contexts +++ b/prebuilts/api/33.0/private/property_contexts @@ -361,6 +361,7 @@ config.disable_cameraservice u:object_r:camera_config_prop:s0 exact bool camera.disable_preview_scheduler u:object_r:camera_config_prop:s0 exact bool camera.disable_zsl_mode u:object_r:camera_config_prop:s0 exact bool camera.fifo.disable u:object_r:camera_config_prop:s0 exact bool +camera.enable_landscape_to_portrait u:object_r:camera_config_prop:s0 exact bool ro.camera.notify_nfc u:object_r:camera_config_prop:s0 exact bool ro.camera.enableLazyHal u:object_r:camera_config_prop:s0 exact bool ro.camera.enableCamera1MaxZsl u:object_r:camera_config_prop:s0 exact bool diff --git a/private/property_contexts b/private/property_contexts index f65b5cc8b..c5b72821c 100644 --- a/private/property_contexts +++ b/private/property_contexts @@ -361,6 +361,7 @@ config.disable_cameraservice u:object_r:camera_config_prop:s0 exact bool camera.disable_preview_scheduler u:object_r:camera_config_prop:s0 exact bool camera.disable_zsl_mode u:object_r:camera_config_prop:s0 exact bool camera.fifo.disable u:object_r:camera_config_prop:s0 exact bool +camera.enable_landscape_to_portrait u:object_r:camera_config_prop:s0 exact bool ro.camera.notify_nfc u:object_r:camera_config_prop:s0 exact bool ro.camera.enableLazyHal u:object_r:camera_config_prop:s0 exact bool ro.camera.enableCamera1MaxZsl u:object_r:camera_config_prop:s0 exact bool