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// NOTE: Please DO NOT delete enum items or change enum values. Use [deprecated = true] instead. 25// The enum value will be used to decide the tips card style like icons and colors. 26// 27// Next id: 2 28enum PowerAnomalyType{ 29 TYPE_SETTINGS_BANNER = 0; 30 TYPE_APPS_ITEM = 1; 31} 32 33// NOTE: Please DO NOT delete enum items or change enum values. Use [deprecated = true] instead. 34// The enum value will be used to decide pre-defined title and button labels. 35// 36// Next id: 8 37enum PowerAnomalyKey{ 38 KEY_BRIGHTNESS = 0; 39 KEY_SCREEN_TIMEOUT = 1; 40 KEY_APP_TOTAL_ALWAYS_HIGH = 2; 41 KEY_APP_TOTAL_HIGHER_THAN_USUAL = 3; 42 KEY_APP_BACKGROUND_ALWAYS_HIGH = 4; 43 KEY_APP_BACKGROUND_HIGHER_THAN_USUAL = 5; 44 KEY_APP_FOREGROUND_ALWAYS_HIGH = 6; 45 KEY_APP_FOREGROUND_HIGHER_THAN_USUAL = 7; 46} 47 48message WarningBannerInfo { 49 optional string title_string = 1; 50 optional string description_string = 2; 51 optional string main_button_string = 3; 52 // Used in the SubSettingLauncher.setDestination(). 53 optional string main_button_destination = 4; 54 // Used in the SubSettingLauncher.setSourceMetricsCategory(). 55 optional int32 main_button_source_metrics_category = 5; 56 // Used in the SubSettingLauncher.setArguments(). 57 optional string main_button_source_highlight_key = 6; 58 optional string cancel_button_string = 7; 59} 60 61message WarningItemInfo { 62 optional int64 start_timestamp = 1; 63 optional int64 end_timestamp = 2; 64 optional string top_card_string = 3; 65 optional string title_string = 4; 66 optional string description_string = 5; 67 optional string main_button_string = 6; 68 optional string cancel_button_string = 7; 69 optional string item_key = 8; 70} 71