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 android.os.statsd.display;
20
21import "frameworks/proto_logging/stats/atom_field_options.proto";
22import "frameworks/proto_logging/stats/enums/display/display_enums.proto";
23import "frameworks/proto_logging/stats/enums/view/enums.proto";
24import "frameworks/proto_logging/stats/enums/stats/mediametrics/mediametrics.proto";
25
26option java_package = "com.android.os.display";
27option java_multiple_files = true;
28
29/**
30 * Logs when the screen state changes on devices with multiple displays.
31 *
32 * Logged from:
33 *   frameworks/base/services/core/java/com/android/server/display/DisplayPowerController.java
34 *   frameworks/base/services/core/java/com/android/server/display/DisplayPowerController2.java
35 */
36message ScreenStateChangedV2 {
37    // New screen state, from frameworks/proto_logging/stats/enums/view/enums.proto.
38    optional android.view.DisplayStateEnum state = 1
39            [(state_field_option).exclusive_state = true, (state_field_option).nested = false];
40    optional int32 display_id = 2 [(state_field_option).primary_field = true];
41    optional android.view.DisplayStateReason reason = 3 [(state_field_option).primary_field = true];
42}
43
44/**
45 * Logs the HDR capabilities of a device:
46 * - The supported HDR conversion formats?
47 * - Has the user disabled the HDR conversion?
48 * - Has the user chosen to force convert to an HDR output format, and to which format?
49 * - Does the device have the 4k30Hz Dolby Vision issue?
50 * - Does the device support HDR output control?
51 *
52 * Logged from:
53 *   frameworks/base/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
54 */
55message HdrCapabilities {
56    message HdrOutputCapability {
57        optional int32 output_type = 2;
58        reserved 1, 3;
59    }
60
61    message HdrOutputCapabilities {
62        repeated HdrOutputCapability hdr_output_capabilities = 1;
63    }
64
65    // The HDR conversion capabilities of the device
66    optional HdrOutputCapabilities device_hdr_output_capabilities = 1 [(log_mode) = MODE_BYTES];
67    // Whether the user has disabled HDR conversion
68    optional bool has_user_disabled_hdr_conversion = 2;
69    // The format to which user chose to force HDR conversion.
70    optional android.stats.mediametrics.HdrFormat force_hdr_format = 3;
71    // Whether the device has 4k30 Hz Dolby Vision issue
72    optional bool has_4k30_dolby_vision_issue = 4;
73    // Whether the device supports HDR output control
74    optional bool device_supports_hdr_output_control = 5;
75}
76
77