blob: 9132550f84dd388ada1ec1e27fc989bf27dfe90a [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module chromeos.multidevice.mojom;
import "mojo/public/mojom/base/time.mojom";
// Enumeration of software features which can be enabled/disabled for a given
// device. Each feature has a host and client portion; here, "host" refers to
// the associated phone which provides the feature (at most one host per
// account), and "client" refers to the Chromebook which consumes the feature
// (multiple clients allowed per account).
enum SoftwareFeature {
// The Better Together (MultiDevice) setup flow feature allows users to go
// through a unified setup flow which enrolls the device for all multi-device
// features.
BETTER_TOGETHER_HOST = 1,
BETTER_TOGETHER_CLIENT = 2,
// EasyUnlock gives users the ability to unlock their Chromebooks with their
// phone instead of by typing a password.
EASY_UNLOCK_HOST = 3,
EASY_UNLOCK_CLIENT = 4,
// Magic Tether (Instant Tethering) gives users the ability to use their
// phone's Internet connectivity on their Chromebooks via an automated flow
// which does not require any phone-side interaction.
MAGIC_TETHER_HOST = 5,
MAGIC_TETHER_CLIENT = 6,
// SMS Connect gives users the ability to read and reply to their text
// messages from their Chromebooks.
SMS_CONNECT_HOST = 7,
SMS_CONNECT_CLIENT = 8
};
// Enumeration of what value a SoftwareFeature can be.
enum SoftwareFeatureState {
kNotSupported,
kSupported,
kEnabled
};
// Used to generate rotating BLE advertisement data, which is necessary to
// establish a BLE communication channel between two devices. To
// create the BLE channel, both devices must possess the other's BeaconSeeds.
struct BeaconSeed {
string data;
mojo_base.mojom.Time start_time;
mojo_base.mojom.Time end_time;
};
// Metadata describing a remote device with which the current device can
// communicate.
struct RemoteDevice {
// Unique identifier of the device. This field is guaranteed to be
// human-readable (i.e., it does not contain non-ASCII characters).
string device_id;
// Identifier for the user to whom this device is registered.
string user_id;
// Human-readable device name; by default, this is the name of the device
// model, but this value is editable.
string device_name;
// Encryption key used for communication with this device.
string persistent_symmetric_key;
// The time at which this device's metadata was last updated on the CryptAuth
// back-end.
mojo_base.mojom.Time last_update_time;
// The features which this device either does not support, supports, or has
// enabled.
map<SoftwareFeature, SoftwareFeatureState> software_features;
// Seeds belonging to the device. Each seed has start and end timestamps which
// indicate how long the seed is valid, and each device has enough associated
// seeds to keep the device connectable for over 30 days. If no new device
// metadata synced for over 30 days, it is possible that a connection will not
// be able to be established over BLE.
array<BeaconSeed> beacon_seeds;
};