From cf45cb9c257013a06b6128b963d5da5fa741a439 Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Fri, 8 Oct 2021 11:09:40 +0800 Subject: [PATCH 1/4] reorganize pixelstats_vendor Bug: 202462997 Test: boot with pixelstats_vendor started Change-Id: I0687fccec8b9c80435905ae5aba25ec7ddaee65f --- vendor/google/pixelstats_vendor.te | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vendor/google/pixelstats_vendor.te b/vendor/google/pixelstats_vendor.te index b8ae709..df2b668 100644 --- a/vendor/google/pixelstats_vendor.te +++ b/vendor/google/pixelstats_vendor.te @@ -1,8 +1,3 @@ -# pixelstats vendor -type pixelstats_vendor, domain; - -type pixelstats_vendor_exec, exec_type, vendor_file_type, file_type; -init_daemon_domain(pixelstats_vendor) r_dir_file(pixelstats_vendor, sysfs_pixelstats) unix_socket_connect(pixelstats_vendor, chre, chre) From 035d66fb0b4ed5c22d3af719f0d380add7fa567d Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 31 Jan 2022 22:08:26 -0800 Subject: [PATCH 2/4] android.hardware.usb.IUsb AIDL migration android.hardware.usb.IUsb is migrated to AIDL and runs in its own process. android.hardware.usb.gadget.IUsbGadget is now published in its own exclusive process (android.hardware.usb.gadget-service). Creating file_context and moving the selinux linux rules for IUsbGadget implementation. Bug: 200993386 Change-Id: Ia8c24610244856490c8271433710afb57d3da157 --- vendor/google/file_contexts | 3 ++- vendor/google/hal_usb_gadget_impl.te | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 vendor/google/hal_usb_gadget_impl.te diff --git a/vendor/google/file_contexts b/vendor/google/file_contexts index 97263fe..cd5a515 100644 --- a/vendor/google/file_contexts +++ b/vendor/google/file_contexts @@ -1,4 +1,5 @@ # vendor binaries -/vendor/bin/hw/android\.hardware\.usb@1\.3-service\.redfin u:object_r:hal_usb_impl_exec:s0 +/vendor/bin/hw/android\.hardware\.usb-service\.redfin u:object_r:hal_usb_impl_exec:s0 +/vendor/bin/hw/android\.hardware\.usb\.gadget-service\.redfin u:object_r:hal_usb_gadget_impl_exec:s0 /vendor/bin/hw/android\.hardware\.vibrator-service\.redfin u:object_r:hal_vibrator_default_exec:s0 /vendor/bin/hw/android\.hardware\.dumpstate@1\.1-service\.redfin u:object_r:hal_dumpstate_impl_exec:s0 diff --git a/vendor/google/hal_usb_gadget_impl.te b/vendor/google/hal_usb_gadget_impl.te new file mode 100644 index 0000000..89ae09f --- /dev/null +++ b/vendor/google/hal_usb_gadget_impl.te @@ -0,0 +1,13 @@ +type hal_usb_gadget_impl, domain; +hal_server_domain(hal_usb_gadget_impl, hal_usb) +hal_server_domain(hal_usb_gadget_impl, hal_usb_gadget) + +type hal_usb_gadget_impl_exec, vendor_file_type, exec_type, file_type; +init_daemon_domain(hal_usb_gadget_impl) + +allow hal_usb_gadget_impl configfs:dir { create rmdir }; +allow hal_usb_gadget_impl functionfs:dir { watch watch_reads }; + +allow hal_usb_gadget_impl sysfs_batteryinfo:dir r_dir_perms; +allow hal_usb_gadget_impl sysfs_batteryinfo:file rw_file_perms; +allow hal_usb_gadget_impl sysfs_extcon:dir search; From b99951ceb737e640110324e6899c485d9a3a4401 Mon Sep 17 00:00:00 2001 From: Muhammad Qureshi Date: Thu, 3 Feb 2022 00:29:25 +0000 Subject: [PATCH 3/4] Revert "android.hardware.usb.IUsb AIDL migration" Revert "Migrate IUsb implementation to AIDL" Revert submission 16765902-IUSB_redfin Reason for revert: DeviceBootTest failure - b/217606853 Reverted Changes: I681c1ba9c:Migrate IUsb implementation to AIDL Ia8c246102:android.hardware.usb.IUsb AIDL migration Change-Id: I86aeeff51650dbd51d6e167baa20cd705dcd656b --- vendor/google/file_contexts | 3 +-- vendor/google/hal_usb_gadget_impl.te | 13 ------------- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 vendor/google/hal_usb_gadget_impl.te diff --git a/vendor/google/file_contexts b/vendor/google/file_contexts index cd5a515..97263fe 100644 --- a/vendor/google/file_contexts +++ b/vendor/google/file_contexts @@ -1,5 +1,4 @@ # vendor binaries -/vendor/bin/hw/android\.hardware\.usb-service\.redfin u:object_r:hal_usb_impl_exec:s0 -/vendor/bin/hw/android\.hardware\.usb\.gadget-service\.redfin u:object_r:hal_usb_gadget_impl_exec:s0 +/vendor/bin/hw/android\.hardware\.usb@1\.3-service\.redfin u:object_r:hal_usb_impl_exec:s0 /vendor/bin/hw/android\.hardware\.vibrator-service\.redfin u:object_r:hal_vibrator_default_exec:s0 /vendor/bin/hw/android\.hardware\.dumpstate@1\.1-service\.redfin u:object_r:hal_dumpstate_impl_exec:s0 diff --git a/vendor/google/hal_usb_gadget_impl.te b/vendor/google/hal_usb_gadget_impl.te deleted file mode 100644 index 89ae09f..0000000 --- a/vendor/google/hal_usb_gadget_impl.te +++ /dev/null @@ -1,13 +0,0 @@ -type hal_usb_gadget_impl, domain; -hal_server_domain(hal_usb_gadget_impl, hal_usb) -hal_server_domain(hal_usb_gadget_impl, hal_usb_gadget) - -type hal_usb_gadget_impl_exec, vendor_file_type, exec_type, file_type; -init_daemon_domain(hal_usb_gadget_impl) - -allow hal_usb_gadget_impl configfs:dir { create rmdir }; -allow hal_usb_gadget_impl functionfs:dir { watch watch_reads }; - -allow hal_usb_gadget_impl sysfs_batteryinfo:dir r_dir_perms; -allow hal_usb_gadget_impl sysfs_batteryinfo:file rw_file_perms; -allow hal_usb_gadget_impl sysfs_extcon:dir search; From 4cdd25b85a5c2e6d31dfbb872e0506f0b440751f Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Mon, 31 Jan 2022 22:08:26 -0800 Subject: [PATCH 4/4] android.hardware.usb.IUsb AIDL migration android.hardware.usb.IUsb is migrated to AIDL and runs in its own process. android.hardware.usb.gadget.IUsbGadget is now published in its own exclusive process (android.hardware.usb.gadget-service). Creating file_context and moving the selinux linux rules for IUsbGadget implementation. Bug: 200993386 Change-Id: I2e359e29716af5515c60ea57b554103579ca5570 --- vendor/google/file_contexts | 3 ++- vendor/google/hal_usb_gadget_impl.te | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 vendor/google/hal_usb_gadget_impl.te diff --git a/vendor/google/file_contexts b/vendor/google/file_contexts index 97263fe..cd5a515 100644 --- a/vendor/google/file_contexts +++ b/vendor/google/file_contexts @@ -1,4 +1,5 @@ # vendor binaries -/vendor/bin/hw/android\.hardware\.usb@1\.3-service\.redfin u:object_r:hal_usb_impl_exec:s0 +/vendor/bin/hw/android\.hardware\.usb-service\.redfin u:object_r:hal_usb_impl_exec:s0 +/vendor/bin/hw/android\.hardware\.usb\.gadget-service\.redfin u:object_r:hal_usb_gadget_impl_exec:s0 /vendor/bin/hw/android\.hardware\.vibrator-service\.redfin u:object_r:hal_vibrator_default_exec:s0 /vendor/bin/hw/android\.hardware\.dumpstate@1\.1-service\.redfin u:object_r:hal_dumpstate_impl_exec:s0 diff --git a/vendor/google/hal_usb_gadget_impl.te b/vendor/google/hal_usb_gadget_impl.te new file mode 100644 index 0000000..ddd90c2 --- /dev/null +++ b/vendor/google/hal_usb_gadget_impl.te @@ -0,0 +1,14 @@ +type hal_usb_gadget_impl, domain; +hal_server_domain(hal_usb_gadget_impl, hal_usb) +hal_server_domain(hal_usb_gadget_impl, hal_usb_gadget) + +type hal_usb_gadget_impl_exec, vendor_file_type, exec_type, file_type; +init_daemon_domain(hal_usb_gadget_impl) + +allow hal_usb_gadget_impl configfs:dir { create rmdir }; +allow hal_usb_gadget_impl functionfs:dir { watch watch_reads }; +set_prop(hal_usb_gadget_impl, vendor_usb_prop) + +allow hal_usb_gadget_impl sysfs_batteryinfo:dir r_dir_perms; +allow hal_usb_gadget_impl sysfs_batteryinfo:file rw_file_perms; +allow hal_usb_gadget_impl sysfs_extcon:dir search;