From a974640390db8fd103618746de61fc37ebda74fb Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Wed, 18 Nov 2020 14:08:41 -0800 Subject: [PATCH] Define vendor side property "ro.camerax.extensions.enabled" Add "ro.camerax.extensions.enabled" vendor-specific property. Allow public apps to read this property. Bug: 171572972 Test: Camera CTS Change-Id: Id5fadedff6baaaebe5306100c2a054e537aa61ed --- private/compat/30.0/30.0.ignore.cil | 1 + private/property_contexts | 2 ++ public/app.te | 3 +++ public/property.te | 1 + public/vendor_init.te | 1 + 5 files changed, 8 insertions(+) diff --git a/private/compat/30.0/30.0.ignore.cil b/private/compat/30.0/30.0.ignore.cil index e5681dee7..4867ec09d 100644 --- a/private/compat/30.0/30.0.ignore.cil +++ b/private/compat/30.0/30.0.ignore.cil @@ -18,6 +18,7 @@ appcompat_data_file arm64_memtag_prop authorization_service + camerax_extensions_prop cgroup_desc_api_file cgroup_v2 codec2_config_prop diff --git a/private/property_contexts b/private/property_contexts index c7d67432d..34efaac02 100644 --- a/private/property_contexts +++ b/private/property_contexts @@ -323,6 +323,8 @@ camera.fifo.disable 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.camerax.extensions.enabled u:object_r:camerax_extensions_prop:s0 exact bool + # Should always_debuggable be bool? It's checked against the string "1". dalvik.vm.always_debuggable u:object_r:dalvik_config_prop:s0 exact int dalvik.vm.appimageformat u:object_r:dalvik_config_prop:s0 exact string diff --git a/public/app.te b/public/app.te index af19d1086..ae8d7fd9a 100644 --- a/public/app.te +++ b/public/app.te @@ -592,3 +592,6 @@ neverallow appdomain system_bootstrap_lib_file:file { open read write append execute execute_no_trans map }; neverallow appdomain system_bootstrap_lib_file:dir { open read getattr search }; + +# Allow to ro.camerax.extensions.enabled +get_prop(appdomain, camerax_extensions_prop) diff --git a/public/property.te b/public/property.te index 8cae47c6d..caa705a9f 100644 --- a/public/property.te +++ b/public/property.te @@ -122,6 +122,7 @@ system_vendor_config_prop(build_odm_prop) system_vendor_config_prop(build_vendor_prop) system_vendor_config_prop(camera_calibration_prop) system_vendor_config_prop(camera_config_prop) +system_vendor_config_prop(camerax_extensions_prop) system_vendor_config_prop(charger_config_prop) system_vendor_config_prop(codec2_config_prop) system_vendor_config_prop(cpu_variant_prop) diff --git a/public/vendor_init.te b/public/vendor_init.te index 25d0dcb57..a8f941880 100644 --- a/public/vendor_init.te +++ b/public/vendor_init.te @@ -223,6 +223,7 @@ allow vendor_init self:capability sys_nice; set_prop(vendor_init, apk_verity_prop) set_prop(vendor_init, bluetooth_a2dp_offload_prop) set_prop(vendor_init, bluetooth_audio_hal_prop) +set_prop(vendor_init, camerax_extensions_prop) set_prop(vendor_init, cpu_variant_prop) set_prop(vendor_init, dalvik_runtime_prop) set_prop(vendor_init, debug_prop)