Internal change

PiperOrigin-RevId: 640541007
This commit is contained in:
hai007
2024-06-05 08:54:10 -07:00
committed by Copybara-Service
parent 152cabab7c
commit 37e8523189
+95 -54
View File
@@ -52,65 +52,93 @@ enum EventType {
// Describe attachments immediately when Nearby Sharing is opened by another // Describe attachments immediately when Nearby Sharing is opened by another
// app which is used to generate/attach attachments to be shared with other // app which is used to generate/attach attachments to be shared with other
// devices. // devices.
DESCRIBE_ATTACHMENTS = 4; DESCRIBE_ATTACHMENTS = 4
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// Start of a scanning phase at sender. // Start of a scanning phase at sender.
SCAN_FOR_SHARE_TARGETS_START = 5 SCAN_FOR_SHARE_TARGETS_START = 5 /*[[*/
/* stage = STAGE_QS_DISCOVER_START */; /*( device_role = DEVICE_ROLE_INITIATOR, )*/
/*( stage = STAGE_QS_DISCOVER_START )*/
/*]]*/;
// End of the scanning phase at sender. // End of the scanning phase at sender.
SCAN_FOR_SHARE_TARGETS_END = 6 SCAN_FOR_SHARE_TARGETS_END = 6 /*[[*/
/* stage = STAGE_QS_DISCOVER_END */; /*( device_role = DEVICE_ROLE_INITIATOR, )*/
/*( stage = STAGE_QS_DISCOVER_END )*/
/*]]*/;
// Receiver advertises itself for presence (a pseudo session). // Receiver advertises itself for presence (a pseudo session).
ADVERTISE_DEVICE_PRESENCE_START = 7 ADVERTISE_DEVICE_PRESENCE_START = 7 /*[[*/
/* stage = STAGE_QS_ADVERTISE_START */; /*( device_role = DEVICE_ROLE_REMOTE, )*/
/*( stage = STAGE_QS_ADVERTISE_START )*/
/*]]*/;
// End of the advertising phase at receiver. // End of the advertising phase at receiver.
ADVERTISE_DEVICE_PRESENCE_END = 8 ADVERTISE_DEVICE_PRESENCE_END = 8 /*[[*/
/* stage = STAGE_QS_ADVERTISE_END */; /*( device_role = DEVICE_ROLE_REMOTE, )*/
/*( stage = STAGE_QS_ADVERTISE_END )*/
/*]]*/;
// Sender sends a fast initialization to receiver. // Sender sends a fast initialization to receiver.
SEND_FAST_INITIALIZATION = 9; SEND_FAST_INITIALIZATION = 9
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// Receiver receives the fast initialization. // Receiver receives the fast initialization.
RECEIVE_FAST_INITIALIZATION = 10; RECEIVE_FAST_INITIALIZATION = 10
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Sender discovers a share target. // Sender discovers a share target.
DISCOVER_SHARE_TARGET = 11 /* stage = STAGE_QS_DISCOVERED */; DISCOVER_SHARE_TARGET = 11 /*[[*/
/*( device_role = DEVICE_ROLE_INITIATOR, )*/
/*( stage = STAGE_QS_DISCOVERED )*/
/*]]*/;
// Sender sends introduction (before attachments being sent). // Sender sends introduction (before attachments being sent).
SEND_INTRODUCTION = 12; SEND_INTRODUCTION = 12
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// Receiver receives introduction. // Receiver receives introduction.
RECEIVE_INTRODUCTION = 13; RECEIVE_INTRODUCTION = 13
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Receiver responds to introduction (before attachments being sent). // Receiver responds to introduction (before attachments being sent).
// Actions: Accept, Reject, or (for some reason) Fail. // Actions: Accept, Reject, or (for some reason) Fail.
RESPOND_TO_INTRODUCTION = 14; RESPOND_TO_INTRODUCTION = 14
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Start of the sending attachments phase at sender. // Start of the sending attachments phase at sender.
SEND_ATTACHMENTS_START = 15 SEND_ATTACHMENTS_START = 15 /*[[*/
/* stage = STAGE_QS_TRANSFER_START */; /*( device_role = DEVICE_ROLE_INITIATOR, )*/
/*( stage = STAGE_QS_TRANSFER_START )*/
/*]]*/;
// End of sending attachments phase at sender. // End of sending attachments phase at sender.
SEND_ATTACHMENTS_END = 16 /* stage = STAGE_QS_TRANSFER_END */; SEND_ATTACHMENTS_END = 16 /*[[*/
/*( device_role = DEVICE_ROLE_INITIATOR, )*/
/*( stage = STAGE_QS_TRANSFER_END )*/
/*]]*/;
// Start of the receiving attachments phase at receiver. // Start of the receiving attachments phase at receiver.
RECEIVE_ATTACHMENTS_START = 17; RECEIVE_ATTACHMENTS_START = 17
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// End of receiving attachments phase at receiver. // End of receiving attachments phase at receiver.
RECEIVE_ATTACHMENTS_END = 18 RECEIVE_ATTACHMENTS_END = 18 /*[[*/
/* stage = STAGE_QS_TRANSFER_END */; /*( device_role = DEVICE_ROLE_REMOTE, )*/
/*( stage = STAGE_QS_TRANSFER_END )*/
/*]]*/;
// Sender cancels sending attachments. // Sender cancels sending attachments.
CANCEL_SENDING_ATTACHMENTS = 19; CANCEL_SENDING_ATTACHMENTS = 19
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// Receiver cancels receiving attachments. // Receiver cancels receiving attachments.
CANCEL_RECEIVING_ATTACHMENTS = 20; CANCEL_RECEIVING_ATTACHMENTS = 20
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Receiver opens received attachments. // Receiver opens received attachments.
OPEN_RECEIVED_ATTACHMENTS = 21; OPEN_RECEIVED_ATTACHMENTS = 21
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// User opens the setup activity. // User opens the setup activity.
LAUNCH_SETUP_ACTIVITY = 22 [deprecated = true]; LAUNCH_SETUP_ACTIVITY = 22 [deprecated = true];
@@ -125,19 +153,25 @@ enum EventType {
FAST_SHARE_SERVER_RESPONSE = 25; FAST_SHARE_SERVER_RESPONSE = 25;
// The start of a sending session. // The start of a sending session.
SEND_START = 26 /* stage = STAGE_QS_CONNECT_START */; SEND_START = 26 /*[[*/
/*( device_role = DEVICE_ROLE_INITIATOR, )*/
/*( stage = STAGE_QS_CONNECT_START )*/
/*]]*/;
// Receiver accepts a fast initialization. // Receiver accepts a fast initialization.
ACCEPT_FAST_INITIALIZATION = 27; ACCEPT_FAST_INITIALIZATION = 27
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Set data usage preference. // Set data usage preference.
SET_DATA_USAGE = 28; SET_DATA_USAGE = 28;
// Receiver dismisses a fast initialization // Receiver dismisses a fast initialization
DISMISS_FAST_INITIALIZATION = 29; DISMISS_FAST_INITIALIZATION = 29
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Cancel connection. // Cancel connection.
CANCEL_CONNECTION = 30; CANCEL_CONNECTION = 30
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// User starts a chimera activity (e.g. ConsentsChimeraActivity, // User starts a chimera activity (e.g. ConsentsChimeraActivity,
// DeviceVisibilityChimeraActivity...) // DeviceVisibilityChimeraActivity...)
@@ -171,10 +205,10 @@ enum EventType {
TAP_QUICK_SETTINGS_TILE = 39; TAP_QUICK_SETTINGS_TILE = 39;
// Receiver Installation of APKs status. // Receiver Installation of APKs status.
INSTALL_APK = 40; INSTALL_APK = 40 /*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Receiver verification of APKs status. // Receiver verification of APKs status.
VERIFY_APK = 41; VERIFY_APK = 41 /*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// User starts a consent. // User starts a consent.
LAUNCH_CONSENT = 42; LAUNCH_CONSENT = 42;
@@ -182,7 +216,8 @@ enum EventType {
// After receiving payloads, Nearby Share still needs to transfer the payloads // After receiving payloads, Nearby Share still needs to transfer the payloads
// to correct attachment formats and move files attachments from temporary // to correct attachment formats and move files attachments from temporary
// directory to final destination. // directory to final destination.
PROCESS_RECEIVED_ATTACHMENTS_END = 43; PROCESS_RECEIVED_ATTACHMENTS_END = 43
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Toggle Show Notification setting item in Nearby Share setting. // Toggle Show Notification setting item in Nearby Share setting.
TOGGLE_SHOW_NOTIFICATION = 44; TOGGLE_SHOW_NOTIFICATION = 44;
@@ -197,20 +232,22 @@ enum EventType {
REQUEST_SETTING_PERMISSIONS = 47; REQUEST_SETTING_PERMISSIONS = 47;
// Set up a connection with the remote device. // Set up a connection with the remote device.
ESTABLISH_CONNECTION = 48 /* stage = STAGE_QS_CONNECT_END */; ESTABLISH_CONNECTION = 48 /*[ stage = STAGE_QS_CONNECT_END ]*/;
// Track device states in Nearby Share setting. // Track device states in Nearby Share setting.
DEVICE_SETTINGS = 49; DEVICE_SETTINGS = 49;
// Receiver auto dismisses a fast initialization notification. // Receiver auto dismisses a fast initialization notification.
AUTO_DISMISS_FAST_INITIALIZATION = 50; AUTO_DISMISS_FAST_INITIALIZATION = 50
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// App Crash event. // App Crash event.
// Used only for Windows App now. // Used only for Windows App now.
APP_CRASH = 51; APP_CRASH = 51;
// Sender taps the Send button in quick settings // Sender taps the Send button in quick settings
TAP_QUICK_SETTINGS_FILE_SHARE = 52; TAP_QUICK_SETTINGS_FILE_SHARE = 52
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// Devices show a privacy notification // Devices show a privacy notification
DISPLAY_PRIVACY_NOTIFICATION = 53; DISPLAY_PRIVACY_NOTIFICATION = 53;
@@ -226,16 +263,19 @@ enum EventType {
SETUP_WIZARD = 57; SETUP_WIZARD = 57;
// Sender taps a QR code // Sender taps a QR code
TAP_QR_CODE = 58; TAP_QR_CODE = 58 /*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// QR code link shown // QR code link shown
QR_CODE_LINK_SHOWN = 59; QR_CODE_LINK_SHOWN = 59
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// Sender failed to parse endpoint id. // Sender failed to parse endpoint id.
PARSING_FAILED_ENDPOINT_ID = 60; PARSING_FAILED_ENDPOINT_ID = 60
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// The device is discovered by fast initialization // The device is discovered by fast initialization
FAST_INIT_DISCOVER_DEVICE = 61; FAST_INIT_DISCOVER_DEVICE = 61
/*[ device_role = DEVICE_ROLE_REMOTE ]*/;
// Send desktop notification. // Send desktop notification.
SEND_DESKTOP_NOTIFICATION = 62; SEND_DESKTOP_NOTIFICATION = 62;
@@ -247,7 +287,8 @@ enum EventType {
DECRYPT_CERTIFICATE_FAILURE = 64; DECRYPT_CERTIFICATE_FAILURE = 64;
// Show allow permission auto access UI // Show allow permission auto access UI
SHOW_ALLOW_PERMISSION_AUTO_ACCESS = 65; SHOW_ALLOW_PERMISSION_AUTO_ACCESS = 65
/*[ device_role = DEVICE_ROLE_INITIATOR ]*/;
// UI events for transferring files with desktop applications. It includes // UI events for transferring files with desktop applications. It includes
// event types such as DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE. // event types such as DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE.
@@ -296,23 +337,23 @@ enum EstablishConnectionStatus {
CONNECTION_STATUS_UNKNOWN = 0; CONNECTION_STATUS_UNKNOWN = 0;
CONNECTION_STATUS_SUCCESS = 1 CONNECTION_STATUS_SUCCESS = 1
/* status_bucket = STATUS_SUCCESSFUL */; /*[ status_bucket = STATUS_SUCCESSFUL ]*/;
CONNECTION_STATUS_FAILURE = 2 CONNECTION_STATUS_FAILURE = 2
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
CONNECTION_STATUS_CANCELLATION = 3 CONNECTION_STATUS_CANCELLATION = 3
/* status_bucket = STATUS_CANCELLED */; /*[ status_bucket = STATUS_CANCELLED ]*/;
CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT = 4 CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT = 4
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE = 5 CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE = 5
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION = 6 CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION = 6
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
CONNECTION_STATUS_FAILED_NULL_CONNECTION = 7 CONNECTION_STATUS_FAILED_NULL_CONNECTION = 7
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8 CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
CONNECTION_STATUS_LOST_CONNECTIVITY = 9 CONNECTION_STATUS_LOST_CONNECTIVITY = 9
/* status_bucket = STATUS_INTERRUPTION */; /*[ status_bucket = STATUS_INTERRUPTION ]*/;
// TODO: b/341782941 - : Annote this status when it's confirmed by Nearby // TODO: b/341782941 - : Annote this status when it's confirmed by Nearby
// Connections team. // Connections team.
CONNECTION_STATUS_INVALID_ADVERTISEMENT = 10; CONNECTION_STATUS_INVALID_ADVERTISEMENT = 10;
@@ -322,11 +363,11 @@ enum EstablishConnectionStatus {
enum AttachmentTransmissionStatus { enum AttachmentTransmissionStatus {
UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS = 0; UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS = 0;
COMPLETE_ATTACHMENT_TRANSMISSION_STATUS = 1 COMPLETE_ATTACHMENT_TRANSMISSION_STATUS = 1
/* status_bucket = STATUS_SUCCESSFUL */; /*[ status_bucket = STATUS_SUCCESSFUL ]*/;
CANCELED_ATTACHMENT_TRANSMISSION_STATUS = 2 CANCELED_ATTACHMENT_TRANSMISSION_STATUS = 2
/* status_bucket = STATUS_CANCELLED */; /*[ status_bucket = STATUS_CANCELLED ]*/;
FAILED_ATTACHMENT_TRANSMISSION_STATUS = 3 FAILED_ATTACHMENT_TRANSMISSION_STATUS = 3
/* status_bucket = STATUS_INTERNAL_ERROR */; /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/;
REJECTED_ATTACHMENT = 4 [deprecated = true]; REJECTED_ATTACHMENT = 4 [deprecated = true];
TIMED_OUT_ATTACHMENT = 5 [deprecated = true]; TIMED_OUT_ATTACHMENT = 5 [deprecated = true];
AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT = 6 [deprecated = true]; AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT = 6 [deprecated = true];
@@ -358,7 +399,7 @@ enum AttachmentTransmissionStatus {
REJECTED_ATTACHMENT_TRANSMISSION_STATUS = 22; REJECTED_ATTACHMENT_TRANSMISSION_STATUS = 22;
TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS = 23; TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS = 23;
NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS = 24 NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS = 24
/* status_bucket = STATUS_INTERRUPTION */; /*[ status_bucket = STATUS_INTERRUPTION ]*/;
UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS = 25; UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS = 25;
FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS = 26; FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS = 26;
// Connection failed due to Wifi is disconnected or Bluetooth setting is off // Connection failed due to Wifi is disconnected or Bluetooth setting is off
@@ -370,7 +411,7 @@ enum AttachmentTransmissionStatus {
// Connection failed due to Wifi is disconnected or Bluetooth setting is off // Connection failed due to Wifi is disconnected or Bluetooth setting is off
// or user turn on airplane mode. // or user turn on airplane mode.
LOST_CONNECTIVITY_TRANSMISSION_STATUS = 29 LOST_CONNECTIVITY_TRANSMISSION_STATUS = 29
/* status_bucket = STATUS_INTERRUPTION */; /*[ status_bucket = STATUS_INTERRUPTION ]*/;
} }
// Generic result status of NearbyConnections API calls. // Generic result status of NearbyConnections API calls.
@@ -445,7 +486,7 @@ enum ProcessReceivedAttachmentsStatus {
enum SessionStatus { enum SessionStatus {
UNKNOWN_SESSION_STATUS = 0; UNKNOWN_SESSION_STATUS = 0;
SUCCEEDED_SESSION_STATUS = 1 SUCCEEDED_SESSION_STATUS = 1
/* status_bucket = STATUS_SUCCESSFUL */; /*[ status_bucket = STATUS_SUCCESSFUL ]*/;
// TODO: b/341782941 - FAILED_SESSION_STATUS occurs when the status of // TODO: b/341782941 - FAILED_SESSION_STATUS occurs when the status of
// advertising or discovering sessions is not successful. It can be // advertising or discovering sessions is not successful. It can be