File: fastpair.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (295 lines) | stat: -rw-r--r-- 9,262 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto3";

package nearby.fastpair;

import "fastpair_data.proto";
import "enums.proto";

message Timestamp {
  // Represents seconds of UTC time since Unix epoch
  // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  // 9999-12-31T23:59:59Z inclusive.
  int64 seconds = 1;

  // Non-negative fractions of a second at nanosecond resolution. Negative
  // second values with fractions must still have non-negative nanos values
  // that count forward in time. Must be from 0 to 999,999,999
  // inclusive.
  int32 nanos = 2;
}

// An anti-spoofing key pair for a device that allows us to verify the device is
// broadcasting legitimately.
message AntiSpoofingKeyPair {
  // The private key (restricted to only be viewable by trusted clients).
  bytes private_key = 1;

  // The public key.
  bytes public_key = 2;
}

// Strings to be displayed in notifications surfaced for a device.
message ObservedDeviceStrings {
  // The locale of all of the strings.
  string locale = 1;

  // The notification description for when the device is initially discovered.
  string initial_notification_description = 2;

  // The notification description for when the device is initially discovered
  // and no account is logged in.
  string initial_notification_description_no_account = 3;

  // The notification description for once we have finished pairing and the
  // companion app has been opened. For Bisto devices, this string will point
  // users to setting up the assistant.
  string open_companion_app_description = 4;

  // The notification description for once we have finished pairing and the
  // companion app needs to be updated before use.
  string update_companion_app_description = 5;

  // The notification description for once we have finished pairing and the
  // companion app needs to be installed.
  string download_companion_app_description = 6;

  // The notification title when a pairing fails.
  string unable_to_connect_title = 7;

  // The notification summary when a pairing fails.
  string unable_to_connect_description = 8;

  // The description that helps user initially paired with device.
  string initial_pairing_description = 9;

  // The description that let user open the companion app.
  string connect_success_companion_app_installed = 10;

  // The description that let user download the companion app.
  string connect_success_companion_app_not_installed = 11;

  // The description that reminds user there is a paired device nearby.
  string subsequent_pairing_description = 12;

  // The description that reminds users opt in their device.
  string retroactive_pairing_description = 13;

  // The description that indicates companion app is about to launch.
  string wait_launch_companion_app_description = 14;

  // The description that indicates go to bluetooth settings when connection
  // fail.
  string fail_connect_go_to_settings_description = 15;

  // The title of the UI to ask the user to confirm the pin code.
  string confirm_pin_title = 16;

  // The description of the UI to ask the user to confirm the pin code.
  string confirm_pin_description = 17;

  // The title of the UI to ask the user to confirm to sync contacts.
  string sync_contacts_title = 18;

  // The description of the UI to ask the user to confirm to sync contacts.
  string sync_contacts_description = 19;

  // The title of the UI to ask the user to confirm to sync SMS.
  string sync_sms_title = 20;

  // The description of the UI to ask the user to confirm to sync SMS.
  string sync_sms_description = 21;
}

