Add CarPowerManager
- Add Java API for apps to call into power manager
- Update EmbeddedKitchenSink to test API
- Update CarPowrManagementService to handle binder interface
Bug: 32061842
Test: EmbeddedKitchenSink
Change-Id: I15f5c25262507d4a6d6e5f381643f3e584f1843e
diff --git a/car-lib/api/system-current.txt b/car-lib/api/system-current.txt
index d1f19c0..247d712 100644
--- a/car-lib/api/system-current.txt
+++ b/car-lib/api/system-current.txt
@@ -10,6 +10,7 @@
field public static final java.lang.String PERMISSION_CAR_DIAGNOSTIC_READ_ALL = "android.car.permission.DIAGNOSTIC_READ_ALL";
field public static final java.lang.String PERMISSION_CAR_DRIVING_STATE = "android.car.permission.CAR_DRIVING_STATE";
field public static final java.lang.String PERMISSION_CAR_HVAC = "android.car.permission.CAR_HVAC";
+ field public static final java.lang.String PERMISSION_CAR_POWER = "android.car.permission.CAR_POWER";
field public static final java.lang.String PERMISSION_CAR_PROJECTION = "android.car.permission.CAR_PROJECTION";
field public static final deprecated java.lang.String PERMISSION_CAR_RADIO = "android.car.permission.CAR_RADIO";
field public static final java.lang.String PERMISSION_CAR_TEST_SERVICE = "android.car.permission.CAR_TEST_SERVICE";
@@ -19,6 +20,7 @@
field public static final java.lang.String PERMISSION_VENDOR_EXTENSION = "android.car.permission.CAR_VENDOR_EXTENSION";
field public static final java.lang.String PERMISSION_VMS_PUBLISHER = "android.car.permission.VMS_PUBLISHER";
field public static final java.lang.String PERMISSION_VMS_SUBSCRIBER = "android.car.permission.VMS_SUBSCRIBER";
+ field public static final java.lang.String POWER_SERVICE = "power";
field public static final java.lang.String PROJECTION_SERVICE = "projection";
field public static final deprecated java.lang.String RADIO_SERVICE = "radio";
field public static final java.lang.String STORAGE_MONITORING_SERVICE = "storage_monitoring";
@@ -651,6 +653,26 @@
}
+package android.car.hardware.power {
+
+ public class CarPowerManager {
+ field public static final int BOOT_REASON_DOOR_OPEN = 4; // 0x4
+ field public static final int BOOT_REASON_DOOR_UNLOCK = 2; // 0x2
+ field public static final int BOOT_REASON_REMOTE_START = 5; // 0x5
+ field public static final int BOOT_REASON_TIMER = 3; // 0x3
+ field public static final int BOOT_REASON_USER_POWER_ON = 1; // 0x1
+ }
+
+ public static abstract interface CarPowerManager.CarPowerStateListener {
+ method public abstract void onStateChanged(int);
+ field public static final int SHUTDOWN_CANCELLED = 0; // 0x0
+ field public static final int SHUTDOWN_ENTER = 1; // 0x1
+ field public static final int SUSPEND_ENTER = 2; // 0x2
+ field public static final int SUSPEND_EXIT = 3; // 0x3
+ }
+
+}
+
package android.car.hardware.radio {
public deprecated class CarRadioEvent implements android.os.Parcelable {