blob: f57faed6cce1631fe0c4d85e529dcb8240dec494 [file] [log] [blame]
// Copyright 2020 Google LLC
//
// 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
//
// https://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 location.nearby.proto.sharing;
option optimize_for = LITE_RUNTIME;
option java_package = "com.google.location.nearby.proto";
option java_outer_classname = "SharingEnums";
option objc_class_prefix = "GNSHP";
/*
We use event based logging (an event object can be constructed and logged
immediately when they occur). To obtain session based information (e.g.
durations, counting incoming introductions), we use flowId (sender/receiver) in
NearbyClearcutLogger for all events (may exclude settings), and session_id for a
pair of events (start and end of a session).
*/
enum EventType {
UNKNOWN_EVENT_TYPE = 0;
// When new users accept agreements (like grant permission to contacts for
// CONTACT_ONLY visibility) and are enrolled into Nearby Sharing. This event
// is used to count number of new users.
ACCEPT_AGREEMENTS = 1;
// User enables/disables nearby sharing from setting or tile service.
ENABLE_NEARBY_SHARING = 2;
// User sets visibility preference from setting.
SET_VISIBILITY = 3;
// Describe attachments immediately when Nearby Sharing is opened by another
// app which is used to generate/attach attachments to be shared with other
// devices.
DESCRIBE_ATTACHMENTS = 4;
// Start of a scanning phase at sender.
SCAN_FOR_SHARE_TARGETS_START = 5;
// End of the scanning phase at sender.
SCAN_FOR_SHARE_TARGETS_END = 6;
// Receiver advertises itself for presence (a pseudo session).
ADVERTISE_DEVICE_PRESENCE_START = 7;
// End of the advertising phase at receiver.
ADVERTISE_DEVICE_PRESENCE_END = 8;
// Sender sends a fast initialization to receiver.
SEND_FAST_INITIALIZATION = 9;
// Receiver receives the fast initialization.
RECEIVE_FAST_INITIALIZATION = 10;
// Sender discovers a share target.
DISCOVER_SHARE_TARGET = 11;
// Sender sends introduction (before attachments being sent).
SEND_INTRODUCTION = 12;
// Receiver receives introduction.
RECEIVE_INTRODUCTION = 13;
// Receiver responds to introduction (before attachments being sent).
// Actions: Accept, Reject, or (for some reason) Fail.
RESPOND_TO_INTRODUCTION = 14;
// Start of the sending attachments phase at sender.
SEND_ATTACHMENTS_START = 15;
// End of sending attachments phase at sender.
SEND_ATTACHMENTS_END = 16;
// Start of the receiving attachments phase at receiver.
RECEIVE_ATTACHMENTS_START = 17;
// End of receiving attachments phase at receiver.
RECEIVE_ATTACHMENTS_END = 18;
// Sender cancels sending attachments.
CANCEL_SENDING_ATTACHMENTS = 19;
// Receiver cancels receiving attachments.
CANCEL_RECEIVING_ATTACHMENTS = 20;
// Receiver opens received attachments.
OPEN_RECEIVED_ATTACHMENTS = 21;
// User opens the setup activity.
LAUNCH_SETUP_ACTIVITY = 22 [deprecated = true];
// User adds a contact.
ADD_CONTACT = 23;
// User removes a contact.
REMOVE_CONTACT = 24;
// Local devices all Fast Share server.
FAST_SHARE_SERVER_RESPONSE = 25;
// The start of a sending session.
SEND_START = 26;
// Receiver accepts a fast initialization.
ACCEPT_FAST_INITIALIZATION = 27;
// Set data usage preference.
SET_DATA_USAGE = 28;
// Receiver dismisses a fast initialization
DISMISS_FAST_INITIALIZATION = 29;
// Cancel connection.
CANCEL_CONNECTION = 30;
// User starts a chimera activity (e.g. ConsentsChimeraActivity,
// DeviceVisibilityChimeraActivity...)
LAUNCH_ACTIVITY = 31;
// Receiver dismisses a privacy notification.
DISMISS_PRIVACY_NOTIFICATION = 32;
// Receiver taps a privacy notification.
TAP_PRIVACY_NOTIFICATION = 33;
// Receiver taps a help page.
TAP_HELP = 34;
// Receiver taps a feedback.
TAP_FEEDBACK = 35;
// Receiver adds quick settings tile.
ADD_QUICK_SETTINGS_TILE = 36;
// Receiver removes quick settings tile.
REMOVE_QUICK_SETTINGS_TILE = 37;
// Receiver phone consent clicked.
LAUNCH_PHONE_CONSENT = 38;
// Receiver taps quick settings tile.
TAP_QUICK_SETTINGS_TILE = 39;
// Receiver Installation of APKs status.
INSTALL_APK = 40;
// Receiver verification of APKs status.
VERIFY_APK = 41;
// User starts a consent.
LAUNCH_CONSENT = 42;
// After receiving payloads, Nearby Share still needs to transfer the payloads
// to correct attachment formats and move files attachments from temporary
// directory to final destination.
PROCESS_RECEIVED_ATTACHMENTS_END = 43;
// Toggle Show Notification setting item in Nearby Share setting.
TOGGLE_SHOW_NOTIFICATION = 44;
// Set device name
SET_DEVICE_NAME = 45;
// users dropped off opt-in page.
DECLINE_AGREEMENTS = 46;
// Request setting permissions (Wifi/BT/location/airplane mode).
REQUEST_SETTING_PERMISSIONS = 47;
// Set up a connection with the remote device.
ESTABLISH_CONNECTION = 48;
// Track device states in Nearby Share setting.
DEVICE_SETTINGS = 49;
}
// Event category to differentiate whether this comes from sender or receiver,
// whether this is for communication flow, or for settings.
enum EventCategory {
UNKNOWN_EVENT_CATEGORY = 0;
SENDING_EVENT = 1;
RECEIVING_EVENT = 2;
SETTINGS_EVENT = 3;
}
// Status of nearby sharing.
enum NearbySharingStatus {
UNKNOWN_NEARBY_SHARING_STATUS = 0;
ON = 1;
OFF = 2;
}
enum Visibility {
UNKNOWN_VISIBILITY = 0;
CONTACTS_ONLY = 1;
EVERYONE = 2;
SELECTED_CONTACTS_ONLY = 3;
HIDDEN = 4;
SELF_SHARE = 5;
}
enum DataUsage {
UNKNOWN_DATA_USAGE = 0;
ONLINE = 1;
WIFI_ONLY = 2;
OFFLINE = 3;
}
// The status of establishing a connection. Used by ESTABLISH_CONNECTION.
enum EstablishConnectionStatus {
CONNECTION_STATUS_UNKNOWN = 0;
CONNECTION_STATUS_SUCCESS = 1;
CONNECTION_STATUS_FAILURE = 2;
CONNECTION_STATUS_CANCELLATION = 3;
}
// The status of sending and receiving attachments. Used by SEND_ATTACHMENTS.
enum AttachmentTransmissionStatus {
UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS = 0;
COMPLETE_ATTACHMENT_TRANSMISSION_STATUS = 1;
CANCELED_ATTACHMENT_TRANSMISSION_STATUS = 2;
FAILED_ATTACHMENT_TRANSMISSION_STATUS = 3;
REJECTED_ATTACHMENT = 4;
TIMED_OUT_ATTACHMENT = 5;
AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT = 6 [deprecated = true];
NOT_ENOUGH_SPACE_ATTACHMENT = 7;
FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8;
MEDIA_UNAVAILABLE_ATTACHMENT = 9;
UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT = 10;
NO_ATTACHMENT_FOUND = 11;
FAILED_NO_SHARE_TARGET_ENDPOINT = 12;
FAILED_PAIRED_KEYHANDSHAKE = 13;
FAILED_NULL_CONNECTION = 14;
FAILED_NO_PAYLOAD = 15;
FAILED_WRITE_INTRODUCTION = 16;
// The remote response is either missing or has an unknown type.
FAILED_UNKNOWN_REMOTE_RESPONSE = 17;
}
// The status of processing attachments after receiver received payloads
// successfully.
enum ProcessReceivedAttachmentsStatus {
PROCESSING_STATUS_UNKNOWN = 0;
PROCESSING_STATUS_COMPLETE_PROCESSING_ATTACHMENTS = 1;
PROCESSING_STATUS_FAILED_MOVING_FILES = 2;
PROCESSING_STATUS_FAILED_RECEIVING_APK = 3;
PROCESSING_STATUS_FAILED_RECEIVING_TEXT = 4;
PROCESSING_STATUS_FAILED_RECEIVING_WIFI_CREDENTIALS = 5;
}
// The status of advertising and discovering sessions. Used by
// SCAN_FOR_SHARE_TARGETS and ADVERTISE_DEVICE_PRESENCE.
enum SessionStatus {
UNKNOWN_SESSION_STATUS = 0;
SUCCEEDED_SESSION_STATUS = 1;
FAILED_SESSION_STATUS = 2;
}
// User's response to introductions.
enum ResponseToIntroduction {
UNKNOWN_RESPONSE_TO_INTRODUCTION = 0;
ACCEPT_INTRODUCTION = 1;
REJECT_INTRODUCTION = 2;
FAIL_INTRODUCTION = 3;
}
// TODO(fdi): may eventually include desktop, etc.
// The type of a remote device.
enum DeviceType {
UNKNOWN_DEVICE_TYPE = 0;
PHONE = 1;
TABLET = 2;
LAPTOP = 3;
}
// TODO(fdi): may eventually include windows, iOS, etc.
// The OS type of a remote device.
enum OSType {
UNKNOWN_OS_TYPE = 0;
ANDROID = 1;
CHROME_OS = 2;
IOS = 3;
}
// Relationship of remote device to sender device.
enum DeviceRelationship {
UNKNOWN_DEVICE_RELATIONSHIP = 0;
// The remote device belongs to the same owner as sender device.
IS_SELF = 1;
// The remote device is a contact of sender.
IS_CONTACT = 2;
// The remote device is a stranger.
IS_STRANGER = 3;
}
// The device sources of the clearcut log.
enum LogSource {
UNSPECIFIED_SOURCE = 0;
// Represents the devices in Nearby labs.
LAB_DEVICES = 1;
// Represents the devices tested by Nearby engs, in the long term can include
// any devices with newest feature flags.
INTERNAL_DEVICES = 2;
// Represents the devices testing our in-development features before they're
// released to the greater public.
BETA_TESTER_DEVICES = 3;
// Represents the OEM partners (like Samsung) that we're working with to
// verify functionality on their devices.
OEM_DEVICES = 4;
// Represents the device for debugging.
DEBUG_DEVICES = 5;
}
// The Fast Share server action name.
enum ServerActionName {
UNKNOWN_SERVER_ACTION = 0;
UPLOAD_CERTIFICATES = 1;
DOWNLOAD_CERTIFICATES = 2;
CHECK_REACHABILITY = 3;
UPLOAD_CONTACTS = 4;
UPDATE_DEVICE_NAME = 5;
UPLOAD_SENDER_CERTIFICATES = 6;
DOWNLOAD_SENDER_CERTIFICATES = 7;
}
// The Fast Share server response state.
enum ServerResponseState {
UNKNOWN_SERVER_RESPONSE_STATE = 0;
SERVER_RESPONSE_SUCCESS = 1;
SERVER_RESPONSE_UNKNOWN_FAILURE = 2;
// For StatusException.
SERVER_RESPONSE_STATUS_OTHER_FAILURE = 3;
SERVER_RESPONSE_STATUS_DEADLINE_EXCEEDED = 4;
SERVER_RESPONSE_STATUS_PERMISSION_DENIED = 5;
SERVER_RESPONSE_STATUS_UNAVAILABLE = 6;
SERVER_RESPONSE_STATUS_UNAUTHENTICATED = 7;
SERVER_RESPONSE_STATUS_INVALID_ARGUMENT = 9;
// For GoogleAuthException.
SERVER_RESPONSE_GOOGLE_AUTH_FAILURE = 8;
}
// The type of Nearby Sharing scanning.
enum ScanType {
UNKNOWN_SCAN_TYPE = 0;
FOREGROUND_SCAN = 1;
FOREGROUND_RETRY_SCAN = 2;
DIRECT_SHARE_SCAN = 3;
}
// The class name of chimera activity.
enum ActivityName {
UNKNOWN_ACTIVITY = 0;
SHARE_SHEET_ACTIVITY = 1;
SETTINGS_ACTIVITY = 2;
RECEIVE_SURFACE_ACTIVITY = 3;
SETUP_ACTIVITY = 4;
DEVICE_VISIBILITY_ACTIVITY = 5;
CONSENTS_ACTIVITY = 6;
SET_DEVICE_NAME_DIALOG = 7;
SET_DATA_USAGE_DIALOG = 8;
}
// The type of consent page user launches.
enum ConsentType {
CONSENT_TYPE_UNKNOWN = 0;
// launch Constellation consent page.
CONSENT_TYPE_C11N = 1;
// launch device contact consent page.
CONSENT_TYPE_DEVICE_CONTACT = 2;
}
enum ConsentAcceptanceStatus {
CONSENT_UNKNOWN_ACCEPT_STATUS = 0;
CONSENT_ACCEPTED = 1;
CONSENT_DECLINED = 2;
// unable to enable consent.
CONSENT_UNABLE_TO_ENABLE = 3;
}
enum ApkSource {
UNKNOWN_APK_SOURCE = 0;
APK_FROM_SD_CARD = 1;
INSTALLED_APP = 2;
}
// The Installation status of APK.
enum InstallAPKStatus {
UNKNOWN_INSTALL_APK_STATUS = 0;
FAIL_INSTALLATION = 1;
SUCCESS_INSTALLATION = 2;
}
// The verification status of APK.
enum VerifyAPKStatus {
UNKNOWN_VERIFY_APK_STATUS = 0;
NOT_INSTALLABLE = 1;
INSTALLABLE = 2;
ALREADY_INSTALLED = 3;
}
enum ShowNotificationStatus {
UNKNOWN_SHOW_NOTIFICATION_STATUS = 0;
SHOW = 1;
NOT_SHOW = 2;
}
enum PermissionRequestResult {
PERMISSION_UNKNOWN_REQUEST_RESULT = 0;
PERMISSION_GRANTED = 1;
PERMISSION_REJECTED = 2;
PERMISSION_UNABLE_TO_GRANT = 3;
}
enum PermissionRequestType {
PERMISSION_UNKNOWN_TYPE = 0;
PERMISSION_AIRPLANE_MODE_OFF = 1;
PERMISSION_WIFI = 2;
PERMISSION_BLUETOOTH = 3;
PERMISSION_LOCATION = 4;
}