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 = "proto3"; 18 19package com.android.devicediagnostics; 20option java_outer_classname = "Protos"; 21 22// When updating this file, update DeviceReportJsonFormatter.kt as well. 23 24message TestResults { 25 optional bool screen_test = 1; 26 optional bool touch_test = 2; 27} 28 29message BatteryInfo { 30 reserved 2, 3; 31 optional int32 cycle_count = 1; 32 optional int32 state_of_health = 4; 33 optional string serial = 5; 34 optional string part_status = 6; 35 int32 legacy_health = 7; 36 optional int64 manufacture_timestamp = 8; 37 optional int64 first_usage_timestamp = 9; 38} 39 40message LockInfo { bool factory_reset_protection = 1; } 41 42message StorageInfo { 43 reserved 1, 2; 44 optional int32 useful_lifetime_remaining = 3; 45 int64 capacity_bytes = 4; 46} 47 48message HingeInfo { 49 optional int32 hinge_count = 1; 50 repeated int32 num_times_folded = 2; 51 repeated int32 expected_lifespan = 3; 52} 53 54message TrustedDeviceInfo { bytes challenge = 1; } 55 56message DeviceReport { 57 TestResults tests = 1; 58 bytes old_attestation = 2; 59 BatteryInfo battery = 3; 60 StorageInfo storage = 4; 61 optional int32 launch_level = 5; 62 LockInfo locks = 6; 63 ProductInfo product = 7; 64 HingeInfo hinge = 8; 65 optional AttestationInfo attestation = 9; 66} 67 68enum PacketCommand { 69 COMMAND_ACK = 0; 70 COMMAND_CLOSE = 1; 71}; 72 73message BluetoothPacket { 74 int32 version = 1; 75 oneof payload { 76 TrustedDeviceInfo trusted_device_info = 2; 77 DeviceReport device_report = 3; 78 PacketCommand command = 4; 79 } 80} 81 82message ProductInfo { 83 optional string brand = 1; 84 optional string device = 2; 85 optional string manufacturer = 3; 86 optional string model = 4; 87 optional string name = 5; 88} 89 90message AttestationInfo { 91 bytes certificates = 1; 92 string error = 2; 93} 94