Merge "Check dev-keystore to sign widevine apex" into main
diff --git a/battery_mitigation/battery_mitigation.cpp b/battery_mitigation/battery_mitigation.cpp
index 101be13..cb33205 100644
--- a/battery_mitigation/battery_mitigation.cpp
+++ b/battery_mitigation/battery_mitigation.cpp
@@ -83,10 +83,17 @@
         {"voltage_now", "/sys/class/power_supply/battery/voltage_now"},
         {"current_now", "/sys/class/power_supply/battery/current_now"},
     },
-    .NumericSysfsStatDirs = {
-        {"last_triggered_mode", "/sys/devices/virtual/pmic/mitigation/last_triggered_mode/"},
-    },
     .TriggeredIdxPath = "/sys/devices/virtual/pmic/mitigation/br_stats/triggered_idx",
+    .triggeredStatePath[android::hardware::google::pixel::UVLO1] =
+        "/sys/devices/virtual/pmic/mitigation/triggered_state/uvlo1_triggered",
+    .triggeredStatePath[android::hardware::google::pixel::UVLO2] =
+        "/sys/devices/virtual/pmic/mitigation/triggered_state/uvlo2_triggered",
+    .triggeredStatePath[android::hardware::google::pixel::OILO1] =
+        "/sys/devices/virtual/pmic/mitigation/triggered_state/oilo1_triggered",
+    .triggeredStatePath[android::hardware::google::pixel::OILO2] =
+        "/sys/devices/virtual/pmic/mitigation/triggered_state/oilo2_triggered",
+    .triggeredStatePath[android::hardware::google::pixel::SMPL] =
+        "/sys/devices/virtual/pmic/mitigation/triggered_state/smpl_triggered",
     .BrownoutStatsPath = "/sys/devices/virtual/pmic/mitigation/br_stats/stats",
     .StoringPath = "/data/vendor/mitigation/thismeal.bin",
     .ParsedThismealPath = "/data/vendor/mitigation/thismeal.txt",
@@ -112,27 +119,19 @@
                 {
                     .MainPmicName = "s2mpg10-odpm\n",
                     .SubPmicName = "s2mpg11-odpm\n",
-                    .PcieModemPath = "/sys/devices/platform/11920000.pcie/power_stats",
-                    .PcieWifiPath = "/sys/devices/platform/14520000.pcie/power_stats",
                 },
                 {
                     .MainPmicName = "s2mpg12-odpm\n",
                     .SubPmicName = "s2mpg13-odpm\n",
-                    .PcieModemPath = "/sys/devices/platform/11920000.pcie/power_stats",
-                    .PcieWifiPath = "/sys/devices/platform/14520000.pcie/power_stats",
                 },
                 {
                     .MainPmicName = "s2mpg14-odpm\n",
                     .SubPmicName = "s2mpg15-odpm\n",
-                    .PcieModemPath = "/sys/devices/platform/12100000.pcie/power_stats",
-                    .PcieWifiPath = "/sys/devices/platform/13120000.pcie/power_stats",
                 },
                 /* MAX_SUPPORTED_PLATFORM */
                 {
                     .MainPmicName = "s2mpg14-odpm\n",
                     .SubPmicName = "s2mpg15-odpm\n",
-                    .PcieModemPath = "/sys/devices/platform/12100000.pcie/power_stats",
-                    .PcieWifiPath = "/sys/devices/platform/13120000.pcie/power_stats",
                 },
 
     },
@@ -188,8 +187,6 @@
             batteryMitigationService->genLastmealCSV(eventThreadCfg.ParsedLastmealCSVPath)) {
             android::base::SetProperty(kLastMealProperty, "1");
         }
