From c6afcb7fc0e25d32a858d6d0e670310dbc983409 Mon Sep 17 00:00:00 2001
From: Todd Poynor <toddpoynor@google.com>
Date: Mon, 25 Jun 2018 18:19:16 -0700
Subject: [PATCH] remove thermalcallback_hwservice

This hwservice isn't registered with hwservicemanager but rather passed
to the thermal hal, so it doesn't need sepolicy associated with it to
do so.

Test: manual: boot, inspect logs
Test: VtsHalThermalV1_1TargetTest
Bug: 109802374
Change-Id: Ifb727572bf8eebddc58deba6c0ce513008e01861
Merged-In: Ifb727572bf8eebddc58deba6c0ce513008e01861
---
 private/app_neverallows.te   | 1 -
 private/compat/27.0/27.0.cil | 1 +
 private/hwservice_contexts   | 1 -
 public/hwservice.te          | 1 -
 public/thermalserviced.te    | 1 -
 5 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/private/app_neverallows.te b/private/app_neverallows.te
index 5c4aa4093..640775520 100644
--- a/private/app_neverallows.te
+++ b/private/app_neverallows.te
@@ -231,7 +231,6 @@ neverallow all_untrusted_apps {
   hal_wifi_supplicant_hwservice
   hidl_base_hwservice
   system_net_netd_hwservice
-  thermalcallback_hwservice
 }:hwservice_manager find;
 # HwBinder services offered by core components (as opposed to vendor components)
 # are considered somewhat safer due to point #2 above.
diff --git a/private/compat/27.0/27.0.cil b/private/compat/27.0/27.0.cil
index 8eedf56a6..e3ca2d045 100644
--- a/private/compat/27.0/27.0.cil
+++ b/private/compat/27.0/27.0.cil
@@ -7,6 +7,7 @@
 (type rild)
 (type webview_zygote_socket)
 (type vold_socket)
+(type thermalcallback_hwservice)
 
 (expandtypeattribute (accessibility_service_27_0) true)
 (expandtypeattribute (account_service_27_0) true)
diff --git a/private/hwservice_contexts b/private/hwservice_contexts
index c75c0a576..7a90ad5e8 100644
--- a/private/hwservice_contexts
+++ b/private/hwservice_contexts
@@ -49,7 +49,6 @@ android.hardware.soundtrigger::ISoundTriggerHw                  u:object_r:hal_a
 android.hardware.tetheroffload.config::IOffloadConfig           u:object_r:hal_tetheroffload_hwservice:s0
 android.hardware.tetheroffload.control::IOffloadControl         u:object_r:hal_tetheroffload_hwservice:s0
 android.hardware.thermal::IThermal                              u:object_r:hal_thermal_hwservice:s0
-android.hardware.thermal::IThermalCallback                      u:object_r:thermalcallback_hwservice:s0
 android.hardware.tv.cec::IHdmiCec                               u:object_r:hal_tv_cec_hwservice:s0
 android.hardware.tv.input::ITvInput                             u:object_r:hal_tv_input_hwservice:s0
 android.hardware.usb::IUsb                                      u:object_r:hal_usb_hwservice:s0
diff --git a/public/hwservice.te b/public/hwservice.te
index 5fba86ac3..6f09efcfe 100644
--- a/public/hwservice.te
+++ b/public/hwservice.te
@@ -59,4 +59,3 @@ type hidl_memory_hwservice, hwservice_manager_type, coredomain_hwservice;
 type hidl_token_hwservice, hwservice_manager_type, coredomain_hwservice;
 type system_net_netd_hwservice, hwservice_manager_type, coredomain_hwservice;
 type system_wifi_keystore_hwservice, hwservice_manager_type, coredomain_hwservice;
-type thermalcallback_hwservice, hwservice_manager_type;
diff --git a/public/thermalserviced.te b/public/thermalserviced.te
index 00e007132..f47f544bb 100644
--- a/public/thermalserviced.te
+++ b/public/thermalserviced.te
@@ -8,6 +8,5 @@ add_service(thermalserviced, thermal_service)
 
 hwbinder_use(thermalserviced)
 hal_client_domain(thermalserviced, hal_thermal)
-add_hwservice(thermalserviced, thermalcallback_hwservice)
 
 binder_call(thermalserviced, platform_app)
-- 
GitLab