1syntax = "proto2"; 2 3option java_multiple_files = true; 4option java_package = "com.android.settings.fuelgauge.batteryusage"; 5option java_outer_classname = "PowerAnomalyEventProto"; 6 7message PowerAnomalyEventList { 8 repeated PowerAnomalyEvent power_anomaly_events = 1; 9} 10 11message PowerAnomalyEvent { 12 optional string event_id = 1; 13 optional int64 timestamp = 2; 14 optional PowerAnomalyType type = 3; 15 optional PowerAnomalyKey key = 4; 16 optional float score = 5; 17 oneof info { 18 WarningBannerInfo warning_banner_info = 6; 19 WarningItemInfo warning_item_info = 7; 20 } 21 optional string dismiss_record_key = 8; 22} 23 24// Next id: 2 25enum PowerAnomalyType{ 26 TYPE_SETTINGS_BANNER = 0; 27 TYPE_APPS_ITEM = 1; 28} 29 30// Next id: 8 31enum PowerAnomalyKey{ 32 KEY_BRIGHTNESS = 0; 33 KEY_SCREEN_TIMEOUT = 1; 34 KEY_APP_TOTAL_ALWAYS_HIGH = 2; 35 KEY_APP_TOTAL_HIGHER_THAN_USUAL = 3; 36 KEY_APP_BACKGROUND_ALWAYS_HIGH = 4; 37 KEY_APP_BACKGROUND_HIGHER_THAN_USUAL = 5; 38 KEY_APP_FOREGROUND_ALWAYS_HIGH = 6; 39 KEY_APP_FOREGROUND_HIGHER_THAN_USUAL = 7; 40} 41 42// Next id: 3 43enum DetectRequestSourceType{ 44 TYPE_UNKNOWN_SOURCE = 0; 45 TYPE_USAGE_UI = 1; 46 TYPE_DATA_LOADER = 2; 47} 48 49message WarningBannerInfo { 50 optional string title_string = 1; 51 optional string description_string = 2; 52 optional string main_button_string = 3; 53 // Used in the SubSettingLauncher.setDestination(). 54 optional string main_button_destination = 4; 55 // Used in the SubSettingLauncher.setSourceMetricsCategory(). 56 optional int32 main_button_source_metrics_category = 5; 57 // Used in the SubSettingLauncher.setArguments(). 58 optional string main_button_source_highlight_key = 6; 59 optional string cancel_button_string = 7; 60 optional string main_button_config_settings_name = 8; 61 optional int32 main_button_config_settings_value = 9; 62} 63 64message WarningItemInfo { 65 optional int64 start_timestamp = 1; 66 optional int64 end_timestamp = 2; 67 optional string top_card_string = 3; 68 optional string title_string = 4; 69 optional string description_string = 5; 70 optional string main_button_string = 6; 71 optional string cancel_button_string = 7; 72 optional string item_key = 8; 73 optional string warning_info_string = 9; 74 optional string anomaly_hint_pref_key = 10; 75} 76