Merge "touch: provide permission for TouchInspector app" into udc-d1-dev
diff --git a/aoc/dump_aoc.cpp b/aoc/dump_aoc.cpp
index 97da3b5..6be56b0 100644
--- a/aoc/dump_aoc.cpp
+++ b/aoc/dump_aoc.cpp
@@ -19,18 +19,18 @@
// Dump Aoc.
int main() {
setbuf(stdout, NULL);
- dumpFileContent("AoC Service Status", "/sys/devices/platform/19000000.aoc/services");
- dumpFileContent("AoC Restarts", "/sys/devices/platform/19000000.aoc/restart_count");
- dumpFileContent("AoC Coredumps", "/sys/devices/platform/19000000.aoc/coredump_count");
- dumpFileContent("AoC ring buf wake", "/sys/devices/platform/19000000.aoc/control/ring_buffer_wakeup");
- dumpFileContent("AoC host ipc wake", "/sys/devices/platform/19000000.aoc/control/host_ipc_wakeup");
- dumpFileContent("AoC usf wake", "/sys/devices/platform/19000000.aoc/control/usf_wakeup");
- dumpFileContent("AoC audio wake", "/sys/devices/platform/19000000.aoc/control/audio_wakeup");
- dumpFileContent("AoC logging wake", "/sys/devices/platform/19000000.aoc/control/logging_wakeup");
- dumpFileContent("AoC hotword wake", "/sys/devices/platform/19000000.aoc/control/hotword_wakeup");
- dumpFileContent("AoC memory exception wake", "/sys/devices/platform/19000000.aoc/control/memory_exception");
- dumpFileContent("AoC memory votes", "/sys/devices/platform/19000000.aoc/control/memory_votes_a32");
- dumpFileContent("AoC memory votes", "/sys/devices/platform/19000000.aoc/control/memory_votes_ff1");
+ runCommand("AoC Service Status", "timeout 0.1 cat /sys/devices/platform/*.aoc/services");
+ runCommand("AoC Restarts", "timeout 0.1 cat /sys/devices/platform/*.aoc/restart_count");
+ runCommand("AoC Coredumps", "timeout 0.1 cat /sys/devices/platform/*.aoc/coredump_count");
+ runCommand("AoC ring buf wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/ring_buffer_wakeup");
+ runCommand("AoC host ipc wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/host_ipc_wakeup");
+ runCommand("AoC usf wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/usf_wakeup");
+ runCommand("AoC audio wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/audio_wakeup");
+ runCommand("AoC logging wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/logging_wakeup");
+ runCommand("AoC hotword wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/hotword_wakeup");
+ runCommand("AoC memory exception wake", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_exception");
+ runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_a32");
+ runCommand("AoC memory votes", "timeout 0.1 cat /sys/devices/platform/*.aoc/control/memory_votes_ff1");
runCommand("clean AoC buffer","echo ' ' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Heap Stats (A32)", "echo 'dbg heap -c 1' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
runCommand("AoC Heap Stats (F1)", "echo 'dbg heap -c 2' > /dev/acd-debug; timeout 0.1 cat /dev/acd-debug");
diff --git a/aoc/sepolicy/dump_aoc.te b/aoc/sepolicy/dump_aoc.te
index f5f085c..0731da4 100644
--- a/aoc/sepolicy/dump_aoc.te
+++ b/aoc/sepolicy/dump_aoc.te
@@ -1,5 +1,6 @@
pixel_bugreport(dump_aoc)
allow dump_aoc sysfs_aoc:dir search;
+allow dump_aoc sysfs:dir r_dir_perms;
allow dump_aoc sysfs_aoc_dumpstate:file r_file_perms;
allow dump_aoc aoc_device:chr_file rw_file_perms;
allow dump_aoc vendor_shell_exec:file execute_no_trans;
diff --git a/audio/aidl.mk b/audio/aidl.mk
index ae64e13..172b63d 100644
--- a/audio/aidl.mk
+++ b/audio/aidl.mk
@@ -4,6 +4,17 @@
PRODUCT_PACKAGES += \
android.hardware.audio.service-aidl.aoc
+# AIDL software effects. These are the effects supporting in all projects.
+# For the project-specific effects, such as haptic generator, please add them
+# to makefile in the project's device folder.
+PRODUCT_PACKAGES += \
+ libvisualizeraidl \
+ libbundleaidl \
+ libreverbaidl \
+ libdynamicsprocessingaidl \
+ libloudnessenhanceraidl \
+ libdownmixaidl \
+
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/audio/sepolicy/aidl
include device/google/gs-common/audio/common.mk
diff --git a/camera/lyric.mk b/camera/lyric.mk
new file mode 100644
index 0000000..d225d3b
--- /dev/null
+++ b/camera/lyric.mk
@@ -0,0 +1,62 @@
+PRODUCT_SOONG_NAMESPACES += \
+ hardware/google/camera \
+ vendor/google/services/LyricCameraHAL/src \
+ vendor/google/services/LyricCameraHAL/src/apex
+
+$(call soong_config_set,lyric,use_lyric_camera_hal,true)
+$(call soong_config_set,google3a_config,gcam_awb,true)
+$(call soong_config_set,google3a_config,ghawb_truetone,true)
+
+# Select GCH backend.
+# TODO(b/192681010): This dependency inversion should be removed.
+ifneq ($(wildcard vendor/google/services/LyricCameraHAL/src),)
+$(call soong_config_set,gch,hwl_library,lyric)
+endif
+
+# Check if we're in PDK build
+ifeq ($(wildcard vendor/google/camera),)
+# If vendor/google/camera doesn't exist, it's a PDK build.
+$(call soong_config_set,lyric,pdk_build,true)
+else
+# Otherwise, it's an internal Google build.
+$(call soong_config_set,lyric,pdk_build,false)
+
+PRODUCT_SOONG_NAMESPACES += \
+ vendor/google/camera \
+ vendor/google/camera/google_3a/libs_v4 \
+ vendor/google/camera/rlsservice
+
+# TODO(b/257379485): 3A is incrementally enabling cuttlefish build for native
+# code coverage support, temporary require separate namespace for folders that
+# can be built successfully.
+PRODUCT_SOONG_NAMESPACES += \
+ vendor/google/camera/google_3a/libs_v4/g3ABase \
+ vendor/google/camera/google_3a/libs_v4/gABC/native_coverage \
+ vendor/google/camera/google_3a/libs_v4/gAF \
+ vendor/google/camera/google_3a/libs_v4/gafd \
+ vendor/google/camera/google_3a/libs_v4/gHAWB/native_coverage
+
+# Calibration tool for debug builds
+PRODUCT_PACKAGES_DEBUG += tarasque_test
+
+# dualcamcapture only works for GMS build. Only enable this apk for GMS userdebug/eng builds
+ifeq (,$(filter aosp_% factory_%,$(TARGET_PRODUCT)))
+PRODUCT_PACKAGES_DEBUG += dualcamcapture
+PRODUCT_COPY_FILES += vendor/google/camera/devices/whi/preinstalled-packages-product-camera-device-vendor-debug.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/preinstalled-packages-product-camera-device-vendor-debug.xml
+endif
+
+endif # vendor/google/camera check
+
+# Init-time log settings for Google 3A
+PRODUCT_PACKAGES += libg3a_standalone_gabc_rc
+PRODUCT_PACKAGES += libg3a_standalone_gaf_rc
+PRODUCT_PACKAGES += libg3a_standalone_ghawb_rc
+
+# Vendor APEX which contains the camera HAL
+PRODUCT_PACKAGES += com.google.pixel.camera.hal
+PRODUCT_PACKAGES += init.camera.set-interrupts-ownership
+
+# sepolicy dir is added in dump.mk.
+# Make doesn't deduplicate sepolicy dirs, so including it here causes build errors.
+
+PRODUCT_COPY_FILES += vendor/google/services/LyricCameraHAL/src/vendor.android.hardware.camera.preview-dis.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/vendor.android.hardware.camera.preview-dis.xml
diff --git a/camera/lyric_soong_variables.md b/camera/lyric_soong_variables.md
new file mode 100644
index 0000000..b442943
--- /dev/null
+++ b/camera/lyric_soong_variables.md
@@ -0,0 +1,46 @@
+# Lyric Soong variables
+
+## `kernel_version`
+
+Example:
+```
+$(call soong_config_set,lyric,kernel_version,v515)
+```
+Linux kernel version on the device. Determines the version of the LWIS userspace
+API to use in Lyric.
+
+## `soc`
+
+Example:
+```
+$(call soong_config_set,lyric,soc,gs101)
+```
+The codename for the chip used in the device. Currently only Google silicon
+is supported.
+
+## `camera_hardware`
+
+Example:
+```
+$(call soong_config_set,lyric,camera_hardware,oriole)
+```
+Specifies the set of sensors and peripherals present on the device. Determines
+the DeviceContext class that will be used.
+
+## `tuning_product`
+
+Example:
+```
+$(call soong_config_set,lyric,tuning_product,oriole)
+```
+Specifies the set of tuning data to use. This may be different than
+`camera_hardware` because not all devices have their own tuning data;
+development-only devices only have the default tuning for their SoC.
+
+## `target_device`
+
+Example:
+```
+$(call soong_config_set,google3a_config,target_device,oriole)
+```
+A mixture of `camera_hardware` and `tuning_product` used by 3A.
diff --git a/camera/sepolicy/file_contexts b/camera/sepolicy/file_contexts
index 4bb5308..bc21b02 100644
--- a/camera/sepolicy/file_contexts
+++ b/camera/sepolicy/file_contexts
@@ -1,5 +1,5 @@
/vendor/bin/dump/dump_camera u:object_r:dump_camera_exec:s0
+/vendor/bin/init\.camera\.set-interrupts-ownership u:object_r:init-camera-set-interrupts-ownership_exec:s0
# Data
/data/vendor/camera(/.*)? u:object_r:vendor_camera_data_file:s0
-
diff --git a/camera/sepolicy/init.camera.set-interrupts-ownership.te b/camera/sepolicy/init.camera.set-interrupts-ownership.te
new file mode 100644
index 0000000..781e68d
--- /dev/null
+++ b/camera/sepolicy/init.camera.set-interrupts-ownership.te
@@ -0,0 +1,10 @@
+type init-camera-set-interrupts-ownership, domain;
+type init-camera-set-interrupts-ownership_exec, exec_type, vendor_file_type, file_type;
+
+init_daemon_domain(init-camera-set-interrupts-ownership)
+
+allow init-camera-set-interrupts-ownership vendor_toolbox_exec:file rx_file_perms;
+allow init-camera-set-interrupts-ownership proc_interrupts:file r_file_perms;
+allow init-camera-set-interrupts-ownership proc_irq:dir r_dir_perms;
+allow init-camera-set-interrupts-ownership proc_irq:file { r_file_perms setattr };
+allow init-camera-set-interrupts-ownership self:capability { chown setuid setgid };
diff --git a/radio/sepolicy/dump_radio.te b/radio/sepolicy/dump_radio.te
index 146776c..7970f08 100644
--- a/radio/sepolicy/dump_radio.te
+++ b/radio/sepolicy/dump_radio.te
@@ -3,6 +3,8 @@
userdebug_or_eng(`
allow dump_radio radio_vendor_data_file:dir create_dir_perms;
allow dump_radio radio_vendor_data_file:file create_file_perms;
+ allow dump_radio tcpdump_vendor_data_file:dir r_dir_perms;
+ allow dump_radio tcpdump_vendor_data_file:file r_file_perms;
get_prop(dump_radio, vendor_rild_prop)
get_prop(dump_radio vendor_tcpdump_log_prop)
')
diff --git a/radio/sepolicy/file.te b/radio/sepolicy/file.te
new file mode 100644
index 0000000..02d0209
--- /dev/null
+++ b/radio/sepolicy/file.te
@@ -0,0 +1,6 @@
+# Data
+type tcpdump_vendor_data_file, file_type, data_file_type;
+
+userdebug_or_eng(`
+ typeattribute tcpdump_vendor_data_file mlstrustedobject;
+')
diff --git a/radio/sepolicy/file_contexts b/radio/sepolicy/file_contexts
index 558beb3..20d786c 100644
--- a/radio/sepolicy/file_contexts
+++ b/radio/sepolicy/file_contexts
@@ -1 +1,2 @@
/vendor/bin/dump/dump_radio u:object_r:dump_radio_exec:s0
+/data/vendor/tcpdump_logger(/.*)? u:object_r:tcpdump_vendor_data_file:s0
diff --git a/widevine/widevine.mk b/widevine/widevine.mk
new file mode 100644
index 0000000..c59c7b9
--- /dev/null
+++ b/widevine/widevine.mk
@@ -0,0 +1,4 @@
+PRODUCT_PACKAGES += \
+ android.hardware.drm-service.clearkey \
+
+-include vendor/widevine/libwvdrmengine/apex/device/device.mk
\ No newline at end of file