From 0b79a17952e50519518f687fb6656107bdfad9fd Mon Sep 17 00:00:00 2001
From: Kenny Root <kroot@google.com>
Date: Thu, 25 Jan 2018 16:12:39 +0900
Subject: [PATCH] Add ADB system service

ADB is being separated from USB service since it's not tied to the USB
transport. This duplicates the usb_service's settings to adb_service for
this purpose.

Bug: 63820489
Test: make
Change-Id: Idbcfbe470d7568f9cba51f0c8d4a8ee9503db93d
---
 private/compat/26.0/26.0.ignore.cil | 3 ++-
 private/compat/27.0/27.0.ignore.cil | 3 ++-
 private/service_contexts            | 1 +
 public/service.te                   | 1 +
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/private/compat/26.0/26.0.ignore.cil b/private/compat/26.0/26.0.ignore.cil
index 3a493e01e..859e45da4 100644
--- a/private/compat/26.0/26.0.ignore.cil
+++ b/private/compat/26.0/26.0.ignore.cil
@@ -3,7 +3,8 @@
 ;;   previous ones.  Add here to pass checkapi tests.
 (typeattribute new_objects)
 (typeattributeset new_objects
-  ( adbd_exec
+  ( adb_service
+    adbd_exec
     bootloader_boot_reason_prop
     blank_screen
     blank_screen_exec
diff --git a/private/compat/27.0/27.0.ignore.cil b/private/compat/27.0/27.0.ignore.cil
index 99db6624e..998ac5fba 100644
--- a/private/compat/27.0/27.0.ignore.cil
+++ b/private/compat/27.0/27.0.ignore.cil
@@ -3,7 +3,8 @@
 ;;   previous ones.  Add here to pass checkapi tests.
 (typeattribute new_objects)
 (typeattributeset new_objects
-  ( blank_screen
+  ( adb_service
+    blank_screen
     blank_screen_exec
     blank_screen_tmpfs
     bootloader_boot_reason_prop
diff --git a/private/service_contexts b/private/service_contexts
index 71d484514..985444f90 100644
--- a/private/service_contexts
+++ b/private/service_contexts
@@ -1,6 +1,7 @@
 accessibility                             u:object_r:accessibility_service:s0
 account                                   u:object_r:account_service:s0
 activity                                  u:object_r:activity_service:s0
+adb                                       u:object_r:adb_service:s0
 alarm                                     u:object_r:alarm_service:s0
 android.os.UpdateEngineService            u:object_r:update_engine_service:s0
 android.security.keystore                 u:object_r:keystore_service:s0
diff --git a/public/service.te b/public/service.te
index e13b6d5e7..ae45987a9 100644
--- a/public/service.te
+++ b/public/service.te
@@ -37,6 +37,7 @@ type vr_hwc_service,            service_manager_type;
 type accessibility_service, app_api_service, ephemeral_app_api_service, system_server_service, service_manager_type;
 type account_service, app_api_service, ephemeral_app_api_service, system_server_service, service_manager_type;
 type activity_service, app_api_service, ephemeral_app_api_service, system_server_service, service_manager_type;
+type adb_service, system_server_service, service_manager_type;
 type alarm_service, app_api_service, ephemeral_app_api_service, system_server_service, service_manager_type;
 type appops_service, app_api_service, ephemeral_app_api_service, system_server_service, service_manager_type;
 type appwidget_service, app_api_service, ephemeral_app_api_service, system_server_service, service_manager_type;
-- 
GitLab