Merge "Declare initial statsd atoms for HDMI-CEC"

This commit is contained in:
Yan Han
2020-09-18 09:54:17 +00:00
committed by Android (Google) Code Review
2 changed files with 187 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
import "frameworks/base/core/proto/android/os/enums.proto";
import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
import "frameworks/base/core/proto/android/server/enums.proto";
import "frameworks/base/core/proto/android/stats/hdmi/enums.proto";
import "frameworks/base/core/proto/android/server/job/enums.proto";
import "frameworks/base/core/proto/android/server/location/enums.proto";
import "frameworks/base/core/proto/android/service/procstats_enum.proto";
@@ -490,6 +491,8 @@ message Atom {
UIActionLatencyReported ui_action_latency_reported = 306 [(module) = "framework"];
WifiDisconnectReported wifi_disconnect_reported = 307 [(module) = "wifi"];
WifiConnectionStateChanged wifi_connection_state_changed = 308 [(module) = "wifi"];
HdmiCecActiveSourceChanged hdmi_cec_active_source_changed = 309 [(module) = "framework"];
HdmiCecMessageReported hdmi_cec_message_reported = 310 [(module) = "framework"];
// StatsdStats tracks platform atoms with ids upto 500.
// Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
@@ -11433,4 +11436,65 @@ message BlobInfo {
// List of leasees of this Blob
optional BlobLeaseeListProto leasees = 5 [(log_mode) = MODE_BYTES];
}
}
/**
* Logs when the HDMI CEC active source changes.
*
* Logged from:
* frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
*/
message HdmiCecActiveSourceChanged {
// The logical address of the active source.
optional android.stats.hdmi.LogicalAddress active_source_logical_address = 1;
// The physical address of the active source. Consists of four hexadecimal nibbles.
// Examples: 0x1234, 0x0000 (root device). 0xFFFF represents an unknown or invalid address.
// See section 8.7 in the HDMI 1.4b spec for details.
optional int32 active_source_physical_address = 2;
// The relationship between this device and the active source.
optional android.stats.hdmi.PathRelationship local_relationship = 3;
}
/**
* Logs when an HDMI CEC message is sent or received.
*
* Logged from:
* frameworks/base/services/core/java/com/android/server/hdmi/HdmiCecAtomWriter.java
*/
message HdmiCecMessageReported {
// The calling uid of the application that caused this atom to be written.
optional int32 uid = 1 [(is_uid) = true];
// Whether a HDMI CEC message is sent from this device, to this device, or neither.
optional android.stats.hdmi.MessageDirection direction = 2;
// The HDMI CEC logical address of the initiator.
optional android.stats.hdmi.LogicalAddress initiator_logical_address = 3;
// The HDMI CEC logical address of the destination.
optional android.stats.hdmi.LogicalAddress destination_logical_address = 4;
// The opcode of the message. Ranges from 0x00 to 0xFF.
// For all values, see section "CEC 15 Message Descriptions" in the HDMI CEC 1.4b spec.
optional int32 opcode = 5;
// The result of attempting to send the message on its final retransmission attempt.
// Only applicable to outgoing messages; set to SEND_MESSAGE_RESULT_UNKNOWN otherwise.
optional android.stats.hdmi.SendMessageResult send_message_result = 6;
// Fields specific to <User Control Pressed> messages
// The user control command that was received.
optional android.stats.hdmi.UserControlPressedCommand user_control_pressed_command = 7;
// Fields specific to <Feature Abort> messages
// The opcode of the message that was feature aborted.
// Set to 0x100 when unknown or not applicable.
optional int32 feature_abort_opcode = 8;
// The reason for the feature abort.
optional android.stats.hdmi.FeatureAbortReason feature_abort_reason = 9;
}

View File

@@ -0,0 +1,122 @@
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
package android.stats.hdmi;
option java_multiple_files = true;
option java_outer_classname = "HdmiStatsEnums";
// HDMI CEC logical addresses.
// Values correspond to "CEC Table 5 Logical Addresses" in the HDMI CEC 1.4b spec.
enum LogicalAddress {
LOGICAL_ADDRESS_UNKNOWN = -1;
TV = 0;
RECORDING_DEVICE_1 = 1;
RECORDING_DEVICE_2 = 2;
TUNER_1 = 3;
PLAYBACK_DEVICE_1 = 4;
AUDIO_SYSTEM = 5;
TUNER_2 = 6;
TUNER_3 = 7;
PLAYBACK_DEVICE_2 = 8;
RECORDING_DEVICE_3 = 9;
TUNER_4 = 10;
PLAYBACK_DEVICE_3 = 11;
RESERVED_1 = 12;
RESERVED_2 = 13;
SPECIFIC_USE = 14;
UNREGISTERED_OR_BROADCAST = 15;
}
// The relationship between two paths.
// Values correspond exactly to PathRelationship in com.android.server.hdmi.Constants.
enum PathRelationship {
RELATIONSHIP_TO_ACTIVE_SOURCE_UNKNOWN = 0;
DIFFERENT_BRANCH = 1;
ANCESTOR = 2;
DESCENDANT = 3;
SIBLING = 4;
SAME = 5;
}
// The result of attempting to send a HDMI CEC message.
// Values correspond to the constants in android.hardware.tv.cec.V1_0.SendMessageResult,
// offset by 10.
enum SendMessageResult {
SEND_MESSAGE_RESULT_UNKNOWN = 0;
SUCCESS = 10;
NACK = 11;
BUSY = 12;
FAIL = 13;
}
// Whether a HDMI CEC message is sent from this device, to this device, or neither.
enum MessageDirection {
MESSAGE_DIRECTION_UNKNOWN = 0;
MESSAGE_DIRECTION_OTHER = 1; // None of the other options.
OUTGOING = 2; // Sent from this device.
INCOMING = 3; // Sent to this device.
TO_SELF = 4; // Sent from this device, to this device. Indicates a bug.
}
// User control commands. Each value can represent an individual command, or a set of commands.
// Values correspond to "CEC Table 30 UI Command Codes" in the HDMI CEC 1.4b spec, offset by 0x100.
enum UserControlPressedCommand {
USER_CONTROL_PRESSED_COMMAND_UNKNOWN = 0;
// Represents all codes that are not represented by another value.
USER_CONTROL_PRESSED_COMMAND_OTHER = 1;
// Represents all number codes (codes 0x1E through 0x29).
NUMBER = 2;
// Navigation
SELECT = 0x100;
UP = 0x101;
DOWN = 0x102;
LEFT = 0x103;
RIGHT = 0x104;
RIGHT_UP = 0x105;
RIGHT_DOWN = 0x106;
LEFT_UP = 0x107;
LEFT_DOWN = 0x108;
EXIT = 0x10D;
// Volume
VOLUME_UP = 0x141;
VOLUME_DOWN = 0x142;
VOLUME_MUTE = 0x143;
// Power
POWER = 0x140;
POWER_TOGGLE = 0x16B;
POWER_OFF = 0x16C;
POWER_ON = 0x16D;
}
// Reason parameter of the <Feature Abort> message.
// Values correspond to "CEC Table 29 Operand Descriptions" in the HDMI CEC 1.4b spec,
// offset by 10.
enum FeatureAbortReason {
FEATURE_ABORT_REASON_UNKNOWN = 0;
UNRECOGNIZED_OPCODE = 10;
NOT_IN_CORRECT_MODE_TO_RESPOND = 11;
CANNOT_PROVIDE_SOURCE = 12;
INVALID_OPERAND = 13;
REFUSED = 14;
UNABLE_TO_DETERMINE = 15;
}