weicesun | b989a18 | 2021-11-04 14:14:54 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package service.proto; |
| 3 | import "src/fastpair/rpcs.proto"; |
weicesun | 421e075 | 2021-11-11 18:25:00 -0800 | [diff] [blame] | 4 | import "src/fastpair/fast_pair_string.proto"; |
weicesun | b989a18 | 2021-11-04 14:14:54 -0700 | [diff] [blame] | 5 | |
| 6 | // db information for Fast Pair that gets from server. |
| 7 | message ServerResponseDbItem { |
| 8 | // Device's model id. |
| 9 | string model_id = 1; |
| 10 | |
| 11 | // Response was received from the server. Contains data needed to display |
| 12 | // FastPair notification such as device name, txPower of device, image used |
| 13 | // in the notification, etc. |
| 14 | GetObservedDeviceResponse get_observed_device_response = 2; |
| 15 | |
| 16 | // The timestamp that make the server fetch. |
| 17 | int64 last_fetch_info_timestamp_millis = 3; |
| 18 | |
| 19 | // Whether the item in the cache is expirable or not (when offline mode this |
| 20 | // will be false). |
weicesun | 421e075 | 2021-11-11 18:25:00 -0800 | [diff] [blame] | 21 | bool expirable = 4; |
| 22 | } |
| 23 | |
| 24 | |
| 25 | // Client side scan result. |
| 26 | message StoredScanResult { |
| 27 | // REQUIRED |
| 28 | // Unique ID generated based on scan result |
| 29 | string id = 1; |
| 30 | |
| 31 | // REQUIRED |
| 32 | NearbyType type = 2; |
| 33 | |
| 34 | // REQUIRED |
| 35 | // The most recent all upper case mac associated with this item. |
| 36 | // (Mac-to-DiscoveryItem is a many-to-many relationship) |
| 37 | string mac_address = 4; |
| 38 | |
| 39 | // Beacon's RSSI value |
| 40 | int32 rssi = 10; |
| 41 | |
| 42 | // Beacon's tx power |
| 43 | int32 tx_power = 11; |
| 44 | |
| 45 | // The mac address encoded in beacon advertisement. Currently only used by |
| 46 | // chromecast. |
| 47 | string device_setup_mac = 12; |
| 48 | |
| 49 | // Uptime of the device in minutes. Stops incrementing at 255. |
| 50 | int32 uptime_minutes = 13; |
| 51 | |
| 52 | // REQUIRED |
| 53 | // Client timestamp when the beacon was first observed in BLE scan. |
| 54 | int64 first_observation_timestamp_millis = 14; |
| 55 | |
| 56 | // REQUIRED |
| 57 | // Client timestamp when the beacon was last observed in BLE scan. |
| 58 | int64 last_observation_timestamp_millis = 15; |
| 59 | |
| 60 | // Deprecated fields. |
| 61 | reserved 3, 5, 6, 7, 8, 9; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | // Data for a DiscoveryItem created from server response and client scan result. |
| 66 | // Only caching original data from scan result, server response, timestamps |
| 67 | // and user actions. Do not save generated data in this object. |
| 68 | // Next ID: 50 |
| 69 | message StoredDiscoveryItem { |
| 70 | enum State { |
| 71 | // Default unknown state. |
| 72 | STATE_UNKNOWN = 0; |
| 73 | |
| 74 | // The item is normal. |
| 75 | STATE_ENABLED = 1; |
| 76 | |
| 77 | // The item has been muted by user. |
| 78 | STATE_MUTED = 2; |
| 79 | |
| 80 | // The item has been disabled by us (likely temporarily). |
| 81 | STATE_DISABLED_BY_SYSTEM = 3; |
| 82 | } |
| 83 | |
| 84 | // The status of the item. |
| 85 | // TODO(b/204409421) remove enum |
| 86 | enum DebugMessageCategory { |
| 87 | // Default unknown state. |
| 88 | STATUS_UNKNOWN = 0; |
| 89 | |
| 90 | // The item is valid and visible in notification. |
| 91 | STATUS_VALID_NOTIFICATION = 1; |
| 92 | |
| 93 | // The item made it to list but not to notification. |
| 94 | STATUS_VALID_LIST_VIEW = 2; |
| 95 | |
| 96 | // The item is filtered out on client. Never made it to list view. |
| 97 | STATUS_DISABLED_BY_CLIENT = 3; |
| 98 | |
| 99 | // The item is filtered out by server. Never made it to client. |
| 100 | STATUS_DISABLED_BY_SERVER = 4; |
| 101 | } |
| 102 | |
| 103 | enum ExperienceType { |
| 104 | EXPERIENCE_UNKNOWN = 0; |
| 105 | EXPERIENCE_GOOD = 1; |
| 106 | EXPERIENCE_BAD = 2; |
| 107 | } |
| 108 | |
| 109 | // REQUIRED |
| 110 | // Offline item: unique ID generated on client. |
| 111 | // Online item: unique ID generated on server. |
| 112 | string id = 1; |
| 113 | |
| 114 | // REQUIRED |
| 115 | NearbyType type = 2; |
| 116 | |
| 117 | // REQUIRED |
| 118 | // The most recent all upper case mac associated with this item. |
| 119 | // (Mac-to-DiscoveryItem is a many-to-many relationship) |
| 120 | string mac_address = 4; |
| 121 | |
| 122 | // REQUIRED |
| 123 | string action_url = 5; |
| 124 | |
| 125 | // The bluetooth device name from advertisment |
| 126 | string device_name = 6; |
| 127 | |
| 128 | // REQUIRED |
| 129 | // Item's title |
| 130 | string title = 7; |
| 131 | |
| 132 | // Item's description. |
| 133 | string description = 8; |
| 134 | |
| 135 | // The URL for display |
| 136 | string display_url = 9; |
| 137 | |
| 138 | // REQUIRED |
| 139 | // Client timestamp when the beacon was last observed in BLE scan. |
| 140 | int64 last_observation_timestamp_millis = 10; |
| 141 | |
| 142 | // REQUIRED |
| 143 | // Client timestamp when the beacon was first observed in BLE scan. |
| 144 | int64 first_observation_timestamp_millis = 11; |
| 145 | |
| 146 | // REQUIRED |
| 147 | // Item's current state. e.g. if the item is blocked. |
| 148 | State state = 17; |
| 149 | |
| 150 | // The resolved url type for the action_url. |
| 151 | ResolvedUrlType action_url_type = 19; |
| 152 | |
| 153 | // The timestamp when the user is redirected to Play Store after clicking on |
| 154 | // the item. |
| 155 | int64 pending_app_install_timestamp_millis = 20; |
| 156 | |
| 157 | // Beacon's RSSI value |
| 158 | int32 rssi = 22; |
| 159 | |
| 160 | // Beacon's tx power |
| 161 | int32 tx_power = 23; |
| 162 | |
| 163 | // Human readable name of the app designated to open the uri |
| 164 | // Used in the second line of the notification, "Open in {} app" |
| 165 | string app_name = 25; |
| 166 | |
| 167 | // ID used for associating several DiscoveryItems. These items may be |
| 168 | // visually displayed together. |
| 169 | string group_id = 26; |
| 170 | |
| 171 | // The timestamp when the attachment was created on PBS server. In case there |
| 172 | // are duplicate |
| 173 | // items with the same scanId/groupID, only show the one with the latest |
| 174 | // timestamp. |
| 175 | int64 attachment_creation_sec = 28; |
| 176 | |
| 177 | // Whether the attachment is created in debug namespace |
| 178 | DiscoveryAttachmentType attachment_type = 29; |
| 179 | |
| 180 | // Package name of the App that owns this item. |
| 181 | string package_name = 30; |
| 182 | |
| 183 | // The average star rating of the app. |
| 184 | float star_rating = 31; |
| 185 | |
| 186 | // The "feature" graphic image url used for large sized list view entries. |
| 187 | string feature_graphic_url = 32; |
| 188 | |
| 189 | // TriggerId identifies the trigger/beacon that is attached with a message. |
| 190 | // It's generated from server for online messages to synchronize formatting |
| 191 | // across client versions. |
| 192 | // Example: |
| 193 | // * BLE_UID: 3||deadbeef |
| 194 | // * BLE_URL: http://trigger.id |
| 195 | // See go/discovery-store-message-and-trigger-id for more details. |
| 196 | string trigger_id = 34; |
| 197 | |
| 198 | // Bytes of item icon in PNG format displayed in Discovery item list. |
| 199 | bytes icon_png = 36; |
| 200 | |
| 201 | // A FIFE URL of the item icon displayed in Discovery item list. |
| 202 | string icon_fife_url = 49; |
| 203 | |
| 204 | // Message written to bugreport for 3P developers.(No sensitive info) |
| 205 | // null if the item is valid |
| 206 | string debug_message = 37; |
| 207 | |
| 208 | // Weather the item is filtered out on server. |
| 209 | DebugMessageCategory debug_category = 38; |
| 210 | |
| 211 | // Client timestamp when the trigger (e.g. beacon) was last lost (e.g. when |
| 212 | // Messages told us the beacon's no longer nearby). |
| 213 | int64 lost_millis = 41; |
| 214 | |
| 215 | // The kind of expereince the user last had with this (e.g. if they dismissed |
| 216 | // the notification, that's bad; but if they tapped it, that's good). |
| 217 | ExperienceType last_user_experience = 42; |
| 218 | |
| 219 | // The most recent BLE advertisement related to this item. |
| 220 | bytes ble_record_bytes = 43; |
| 221 | |
| 222 | // An ID generated on the server to uniquely identify content. |
| 223 | string entity_id = 44; |
| 224 | |
| 225 | // See equivalent field in NearbyItem. |
| 226 | bytes authentication_public_key_secp256r1 = 45; |
| 227 | |
| 228 | // See equivalent field in NearbyItem. |
| 229 | FastPairInformation fast_pair_information = 46; |
| 230 | |
| 231 | // Companion app detail. |
| 232 | CompanionAppDetails companion_detail = 47; |
| 233 | |
| 234 | // Fast pair strings |
| 235 | FastPairStrings fast_pair_strings = 48; |
| 236 | |
| 237 | // Deprecated fields. |
| 238 | reserved 3, 12, 13, 14, 15, 16, 18, 21, 24, 27, 33, 35, 39, 40; |
| 239 | } |
| 240 | enum ResolvedUrlType { |
| 241 | RESOLVED_URL_TYPE_UNKNOWN = 0; |
| 242 | |
| 243 | // The url is resolved to a web page that is not a play store app. |
| 244 | // This can be considered as the default resolved type when it's |
| 245 | // not the other specific types. |
| 246 | WEBPAGE = 1; |
| 247 | |
| 248 | // The url is resolved to the Google Play store app |
| 249 | // ie. play.google.com/store |
| 250 | APP = 2; |
| 251 | } |
| 252 | enum DiscoveryAttachmentType { |
| 253 | DISCOVERY_ATTACHMENT_TYPE_UNKNOWN = 0; |
| 254 | |
| 255 | // The attachment is posted in the prod namespace (without "-debug") |
| 256 | DISCOVERY_ATTACHMENT_TYPE_NORMAL = 1; |
| 257 | |
| 258 | // The attachment is posted in the debug namespace (with "-debug") |
| 259 | DISCOVERY_ATTACHMENT_TYPE_DEBUG = 2; |
| 260 | } |
| 261 | // Additional information relevant only for Fast Pair devices. |
| 262 | message FastPairInformation { |
| 263 | // When true, Fast Pair will only create a bond with the device and not |
| 264 | // attempt to connect any profiles (for example, A2DP or HFP). |
| 265 | bool data_only_connection = 1; |
| 266 | |
| 267 | // Additional images that are attached specifically for true wireless Fast |
| 268 | // Pair devices. |
| 269 | TrueWirelessHeadsetImages true_wireless_images = 3; |
| 270 | |
| 271 | // When true, this device can support assistant function. |
| 272 | bool assistant_supported = 4; |
| 273 | |
| 274 | // Features supported by the Fast Pair device. |
| 275 | repeated FastPairFeature features = 5; |
| 276 | |
| 277 | // Optional, the name of the company producing this Fast Pair device. |
| 278 | string company_name = 6; |
| 279 | |
| 280 | // Optional, the type of device. |
| 281 | DeviceType device_type = 7; |
| 282 | |
| 283 | reserved 2; |
| 284 | } |
| 285 | |
| 286 | |
| 287 | enum NearbyType { |
| 288 | NEARBY_TYPE_UNKNOWN = 0; |
| 289 | // Proximity Beacon Service (PBS). This is the only type of nearbyItems which |
| 290 | // can be customized by 3p and therefore the intents passed should not be |
| 291 | // completely trusted. Deprecated already. |
| 292 | NEARBY_PROXIMITY_BEACON = 1; |
| 293 | // Physical Web URL beacon. Deprecated already. |
| 294 | NEARBY_PHYSICAL_WEB = 2; |
| 295 | // Chromecast beacon. Used on client-side only. |
| 296 | NEARBY_CHROMECAST = 3; |
| 297 | // Wear beacon. Used on client-side only. |
| 298 | NEARBY_WEAR = 4; |
| 299 | // A device (e.g. a Magic Pair device that needs to be set up). The special- |
| 300 | // case devices above (e.g. ChromeCast, Wear) might migrate to this type. |
| 301 | NEARBY_DEVICE = 6; |
| 302 | // Popular apps/urls based on user's current geo-location. |
| 303 | NEARBY_POPULAR_HERE = 7; |
| 304 | |
| 305 | reserved 5; |
weicesun | b989a18 | 2021-11-04 14:14:54 -0700 | [diff] [blame] | 306 | } |