From b8f0e2db69f1409223411402cd8e9be4fa5c696f Mon Sep 17 00:00:00 2001 From: "andrew.yang" Date: Sat, 18 Jan 2020 10:10:03 +0800 Subject: [PATCH] [ALPS04385961] RTC: add permission for power-off alarm Allow alarm manager to access /dev/alarm for power-off alarm function. MTK-Commit-Id: 01de6e5669b8e97c12818256915885dc32c45b9f Change-Id: I5e3759e9d11357c3f302aa2557dc71de80476262 CR-Id: ALPS04385961 Feature: Power-Off Alarm --- non_plat/device.te | 1 + non_plat/file_contexts | 1 + non_plat/system_server.te | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/non_plat/device.te b/non_plat/device.te index 2b3e197..638ef5d 100644 --- a/non_plat/device.te +++ b/non_plat/device.te @@ -225,6 +225,7 @@ type cam_vpu_block_device,dev_type; type boot_para_block_device,dev_type; type mtk_dfrc_device, dev_type; type vbmeta_block_device, dev_type; +type alarm_device, dev_type; ########################## # Sensor common Devices Start diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 7e7256d..b9d6a95 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -339,6 +339,7 @@ /dev/hrm u:object_r:hrm_device:s0 /dev/trusty-ipc-dev0 u:object_r:tee_device:s0 /dev/mbim u:object_r:mbim_device:s0 +/dev/alarm(/.*)? u:object_r:alarm_device:s0 ########################## # Sensor common Devices Start # diff --git a/non_plat/system_server.te b/non_plat/system_server.te index 6e8256b..7c2141a 100644 --- a/non_plat/system_server.te +++ b/non_plat/system_server.te @@ -201,3 +201,8 @@ binder_call(system_server, mtk_hal_wifi) # ino=10312 scontext=u:r:system_server:s0 tcontext= # u:object_r:persist_mtk_aee_prop:s0 tclass=file permissive=0 get_prop(system_server, persist_mtk_aee_prop); + +# Date : W19.15 +# Operation : alarm device permission +# Purpose : support power-off alarm +allow system_server alarm_device:chr_file rw_file_perms; \ No newline at end of file