From 59970a4ed363a5a52afc8dde1d2673ea4e573f7e Mon Sep 17 00:00:00 2001
From: Jesse Hall <jessehall@google.com>
Date: Sat, 26 Mar 2016 22:56:27 -0700
Subject: [PATCH] Define gpu_service and allow surfaceflinger to provide it

Bug: 26620936 and 27352427
Change-Id: I3d6d2e479d95133693790a97827e45e9dd30bc4a
---
 service.te        | 1 +
 service_contexts  | 1 +
 surfaceflinger.te | 1 +
 3 files changed, 3 insertions(+)

diff --git a/service.te b/service.te
index 2915e95e4..71f8f3bdb 100644
--- a/service.te
+++ b/service.te
@@ -6,6 +6,7 @@ type drmserver_service,         service_manager_type;
 type gatekeeper_service,        app_api_service, service_manager_type;
 type fingerprintd_service,      service_manager_type;
 type batteryproperties_service, app_api_service, service_manager_type;
+type gpu_service,               service_manager_type;
 type inputflinger_service,      service_manager_type;
 type keystore_service,          service_manager_type;
 type mediaserver_service,       service_manager_type;
diff --git a/service_contexts b/service_contexts
index 9b049e37d..c1fe96131 100644
--- a/service_contexts
+++ b/service_contexts
@@ -43,6 +43,7 @@ fingerprint                               u:object_r:fingerprint_service:s0
 android.hardware.fingerprint.IFingerprintDaemon u:object_r:fingerprintd_service:s0
 gfxinfo                                   u:object_r:gfxinfo_service:s0
 graphicsstats                             u:object_r:graphicsstats_service:s0
+gpu                                       u:object_r:gpu_service:s0
 hardware                                  u:object_r:hardware_service:s0
 hardware_properties                       u:object_r:hardware_properties_service:s0
 hdmi_control                              u:object_r:hdmi_control_service:s0
diff --git a/surfaceflinger.te b/surfaceflinger.te
index 216401097..38f1dad83 100644
--- a/surfaceflinger.te
+++ b/surfaceflinger.te
@@ -56,6 +56,7 @@ allow surfaceflinger tee_device:chr_file rw_file_perms;
 allow surfaceflinger mediaserver_service:service_manager find;
 allow surfaceflinger permission_service:service_manager find;
 allow surfaceflinger power_service:service_manager find;
+allow surfaceflinger gpu_service:service_manager { add find };
 allow surfaceflinger surfaceflinger_service:service_manager { add find };
 allow surfaceflinger window_service:service_manager find;
 
-- 
GitLab