blob: 95c97f89deab5ab5e200aa132154f520d45b3553 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.settings;
/// Modify or watch Night Mode setting. Night mode puts the device in a
/// restricted mode which can be overrided if the user prefers. During night
/// mode, the following settings apply as per night mode parameters:
/// 1. DoNotDisturb is enabled/not.
/// 2. System volume is set to an override maximum.
/// 3. LED Brightness is set to an overridable maximum.
/// 4. Sleep mode is enabled/not.
///
/// Supported SettingsEpitaph enums:
/// REQUEST_NOT_SUPPORTED, INTERNAL_SERVICE_ERROR, PERSISTENT_STORAGE_ERROR
@discoverable
closed protocol NightMode {
/// Gets the current [`NightModeSettings`]. Returns immediately on first
/// call; subsequent calls return when the values change.
///
/// If this call fails, it is considered a fatal error and the channel
/// will be closed.
strict Watch() -> (struct {
settings NightModeSettings;
});
/// Sets [`NightModeSettings`] settings. Any field not explicitly set in
/// the table performs a no-op, and will not make any changes.
strict Set(struct {
settings NightModeSettings;
}) -> () error Error;
};
/// Settings related to Night mode.
type NightModeSettings = table {
/// If true, the device/user have opted in for NightMode routine.
1: night_mode_enabled bool;
};