-        /* Start BrownoutEventThread to poll brownout event from kernel */
-        batteryMitigationService->startBrownoutEventThread();
     } else{
         bmSp = new BatteryMitigation(cfg);
         if (!bmSp) {
@@ -226,6 +223,10 @@
     if (isBatteryMitigationReady) {
         android::base::SetProperty(kReadyProperty, "1");
     }
+    if (isBatteryMitigationReady && brownoutStatsBinarySupported) {
+        /* Start BrownoutEventThread to poll brownout event from kernel */
+        batteryMitigationService->startBrownoutEventThread();
+    }
     while (true) {
         pause();
     }
diff --git a/camera/sepolicy/product/private/service_contexts b/camera/sepolicy/product/private/service_contexts
new file mode 100644
index 0000000..fed03af
--- /dev/null
+++ b/camera/sepolicy/product/private/service_contexts
@@ -0,0 +1 @@
+com.google.pixel.camera.services.binder.IServiceBinder/default u:object_r:camera_binder_service:s0
\ No newline at end of file
diff --git a/camera/sepolicy/product/private/vendor_pbcs_app.te b/camera/sepolicy/product/private/vendor_pbcs_app.te
index d77162e..54bc0c0 100644
--- a/camera/sepolicy/product/private/vendor_pbcs_app.te
+++ b/camera/sepolicy/product/private/vendor_pbcs_app.te
@@ -7,3 +7,6 @@
 allow vendor_pbcs_app app_api_service:service_manager find;
 # Allow PBCS to find Camera Service.
 allow vendor_pbcs_app cameraserver_service:service_manager find;
+
+# Allow PBCS to add the ServiceBinder service to ServiceManager.
+add_service(vendor_pbcs_app, camera_binder_service);
\ No newline at end of file
diff --git a/camera/sepolicy/product/public/service.te b/camera/sepolicy/product/public/service.te
new file mode 100644
index 0000000..f94fd9f
--- /dev/null
+++ b/camera/sepolicy/product/public/service.te
@@ -0,0 +1 @@
+type camera_binder_service, hal_service_type, protected_service, service_manager_type;
\ No newline at end of file
diff --git a/camera/sepolicy/vendor/hal_camera_default.te b/camera/sepolicy/vendor/hal_camera_default.te
index dd00cc3..4c9aa05 100644
--- a/camera/sepolicy/vendor/hal_camera_default.te
+++ b/camera/sepolicy/vendor/hal_camera_default.te
@@ -1,4 +1,4 @@
-allow hal_camera_default vendor_camera_binder_service:service_manager find;
+allow hal_camera_default camera_binder_service:service_manager find;
 # Allow Lyric Hal to find the LyricConfigProvider service through ServiceManager.
 allow hal_camera_default vendor_camera_lyricconfigprovider_service:service_manager find;
 
diff --git a/camera/sepolicy/vendor/service.te b/camera/sepolicy/vendor/service.te
index 877dbc1..87a1d93 100644
--- a/camera/sepolicy/vendor/service.te
+++ b/camera/sepolicy/vendor/service.te
@@ -1,5 +1,3 @@
-type vendor_camera_binder_service, hal_service_type, protected_service, service_manager_type;
-
 type hal_pixel_remote_camera_service, hal_service_type, protected_service, service_manager_type;
 
 type vendor_camera_lyricconfigprovider_service, hal_service_type, protected_service, service_manager_type;
diff --git a/camera/sepolicy/vendor/service_contexts b/camera/sepolicy/vendor/service_contexts
index e6eaa64..1bcaab8 100644
--- a/camera/sepolicy/vendor/service_contexts
+++ b/camera/sepolicy/vendor/service_contexts
@@ -1,5 +1,3 @@
-com.google.pixel.camera.services.binder.IServiceBinder/default u:object_r:vendor_camera_binder_service:s0
-
 com.google.pixel.camera.connectivity.hal.provider.ICameraProvider/default u:object_r:hal_pixel_remote_camera_service:s0
 
 com.google.pixel.camera.services.lyricconfigprovider.ILyricConfigProvider/default u:object_r:vendor_camera_lyricconfigprovider_service:s0
diff --git a/camera/sepolicy/vendor/vendor_pbcs_app.te b/camera/sepolicy/vendor/vendor_pbcs_app.te
index 7b9c5e2..b25c9a2 100644
--- a/camera/sepolicy/vendor/vendor_pbcs_app.te
+++ b/camera/sepolicy/vendor/vendor_pbcs_app.te
@@ -1,5 +1,5 @@
 # Allow PBCS to add the ServiceBinder service to ServiceManager.
-add_service(vendor_pbcs_app, vendor_camera_binder_service);
+add_service(vendor_pbcs_app, camera_binder_service);
 # Allow PBCS to add the LyricConfigProvider service to ServiceManager.
 add_service(vendor_pbcs_app, vendor_camera_lyricconfigprovider_service);
 # Allow PBCS to add the CameraIdRemapper service to ServiceManager.
diff --git a/gyotaku_app/sepolicy/gyotaku_app.te b/gyotaku_app/sepolicy/gyotaku_app.te
index 80123cf..867ec4c 100644
--- a/gyotaku_app/sepolicy/gyotaku_app.te
+++ b/gyotaku_app/sepolicy/gyotaku_app.te
@@ -22,4 +22,7 @@
 
   # For persistent property use
   get_prop(gyotaku_app, logpersistd_logging_prop);
+
+  # For access hal_power_stats
+  hal_client_domain(gyotaku_app, hal_power_stats);
 ')
diff --git a/wireless_charger/compatibility_matrix.xml b/wireless_charger/compatibility_matrix.xml
index 85ee65a..7d18cd9 100644
--- a/wireless_charger/compatibility_matrix.xml
+++ b/wireless_charger/compatibility_matrix.xml
@@ -1,7 +1,7 @@
 <compatibility-matrix version="1.0" type="framework">
     <hal format="aidl" optional="true">
         <name>vendor.google.wireless_charger</name>
-        <version>1</version>
+        <version>1-2</version>
         <interface>
             <name>IWirelessCharger</name>
             <instance>default</instance>