1/* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19package com.android.car.power; 20 21option java_multiple_files = true; 22 23message CarPowerDumpProto { 24 message CpmsStateProto { 25 optional bool can_postpone = 1; 26 optional int32 car_power_manager_state = 2; 27 optional int32 shutdown_type = 3; 28 optional int32 state = 4; 29 optional string state_name = 5; 30 } 31 optional CpmsStateProto current_state = 1; 32 optional int64 shutdown_start_time = 2; 33 optional int64 last_sleep_entry_time = 3; 34 optional int32 next_wakeup_sec = 4; 35 optional bool shutdown_on_next_suspend = 5; 36 optional string action_on_finish = 6; 37 optional int32 shutdown_polling_interval_ms = 7; 38 optional int32 shutdown_prepare_time_ms = 8; 39 optional bool reboot_after_garage_mode = 9; 40 optional bool switch_guest_user_before_sleep = 10; 41 optional string current_power_policy_id = 11; 42 optional string pending_power_policy_id = 12; 43 optional string current_power_policy_group_id = 13; 44 optional bool is_power_policy_locked = 14; 45 optional int64 max_suspend_wait_duration_ms = 15; 46 optional int32 max_suspend_wait_duration_config = 16; 47 optional string wifi_state_file = 17; 48 optional string tethering_state_file = 18; 49 optional bool wifi_adjustment_for_suspend = 19; 50 optional int32 power_policy_listeners = 20; 51 optional string factory_reset_callback = 21; 52 optional bool is_listener_waiting_cancelled = 22; 53 optional bool kernel_supports_deep_sleep = 23; 54 optional bool kernel_supports_hibernation = 24; 55 optional int32 last_shutdown_state = 25; 56 optional bool wake_from_simulated_sleep = 26; 57 optional bool in_simulated_deep_sleep_mode = 27; 58 optional int32 resume_delay_from_simulated_suspend_sec = 28; 59 optional bool free_memory_before_suspend = 29; 60 61 message PolicyReaderProto { 62 message ComponentNameToValue { 63 optional string component_name = 1; 64 optional int32 component_value = 2; 65 } 66 message PowerPolicy { 67 optional string policy_id = 1; 68 repeated string enabled_components = 2; 69 repeated string disabled_components = 3; 70 } 71 message IdToPolicyGroup { 72 message PolicyGroup { 73 message StateToDefaultPolicy { 74 optional string state = 1; 75 optional string default_policy_id = 2; 76 } 77 repeated StateToDefaultPolicy default_policy_mappings = 1; 78 } 79 optional string policy_group_id = 1; 80 optional PolicyGroup policy_group = 2; 81 } 82 repeated ComponentNameToValue custom_component_mappings = 6; 83 repeated PowerPolicy registered_power_policies = 7; 84 repeated IdToPolicyGroup power_policy_group_mappings = 8; 85 repeated PowerPolicy preemptive_power_policies = 9; 86 } 87 88 message PowerComponentHandlerProto { 89 message PowerComponentToState { 90 optional string power_component = 1; 91 optional bool state = 2; 92 } 93 repeated PowerComponentToState power_component_state_mappings = 1; 94 repeated string components_off_by_policy = 2; 95 optional string last_modified_components = 3; 96 } 97 98 message SilentModeHandlerProto { 99 optional string hw_state_monitoring_file_name = 1; 100 optional string kernel_silent_mode_file_name = 2; 101 optional bool is_monitoring_hw_state_signal = 3; 102 optional bool silent_mode_by_hw_state = 4; 103 optional bool forced_silent_mode = 5; 104 optional bool is_silent_mode_supported = 6; 105 } 106 107 message ScreenOffHandlerProto { 108 message DisplayPowerInfoProto { 109 optional int32 display_id = 1; 110 optional int32 user_id = 2; 111 optional int32 mode = 3; 112 optional bool is_driver_display = 4; 113 optional int64 last_user_activity_time = 5; 114 } 115 optional bool is_auto_power_saving = 11; 116 optional bool boot_completed = 12; 117 optional int32 no_user_screen_off_timeout_ms = 13; 118 repeated DisplayPowerInfoProto display_power_infos = 14; 119 } 120 121 optional PolicyReaderProto policy_reader = 30; 122 optional PowerComponentHandlerProto power_component_handler = 31; 123 optional SilentModeHandlerProto silent_mode_handler = 32; 124 optional ScreenOffHandlerProto screen_off_handler = 33; 125} 126