adds disconnection error code

PiperOrigin-RevId: 744896066
This commit is contained in:
hai007
2025-04-07 16:48:25 -07:00
committed by Copybara-Service
parent 035407ed04
commit a937710422
2 changed files with 112 additions and 5 deletions
+59 -5
View File
@@ -57,6 +57,13 @@ message ConnectionsLog {
// Encapsulates one session of a client connected to Nearby Connections API.
message ClientSession {
enum DeviceType {
UNKNOWN_TYPE = 0;
NEARBY_CONNECTION = 1;
NEARBY_PRESENCE = 2;
DCT = 3;
}
// Elapsed time in milliseconds between Client connect and
// disconnect.
optional int64 duration_millis = 1;
@@ -70,6 +77,9 @@ message ConnectionsLog {
// All the connection tokens used in this client session.
optional string connection_token = 4
/* type = ST_SESSION_ID */;
// The type of the device.
optional DeviceType device_type = 5;
}
message OperationResult {
@@ -321,8 +331,52 @@ message ConnectionsLog {
10;
}
message DctDeviceInfo {
enum Platform {
UNKNOWN = 0;
ANDROID = 1;
IOS = 2;
CROS = 3;
WINDOWS = 4;
}
optional string device_model = 1;
optional Platform device_platform = 2;
optional string country_code = 3;
optional string manufacturer = 4;
}
message DctDisconnectionReasonDetail {
enum DctDisconnectionReason {
UNKNOWN_DISCONNECTION_REASON = 0;
DCT_ERROR_MDNS_DISCOVERY_TIMEOUT = 1;
DCT_ERROR_MDNS_REGISTER_SERVICE = 2;
DCT_ERROR_SUBSEQUENT_TLS_SPAKE = 3;
DCT_ERROR_REQUEST_FAILED = 4;
DCT_ERROR_RESPONSE_FAILED = 5;
DCT_ERROR_CONTROL_MESSAGE_EXCHANGE = 6;
DCT_ERROR_CAPABILITY_MISMATCH = 7;
DCT_ERROR_HIGH_SPEED_MEDIUM_UNAVAILABLE = 8;
DCT_ERROR_WIFI_DISABLED = 9;
DCT_ERROR_WIFI_DISCONNECTED = 10;
DCT_ERROR_WIFI_CREDENTIAL_TRANSFER = 11;
DCT_ERROR_WIFI_INTERNET_CONNECTION = 12;
DCT_ERROR_UPGRADE_HIGH_SPEED_MEDIUM_FAILED = 13;
DCT_ERROR_USER_CANCELLED = 14;
DCT_ERROR_SERVICE_CANCELLED = 15;
DCT_ERROR_UNVERIFIED_INTEGRITY = 16;
}
optional bool is_local_disconnection = 1;
optional DctDisconnectionReason disconnection_reason = 2;
}
// A successfully-established connection over a particular medium.
message EstablishedConnection {
enum SafeDisconnectionResult {
UNKNOWN_SAFE_DISCONNECTION_RESULT = 0;
SAFE_DISCONNECTION = 1;
UNSAFE_DISCONNECTION = 2;
}
// Elapsed time in milliseconds that the connection is active.
optional int64 duration_millis = 1;
@@ -355,11 +409,11 @@ message ConnectionsLog {
// The result code of this established connection
optional OperationResult operation_result = 10;
enum SafeDisconnectionResult {
UNKNOWN_SAFE_DISCONNECTION_RESULT = 0;
SAFE_DISCONNECTION = 1;
UNSAFE_DISCONNECTION = 2;
}
// The DCT remote device info
optional DctDeviceInfo dct_remote_device_info = 11;
// DCT disconnection reason details
optional DctDisconnectionReasonDetail dct_disconnection_reason_detail = 12;
}
// A Payload transferred (or attempted to be transferred) between devices.
+53
View File
@@ -477,6 +477,7 @@ enum OperationResultCategory {
CATEGORY_CONNECTIVITY_ERROR = 7;
CATEGORY_MISCELLANEOUS = 8;
CATEGORY_IO_ERROR = 9;
CATEGORY_DCT_ERROR = 10;
}
// This enum is not used to determine success rate, but for devs to understand
@@ -1266,6 +1267,58 @@ enum OperationResultCode {
NEARBY_REMOTE_EXCEPTION_WHEN_PROCESSING_RECEIVED_PAYLOAD = 4608;
// Bad file description when processing received payload
NEARBY_BAD_FILE_DESCRIPTION_WHEN_PROCESSING_RECEIVED_PAYLOAD = 4609;
// Section of CATEGORY_DCT_ERROR, from 5000
// BLE is disabled
DCT_ERROR_BLE_DISABLED = 5000;
// Failed to start BLE advertisement
DCT_ERROR_BLE_ADV_FAILED = 5001;
// Failed to start BLE scan
DCT_ERROR_BLE_SCAN_FAILED = 5002;
// Failed to start L2CAP server
DCT_ERROR_L2CAP_SERVER_FAILED = 5003;
// Failed to start L2CAP client
DCT_ERROR_L2CAP_CLIENT_FAILED = 5004;
// Failed to start MDNS discovery
DCT_ERROR_MDNS_DISCOVERY_TIMEOUT = 5005;
// Failed to register MDNS service
DCT_ERROR_MDNS_REGISTER_SERVICE = 5006;
// Failed to start TLS SPAKE for initial connection
DCT_ERROR_INITIAL_TLS_SPAKE = 5007;
// Failed to start TLS SPAKE for subsequent connection
DCT_ERROR_SUBSEQUENT_TLS_SPAKE = 5008;
// Failed to send request
DCT_ERROR_REQUEST_FAILED = 5009;
// Failed to receive response
DCT_ERROR_RESPONSE_FAILED = 5010;
// Failed to exchange control messages
DCT_ERROR_CONTROL_MESSAGE_EXCHANGE = 5011;
// DCT device capability mismatch
DCT_ERROR_CAPABILITY_MISMATCH = 5012;
// High speed medium is unavailable
DCT_ERROR_HIGH_SPEED_MEDIUM_UNAVAILABLE = 5013;
// Wifi is disabled
DCT_ERROR_WIFI_DISABLED = 5014;
// Wifi is disconnected
DCT_ERROR_WIFI_DISCONNECTED = 5015;
// Failed to transfer wifi credential
DCT_ERROR_WIFI_CREDENTIAL_TRANSFER = 5016;
// Failed to connect to wifi internet
DCT_ERROR_WIFI_INTERNET_CONNECTION = 5017;
// Failed to upgrade to high speed medium
DCT_ERROR_UPGRADE_HIGH_SPEED_MEDIUM_FAILED = 5018;
// Tcp keepalive timeout
DCT_ERROR_KEEPALIVE_TIMEOUT = 5019;
// Connection lost
DCT_ERROR_ESTABLISHED_CONNECTION_LOST = 5020;
// User cancelled the connection
DCT_ERROR_USER_CANCELLED = 5021;
// Service cancelled
DCT_ERROR_SERVICE_CANCELLED = 5022;
// Faile to verify integrity
DCT_ERROR_UNVERIFIED_INTEGRITY = 5023;
// HTTP server closed
DCT_ERROR_HTTP_SERVER_CLOSED = 5024;
}
enum StopAdvertisingReason {