// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module ash.cellular_setup.mojom;
import "mojo/public/mojom/base/string16.mojom";
// Represents the current state of an ESimProfile
enum ProfileState {
kPending, // Profile is not installed on the device.
kInstalling, // Profile is being installed.
kInactive, // Profile is installed but inactive.
kActive, // Profile is installed and active.
};
// Result codes for ESimProfile installation.
enum ProfileInstallResult {
kSuccess, // Installation succeeded.
kFailure, // Installation failed.
kErrorNeedsConfirmationCode, // Installation requires a valid
// confirmation code.
kErrorInvalidActivationCode, // Given activation code is invalid.
};
// Represents the method used for eSIM profile installation attempts.
enum ProfileInstallMethod {
kViaSmds,
kViaQrCodeAfterSmds,
kViaQrCodeSkippedSmds,
kViaActivationCodeAfterSmds,
kViaActivationCodeSkippedSmds,
};
// Result code for operations on Euicc and ESimProfile.
enum ESimOperationResult {
kSuccess, // Operation succeeded.
kFailure // Operation failed.
};
// Properties for an Euicc object.
struct EuiccProperties {
// A 32 digit unique id for the Euicc.
string eid;
// Boolean indicating whether the Euicc is active or not.
bool is_active;
};
// Properties of an eSIM profile object.
struct ESimProfileProperties {
// EID of the Euicc in which this profile is installed or available for
// installation.
string eid;
// A 19-20 character long numeric id that uniquely identifies this profile.
string iccid;
// Service provider’s name for this profile. e.g. “Verizon Plan 1”
mojo_base.mojom.String16 name;
// A user configurable nickname for this profile. e.g. “My Personal SIM”
mojo_base.mojom.String16 nickname;
// Name of the service provider. e.g. “Verizon Wireless”
mojo_base.mojom.String16 service_provider;
// State of the profile
ProfileState state;
// An alphanumeric code that can be used to install this profile.
string activation_code;
};
// Represents a QRCode image.
struct QRCode {
// Width and height (which are equal) of the generated QR Code image in
// number of tiles.
uint8 size;
// QRCode image data. This is an array of bytes representing tiles in the
// QRCode in row major order. Values can be 0 or 1 where 1 indicates that
// the corresponding tile should be filled.
array<uint8> data;
};
// ESimManagerObserver is implemented by any module that
// needs to observe changes to the eSIM module.
interface ESimManagerObserver {
// Called when a new Euicc is added or removed from the system.
OnAvailableEuiccListChanged();
// Called when a new eSIM profile is added to or removed from
// the |euicc|.
OnProfileListChanged(pending_remote<Euicc> euicc);
// Called when an Euicc object's active state changes.
OnEuiccChanged(pending_remote<Euicc> euicc);
// Called when an eSIM profile’s state or nickname changes.
OnProfileChanged(pending_remote<ESimProfile> profile);
};
// ESimManager interface provides eSIM management methods. An instance
// of this interface is owned in the browser process in Ash. It will be
// accessed from WebUI or System UI code in the browser process.
interface ESimManager {
// Adds an observer for eSIM changes.
AddObserver(pending_remote<ESimManagerObserver> observer);
// Returns a list of Euiccs available on the device.
GetAvailableEuiccs() => (array<pending_remote<Euicc>> euiccs);
};
// Euicc interface represents an EUICC (Embedded Universal Integrated Circuit
// Card) hardware available on the device and provides operations on the EUICC.
// Each Euicc may have multiple ESimProfiles installed/pending under it.
// Instances of this interface are owned in the browser process in Ash. They
// will be accessed from WebUI or System UI code in the browser process.
interface Euicc {
// Returns properties struct for this Euicc.
GetProperties() => (EuiccProperties properties);
// Returns a list of all profiles installed or pending on this Euicc.
// An empty list could be returned if there are no installed or pending
// profiles on the Euicc.
GetProfileList() => (array<pending_remote<ESimProfile>> profiles);
// Performs SM-DS scans against verified SM-DS servers and requests all
// profiles available for this device. This method will return the combined
// list of all profiles found across all SM-DS servers.
RequestAvailableProfiles() =>
(ESimOperationResult result, array<ESimProfileProperties> profiles);
// Refreshes the list of profiles installed on this EUICC. This operation
// will also update the cache of profiles that Chrome uses for the UI.
RefreshInstalledProfiles() => (ESimOperationResult result);
// Installs a profile with given |activation_code| and |confirmation_code|
// on this Euicc. Returns the result code and ESimProfile that was just
// installed. A non-success result code is returned in case of errors.
// |activation_code| may be obtained from ESimProfiles retrieved with a
// previous call to RequestPendingProfiles or directly from the user through
// a QR code. If |confirmation_code| is required but not supplied or if it’s
// invalid then a kErrorNeedsConfirmationCode result is returned. The
// |install_method| value indicates the method used for this installation
// attempt, e.g. via QR code.
InstallProfileFromActivationCode(string activation_code,
string confirmation_code,
ProfileInstallMethod install_method) =>
(ProfileInstallResult result, pending_remote<ESimProfile>? profile);
// Returns a QR Code image representing the EID of this Euicc. A null value is
// returned if the QR Code could not be generated.
GetEidQRCode() => (QRCode? qr_code);
};
// ESimProfile interface represents and eSIM profile and provides operations
// on the profile.
interface ESimProfile {
// Returns properties struct for this ESimProfile.
GetProperties() => (ESimProfileProperties properties);
// Installs this eSIM profile with given |confirmation_code|.
// A non success result code is returned in case of errors.
InstallProfile(string confirmation_code) => (ProfileInstallResult result);
// Uninstalls this eSIM profile. Returns the result code for the operation.
UninstallProfile() => (ESimOperationResult result);
// Sets a nickname for this eSIM profile. Returns the result code for the
// operation.
SetProfileNickname(mojo_base.mojom.String16 nickname) =>
(ESimOperationResult result);
};