车载android 电源管理 车载音响电源管理器_definitely的技术博客_51CTO博客
03-06 13:49:51.577036 1792 1792 I wm_on_top_resumed_gained_called: [42747891,com.android.car.settings.FallbackHome,topWhenResuming]
--------- switch to system
03-06 13:49:51.577063 1691 1747 D ICarImpl: initBootUser():
--------- switch to events
03-06 13:49:51.577219 1691 1747 I car_service_on_user_lifecycle: [1,-10000,0]
--------- switch to system
03-06 13:49:51.577448 1691 2012 I CAR.POWER: Received AP_POWER_STATE_REQ=ON(0) param=0
--------- switch to events
03-06 13:49:51.577581 1691 2012 I car_pwr_mgr_state_req: [0,0]
--------- switch to system
02-29 12:42:01.854359 1697 1982 I CAR.POWER: Received AP_POWER_STATE_REQ=ABANDONED(10) param=0
--------- switch to events
02-29 12:42:01.854502 1697 1982 I car_pwr_mgr_state_req: [10,0]
packages/services/Car/service/src/com/android/car/hal/PowerHalService.java
hardware/interfaces/automotive/vehicle/2.0/types.hal
/**
* Property to control power state of application processor
*
* It is assumed that AP's power state is controlled by a separate power
* controller.
*
* For configuration information, VehiclePropConfig.configArray can have bit flag combining
* values in VehicleApPowerStateConfigFlag.
*
* int32Values[0] : VehicleApPowerStateReq enum value
* int32Values[1] : additional parameter relevant for each state,
* 0 if not used.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
AP_POWER_STATE_REQ = (
0x0A00
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
enum VehicleApPowerStateReq : int32_t {
/**
* This requests Android to enter its normal operating state.
* This may be sent after the AP has reported
* VehicleApPowerStateReport#DEEP_SLEEP_EXIT,
* VehicleApPowerStateReport#SHUTDOWN_CANCELLED, or
* VehicleApPowerStateReport#WAIT_FOR_VHAL.
*/
ON = 0,
/**
* The power controller issues this request to shutdown the system.
* This may be sent after the AP has reported
* VehicleApPowerStateReport#DEEP_SLEEP_EXIT,
* VehicleApPowerStateReport#ON,
* VehicleApPowerStateReport#SHUTDOWN_CANCELLED,
* VehicleApPowerStateReport#SHUTDOWN_POSTPONE,
* VehicleApPowerStateReport#SHUTDOWN_PREPARE, or
* VehicleApPowerStateReport#WAIT_FOR_VHAL.
*
* int32Values[1] : One of VehicleApPowerStateShutdownParam.
* This parameter indicates if the AP should shut
* down fully or sleep. This parameter also
* indicates if the shutdown should be immediate
* or if it can be postponed. If the shutdown can
* be postponed, AP requests postponing by sending
* VehicleApPowerStateReport#SHUTDOWN_POSTPONE.
*/
SHUTDOWN_PREPARE = 1,
/**
* Cancel the shutdown.
* This may be sent after the AP has reported
* VehicleApPowerStateReport#SHUTDOWN_POSTPONE or
* VehicleApPowerStateReport#SHUTDOWN_PREPARE.
* After receiving this request, the AP will report
* VehicleApPowerStateReport#WAIT_FOR_VHAL in preparation to going ON.
*/
CANCEL_SHUTDOWN = 2,
/**
* Completes the shutdown process.
* This may be sent after the AP has reported
* VehicleApPowerStateReport#DEEP_SLEEP_ENTRY or
* VehicleApPowerStateReport#SHUTDOWN_START. The AP will not report new
* state information after receiving this request.
*/
FINISHED = 3,
STANDBY = 4,
SCREEN_SAVER = 5,
TEMPORARY_WORKING = 6,
REMOTE_BOOT = 7,
OVER_VOLTAGE = 8,
LOW_VOLTAGE = 9,
ABANDONED = 0xa,
PLAYING_BOOTANIMATION = 11,
OTA = 0xc,
};
/**
* Property to report power state of application processor
*
* It is assumed that AP's power state is controller by separate power
* controller.
*
* int32Values[0] : VehicleApPowerStateReport enum value
* int32Values[1] : Time in ms to wake up, if necessary. Otherwise 0.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
AP_POWER_STATE_REPORT = (
0x0A01
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32_VEC
| VehicleArea:GLOBAL),
enum VehicleApPowerStateReport : int32_t {
/**
* The device has booted. CarService has initialized and is ready to accept commands
* from VHAL. The user is not logged in, and vendor apps and services are expected to
* control the display and audio.
* After reporting this state, AP will accept VehicleApPowerStateReq#ON or
* VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored.
*/
WAIT_FOR_VHAL = 0x1,
/**
* AP is ready to suspend.
* The AP will not send any more state reports after this.
* After reporting this state, AP will accept VehicleApPowerStateReq#FINISHED.
* Other power state requests are ignored.
*
* int32Values[1]: Time to turn AP back on, in seconds. Power controller should turn on
* AP after the specified time has elapsed, so AP can run tasks like
* update. If this value is 0, no wake up is requested. The power
* controller may not necessarily support timed wake-up.
*/
DEEP_SLEEP_ENTRY = 0x2,
/**
* AP is exiting from deep sleep state.
* After reporting this state, AP will accept VehicleApPowerStateReq#ON or
* VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored.
*/
DEEP_SLEEP_EXIT = 0x3,
/**
* AP sends this message repeatedly while cleanup and idle tasks execute.
* After reporting this state, AP will accept VehicleApPowerStateReq#SHUTDOWN_PREPARE
* requesting immediate shutdown or VehicleApPowerStateReq#CANCEL_SHUTDOWN. Other
* power state requests are ignored.
*
* int32Values[1]: Time to postpone shutdown in ms. Maximum value is
* 5000 ms.
* If AP needs more time, it will send another SHUTDOWN_POSTPONE
* message before the previous one expires.
*/
SHUTDOWN_POSTPONE = 0x4,
/**
* AP is ready to shutdown.
* The AP will not send any more state reports after this.
* After reporting this state, AP will accept VehicleApPowerStateReq#FINISHED.
* Other power state requests are ignored.
*
* int32Values[1]: Time to turn AP back on, in seconds. Power controller should turn on
* AP after the specified time has elapsed so AP can run tasks like
* update. If this value is 0, no wake up is specified. The power
* controller may not necessarily support timed wake-up.
*/
SHUTDOWN_START = 0x5,
/**
* AP is entering its normal operating state.
* After reporting this state, AP will accept VehicleApPowerStateReq#SHUTDOWN_PREPARE.
* Other power state requests are ignored.
*/
ON = 0x6,
/**
* AP is preparing to shut down. In this state, Garage Mode is active and idle
* tasks are allowed to run.
* After reporting this state, AP will accept VehicleApPowerStateReq#SHUTDOWN_PREPARE
* requesting immediate shutdown or VehicleApPowerStateReq#CANCEL_SHUTDOWN. Other
* power state requests are ignored.
*/
SHUTDOWN_PREPARE = 0x7,
/**
* AP has stopped preparing to shut down.
* After reporting this state, AP will accept VehicleApPowerStateReq#ON or
* VehicleApPowerStateReq#SHUTDOWN_PREPARE. Other power state requests are ignored.
*/
SHUTDOWN_CANCELLED = 0x8,
/**
* AP now is over voltage mode, notify to disable usb
*/
OVER_VOLTAGE = 0x9,
/**
* AP now is normal mode(such as ON、STANDBY、SCREENSAVER、REMOTE_BOOT、TEMPORARY_WORKING),
* notify to enable usb
*/
NORMAL = 0xa,
};
/**
* Property to report bootup reason for the current power on. This is a
* static property that will not change for the whole duration until power
* off. For example, even if user presses power on button after automatic
* power on with door unlock, bootup reason must stay with
* VehicleApPowerBootupReason#USER_UNLOCK.
*
* int32Values[0] must be VehicleApPowerBootupReason.
*
* @change_mode VehiclePropertyChangeMode:STATIC
* @access VehiclePropertyAccess:READ
*/
AP_POWER_BOOTUP_REASON = (
0x0A02
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:INT32
| VehicleArea:GLOBAL),
dumpsys car_service get-power-state