| // 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] |
| 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. |
| Watch() -> (NightModeSettings settings); |
| |
| /// Sets [`NightModeSettings`] settings. Any field not explicitly set in |
| /// the table performs a no-op, and will not make any changes. |
| Set(NightModeSettings settings) -> () error Error; |
| }; |
| |
| /// Settings related to Night mode. |
| table NightModeSettings { |
| /// If true, the device/user have opted in for NightMode routine. |
| 1: bool night_mode_enabled; |
| }; |