From 123bbe9491a71ca968658ab81c48a4cee29d4c14 Mon Sep 17 00:00:00 2001
From: Peng Xu <pengxu@google.com>
Date: Tue, 12 Sep 2017 14:44:02 -0700
Subject: [PATCH] Allow sensor hal to use wakelock

Added permission related to use of wake lock. Wakelock in sensor
HAL is used to gurantee delivery of wake up sensor events before
system go back to sleep.

Bug: 63995095
Test: QCOM and nanohub sensor hal are able to acquire wakelock
      successfuly.

Change-Id: Id4ac3552e18a1cad252017e3dc9ab3d4be8d4ab9
---
 vendor/hal_sensors_default.te | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vendor/hal_sensors_default.te b/vendor/hal_sensors_default.te
index 7fd8f8561..1bde858cd 100644
--- a/vendor/hal_sensors_default.te
+++ b/vendor/hal_sensors_default.te
@@ -6,5 +6,11 @@ init_daemon_domain(hal_sensors_default)
 
 allow hal_sensors_default fwk_scheduler_hwservice:hwservice_manager find;
 
+# Allow sensor hals to access and use gralloc memory allocated by
+# android.hardware.graphics.allocator
 allow hal_sensors_default hal_graphics_allocator_default:fd use;
 allow hal_sensors_default ion_device:chr_file r_file_perms;
+
+# allow sensor hal to use lock for keeping system awake for wake up
+# events delivery.
+wakelock_use(hal_sensors_default);
-- 
GitLab