// A device that has been registered by the user.
message Device {
  // Output only. The server-generated ID of the device.
  int64 id = 1;

  // The pantheon project number the device is created under. Only Nearby admins
  // can change this.
  int64 project_number = 2;

  // How the notification will be displayed to the user
  NotificationType notification_type = 3;

  // The image to show on the notification.
  string image_url = 4;

  // The name of the device.
  string name = 5;

  // The intent that will be launched via the notification.
  string intent_uri = 6;

  // The transmit power of the device's BLE chip.
  int32 ble_tx_power = 7;

  // The distance that the device must be within to show a notification.
  // If no distance is set, we default to 0.6 meters. Only Nearby admins can
  // change this.
  float trigger_distance = 8;

  // Output only. Fast Pair only - The anti-spoofing key pair for the device.
  AntiSpoofingKeyPair anti_spoofing_key_pair = 9;

  // Output only. The current status of the device.
  Status status = 10;

  // Output only.
  // The timestamp of when the device information was last updated on spanner.
  Timestamp last_update_timestamp = 11;

  // DEPRECATED - check for published_version instead.
  // Output only.
  // Whether the device has a different, already published version.
  // bool has_published_version = 12;

  // Fast Pair only - The type of device being registered.
  DeviceType device_type = 13;

  // Fast Pair only - Whether the device should be treated as 1P. Only Nearby
  // admins can change this.
  ManufacturerType manufacturer_type = 14;

  // Fast Pair only - Additional images for true wireless headsets.
  TrueWirelessHeadsetImages true_wireless_images = 15;

  // Fast Pair only - When true, this device can support assistant function.
  // Only Nearby admins can change this.
  // TODO(b/128545971): Transition this to a feature.
  bool assistant_supported = 16;

  // Output only.
  // The published version of a device that has been approved to be displayed
  // as a notification - only populated if the device has a different published
  // version. (A device that only has a published version would not have this
  // populated).
  Device published_version = 17;

  // Fast Pair only - When true, Fast Pair will only create a bond with the
  // device and not attempt to connect any profiles (for example, A2DP or HFP).
  // Only Nearby admins can change this.
  // TODO(b/128545971): Transition this to a feature.
  bool data_only_connection = 18;

  // Name of the company/brand that will be selling the product.
  string company_name = 19;

  repeated FastPairFeature features = 20;

  // Name of the device that is displayed on the console.
  string display_name = 21;

  // How the device will be interacted with by the user when the scan record
  // is detected.
  InteractionType interaction_type = 22;

  // Companion app information.
  CompanionAppDetails companion_detail = 23;
}

// Various states that a customer-configured device notification can be in.
// |status_type| of PUBLISHED is the only state that shows notifications to the
// public.
message Status {
  // Details about a device that has been rejected.
  message RejectionDetails {
    // The reason for the rejection.
    enum RejectionReason {
      // Unspecified reason.
      REASON_UNSPECIFIED = 0;
      // Name is not valid.
      NAME = 1;
      // Image is not valid.
      IMAGE = 2;
      // Tests have failed.
      TESTS = 3;
      // Other reason.
      OTHER = 4;
    }

    // A list of reasons the device was rejected.
    repeated RejectionReason reasons = 1;
    // Comment about an OTHER rejection reason.
    string additional_comment = 2;
  }

  // The status of the device.
  StatusType status_type = 1;

  // Accompanies Status.REJECTED.
  RejectionDetails rejection_details = 2;
}

// Request for getting an observed device.
message GetObservedDeviceRequest {
  // The mode the requesting device is currently in, eg release or debug.
  enum Mode {
    // Unknown mode.
    MODE_UNKNOWN = 0;

    // Release mode.
    MODE_RELEASE = 1;

    // Debug mode.
    MODE_DEBUG = 2;
  }

  // The ID of the device to find.
  int64 device_id = 1;

  // The request mode for the device.
  Mode mode = 2;

  // The locale to get a translated description for.
  string locale = 3;

  // 6-hexdigit Device Id and will be auto-converted and used instead of
  // device_id. If both device_id and hex_device_id, device_id will be used and
  // hex_device_id will be ignored
  string hex_device_id = 4;

  // The max size of an icon to be displayed in pixels.
  int64 max_icon_size_pixels = 5;
}

// Response containing an observed device.
message GetObservedDeviceResponse {
  // The device from the request.
  Device device = 1;

  // The image icon that shows in the notification
  bytes image = 3;

  ObservedDeviceStrings strings = 4;

  reserved 2;
}

// Device metadata used to load cache of popular devices.
message GetObservedDeviceResponses {
  repeated GetObservedDeviceResponse responses = 1;
}

// Request to read the user's devices.
message UserReadDevicesRequest {
  // Optional secondary ID that can be used for lookups.
  bytes secondary_id = 1;
}

// Response containing the list of devices for a user.
message UserReadDevicesResponse {
  repeated FastPairInfo fast_pair_info = 1;
}

// Request to write a new device to a user.
message UserWriteDeviceRequest {
  FastPairInfo fast_pair_info = 1;
}

// Response to writing a new device to a user.
message UserWriteDeviceResponse {}