From 0b21a2d44a7ffd32ffa82d63a236aafe56bd425e Mon Sep 17 00:00:00 2001 From: Denny cy Lee Date: Mon, 24 May 2021 13:32:21 +0800 Subject: [PATCH] Pixelstat: battery history access premission Test: manually, relate seploicy not show; battery history log printed 05-24 13:29:19.637 2829 2829 D pixelstats_BatteryEEPROM: checkAndReport: 0940 0a80 0500 0200 0200 0000 Bug: 189050725 Change-Id: I20567e168db43fe2168a9a30ac7a4b0cec65a665 Signed-off-by: Denny cy Lee --- whitechapel/vendor/google/device.te | 2 ++ whitechapel/vendor/google/file_contexts | 3 +++ whitechapel/vendor/google/pixelstats_vendor.te | 6 ++++++ whitechapel/vendor/google/system_server.te | 3 +++ 4 files changed, 14 insertions(+) diff --git a/whitechapel/vendor/google/device.te b/whitechapel/vendor/google/device.te index f0e8d8d0..c99eaa9e 100644 --- a/whitechapel/vendor/google/device.te +++ b/whitechapel/vendor/google/device.te @@ -53,3 +53,5 @@ type fingerprint_device, dev_type; # AMCS device type amcs_device, dev_type; +# Battery history +type battery_history_device, dev_type; diff --git a/whitechapel/vendor/google/file_contexts b/whitechapel/vendor/google/file_contexts index 379ef830..c858c346 100644 --- a/whitechapel/vendor/google/file_contexts +++ b/whitechapel/vendor/google/file_contexts @@ -361,6 +361,9 @@ # pixelstats binary /vendor/bin/pixelstats-vendor u:object_r:pixelstats_vendor_exec:s0 +# battery history +/dev/battery_history u:object_r:battery_history_device:s0 + # Vendor_kernel_modules /vendor_dlkm/lib/modules/.*\.ko u:object_r:vendor_kernel_modules:s0 diff --git a/whitechapel/vendor/google/pixelstats_vendor.te b/whitechapel/vendor/google/pixelstats_vendor.te index 68e59120..07c370b6 100644 --- a/whitechapel/vendor/google/pixelstats_vendor.te +++ b/whitechapel/vendor/google/pixelstats_vendor.te @@ -18,3 +18,9 @@ allow pixelstats_vendor sysfs_pixelstats:file r_file_perms; allow pixelstats_vendor sysfs_wlc:dir search; allow pixelstats_vendor sysfs_wlc:file rw_file_perms; + +# OrientationCollector +allow pixelstats_vendor fwk_sensor_hwservice:hwservice_manager find; + +# Batery history +allow pixelstats_vendor battery_history_device:chr_file r_file_perms; diff --git a/whitechapel/vendor/google/system_server.te b/whitechapel/vendor/google/system_server.te index 001b8556..b2563949 100644 --- a/whitechapel/vendor/google/system_server.te +++ b/whitechapel/vendor/google/system_server.te @@ -3,3 +3,6 @@ binder_call(system_server, gpsd); binder_call(system_server, hal_camera_default); # Allow system server to find vendor uwb service allow system_server uwb_vendor_service:service_manager find; + +# pixelstats_vendor/OrientationCollector +binder_call(system_server, pixelstats_vendor)