blob: 62aef675eb5b9353a643bf23f28f91cd59124757 [file] [log] [blame]
// Copyright 2017 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 ash.mojom;
// There is another copy of the VoiceInteractionState definition in
// //components/arc/common/voice_interaction_framework.mojom
// Please also update the other one if you change it.
// The duplicate definition is because we do not use extensible widely
// (
// The initial state is NOT_READY, then it will either becomes STOPPED or
// RUNNING. If the mojo connection is lost, the state will be set back to
enum VoiceInteractionState {
// Voice interaction service is not ready yet, request sent will be waiting.
// Voice interaction session is stopped.
// Voice interaction session is currently running.
enum AssistantAllowedState {
// Assistant feature is allowed.
// Disallowed because ARC++ is disallowed. There could be many specific
// reasones why ARC++ is disallowed. This enum is a catch all. Some enums
// below will show specific reasons.
// Disallowed because ARC++ is disabled by policy.
// Disallowed because user's locale is not compatible.
// Disallowed because the feature flag is off.
// Disallowed because current user is not primary user.
// Disallowed because current user is supervised user.
// Disallowed because incognito mode.
// Disallowed because the device is in demo mode.
// Disallowed because the device is in public session.
// Disallowed because the user's account type is currently not supported.
// Allows observing changes to voice interaction status and settings.
interface VoiceInteractionObserver {
// Called when voice interaction session state changes.
OnVoiceInteractionStatusChanged(VoiceInteractionState state);
// Called when voice interaction is enabled/disabled in settings.
OnVoiceInteractionSettingsEnabled(bool enabled);
// Called when voice interaction service is allowed/disallowed to access
// the "context" (text and graphic content that is currently on screen).
OnVoiceInteractionContextEnabled(bool enabled);
// Called when hotword listening is enabled/disabled.
OnVoiceInteractionHotwordEnabled(bool enabled);
// Called when hotword is set to always on/only with power source.
OnVoiceInteractionHotwordAlwaysOn(bool always_on);
// Called when consent status is updated.
OnVoiceInteractionConsentStatusUpdated(ConsentStatus consent_status);
// Called when assistant feature allowed state has changed.
OnAssistantFeatureAllowedChanged(AssistantAllowedState state);
// Called when locale is changed in pref. The locale is in the format can be
// "en-US" or simply "en". When locale is not set in pref, it returns empty
// string.
OnLocaleChanged(string locale);
// Interface for ash client (Chrome) to connect to the voice interaction
// controller, which notifies changes of voice interaction related flags.
interface VoiceInteractionController {
// Called when the voice interaction state is changed.
NotifyStatusChanged(VoiceInteractionState state);
// Called when the voice interaction settings is enabled/disabled.
NotifySettingsEnabled(bool enabled);
// Called when the voice interaction context is enabled/disabled.
// If context is enabled the screenshot will be passed in voice
// interaction session.
NotifyContextEnabled(bool enabled);
// Called when the hotword listening is enabled/disabled.
NotifyHotwordEnabled(bool enabled);
// Called when the hotword is set to always on/only with power source.
NotifyHotwordAlwaysOn(bool enabled);
// Called when the consent status is obtained from the server.
NotifyConsentStatus(ConsentStatus consent_status);
// Notify if voice interaction feature is allowed or not. e.g. not allowed
// if disabled by policy.
NotifyFeatureAllowed(AssistantAllowedState state);
// Called when the notification is enabled/disabled.
NotifyNotificationEnabled(bool enabled);
// Called when the locale is changed.
NotifyLocaleChanged(string locale);
// Called when the launch with mic open state is changed.
NotifyLaunchWithMicOpen(bool launch_with_mic_open);
// Add an observer.
AddObserver(VoiceInteractionObserver observer);
// The status of the user's consent. The enum values cannot be changed because
// they are persisted on disk.
enum ConsentStatus {
// The status is unknown.
kUnknown = 0,
// The user accepted activity control access.
kActivityControlAccepted = 1,
// The user is not authorized to give consent.
kUnauthorized = 2,
// The user's consent information is not found. This is typically the case
// when consent from the user has never been requested.
kNotFound = 3,