wifi_sniffer: add tcpdump related sepolicy am: 128a674db9 am: 6b2fcd9071 am: 552833c2b3

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/pixel-sepolicy/+/19086048

Change-Id: I45b6956e296195b16e21865c12a2f8ff2a41fe50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/googlebattery/dumpstate.te b/googlebattery/dumpstate.te
new file mode 100644
index 0000000..b84095c
--- /dev/null
+++ b/googlebattery/dumpstate.te
@@ -0,0 +1,6 @@
+userdebug_or_eng(`
+    # To find and bind Google Battery HAL
+    allow dumpstate hal_googlebattery_service:service_manager find;
+    binder_call(dumpstate, hal_googlebattery)
+')
+
diff --git a/googlebattery/file_contexts b/googlebattery/file_contexts
index 9e247bb..efd6cc5 100644
--- a/googlebattery/file_contexts
+++ b/googlebattery/file_contexts
@@ -1 +1 @@
-/vendor/bin/hw/vendor\.google\.google_battery@1\.2-service-vendor                     u:object_r:hal_googlebattery_exec:s0
+/vendor/bin/hw/vendor\.google\.google_battery-service                     u:object_r:hal_googlebattery_exec:s0
diff --git a/googlebattery/hal_googlebattery.te b/googlebattery/hal_googlebattery.te
index cd1253b..7c6ccf8 100644
--- a/googlebattery/hal_googlebattery.te
+++ b/googlebattery/hal_googlebattery.te
@@ -13,6 +13,5 @@
 
 set_prop(hal_googlebattery, vendor_battery_defender_prop)
 
-hwbinder_use(hal_googlebattery)
-add_hwservice(hal_googlebattery, hal_googlebattery_hwservice)
-get_prop(hal_googlebattery, hwservicemanager_prop)
+binder_call(hal_googlebattery, servicemanager)
+add_service(hal_googlebattery, hal_googlebattery_service)
diff --git a/googlebattery/hwservice.te b/googlebattery/hwservice.te
deleted file mode 100644
index 40323ef..0000000
--- a/googlebattery/hwservice.te
+++ /dev/null
@@ -1 +0,0 @@
-type hal_googlebattery_hwservice, hwservice_manager_type;
diff --git a/googlebattery/hwservice_contexts b/googlebattery/hwservice_contexts
deleted file mode 100644
index 40f1526..0000000
--- a/googlebattery/hwservice_contexts
+++ /dev/null
@@ -1 +0,0 @@
-vendor.google.google_battery::IGoogleBattery                    u:object_r:hal_googlebattery_hwservice:s0
diff --git a/googlebattery/platform_app.te b/googlebattery/platform_app.te
index 0ee586f..39d4e5e 100644
--- a/googlebattery/platform_app.te
+++ b/googlebattery/platform_app.te
@@ -1,3 +1,3 @@
 # allow SystemUI to find and bind Google Battery HAL
-allow platform_app hal_googlebattery_hwservice:hwservice_manager find;
+allow platform_app hal_googlebattery_service:service_manager find;
 binder_call(platform_app, hal_googlebattery)
diff --git a/googlebattery/service.te b/googlebattery/service.te
new file mode 100644
index 0000000..c363681
--- /dev/null
+++ b/googlebattery/service.te
@@ -0,0 +1 @@
+type hal_googlebattery_service, vendor_service, service_manager_type;
diff --git a/googlebattery/service_contexts b/googlebattery/service_contexts
new file mode 100644
index 0000000..93954c7
--- /dev/null
+++ b/googlebattery/service_contexts
@@ -0,0 +1 @@
+vendor.google.google_battery.IGoogleBattery/default                      u:object_r:hal_googlebattery_service:s0
diff --git a/googlebattery/system_app.te b/googlebattery/system_app.te
index 05723bf..7854a1d 100644
--- a/googlebattery/system_app.te
+++ b/googlebattery/system_app.te
@@ -1,3 +1,3 @@
 # To allow Settings to find and bind Google Battery HAL
-allow system_app hal_googlebattery_hwservice:hwservice_manager find;
+allow system_app hal_googlebattery_service:service_manager find;
 binder_call(system_app, hal_googlebattery)
diff --git a/googlebattery/tracking_denial/bug_map b/googlebattery/tracking_denial/bug_map
new file mode 100644
index 0000000..968af65
--- /dev/null
+++ b/googlebattery/tracking_denial/bug_map
@@ -0,0 +1 @@
+hal_googlebattery dumpstate fd b/237491814
diff --git a/googlebattery/tracking_denial/hal_googlebattery.te b/googlebattery/tracking_denial/hal_googlebattery.te
new file mode 100644
index 0000000..da7f8c6
--- /dev/null
+++ b/googlebattery/tracking_denial/hal_googlebattery.te
@@ -0,0 +1,2 @@
+# b/237491814
+dontaudit hal_googlebattery dumpstate:fd { use };
diff --git a/googlebattery/turbo_adapter.te b/googlebattery/turbo_adapter.te
index 33f99cd..2794fd1 100644
--- a/googlebattery/turbo_adapter.te
+++ b/googlebattery/turbo_adapter.te
@@ -1,3 +1,3 @@
 # To find and bind Google Battery HAL
-allow turbo_adapter hal_googlebattery_hwservice:hwservice_manager find;
+allow turbo_adapter hal_googlebattery_service:service_manager find;
 binder_call(turbo_adapter, hal_googlebattery)