syntax = "proto2";

option java_multiple_files = true;
option java_package = "com.android.settings.fuelgauge.batteryusage";
option java_outer_classname = "BatteryUsageSlotProto";

message BatteryUsageSlot {
  optional int64 start_timestamp = 1;
  optional int64 end_timestamp = 2;
  optional int32 start_battery_level = 3;
  optional int32 end_battery_level = 4;
  optional int64 screen_on_time = 5;
  repeated BatteryUsageDiff app_usage = 6;
  repeated BatteryUsageDiff system_usage = 7;
}

enum BatteryOptimizationMode {
  MODE_UNKNOWN = 0;
  MODE_RESTRICTED = 1;
  MODE_UNRESTRICTED = 2;
  MODE_OPTIMIZED = 3;
}

message BatteryUsageDiff {
  optional int64 uid = 1;
  optional int64 user_id = 2;
  optional string package_name = 3;
  optional string label = 4;
  optional string key = 5;
  optional bool is_hidden = 6;
  optional int32 component_id = 7;
  optional int32 consumer_type = 8;
  optional double consume_power = 9;
  optional double foreground_usage_consume_power = 10;
  optional double background_usage_consume_power = 11;
  optional double foreground_service_usage_consume_power = 12;
  optional double cached_usage_consume_power = 13;
  optional int64 foreground_usage_time = 14;
  optional int64 background_usage_time = 15;
  optional int64 screen_on_time = 16;
  optional int64 foreground_service_usage_time = 17;
  optional BatteryOptimizationMode app_optimization_mode = 18;
  optional bool is_app_optimization_mode_mutable = 19;
}
