blob: a5734ecc3782a7446a309f5e24e8802745b62bda [file] [log] [blame]
// Copyright 2018 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.setui;
enum ReturnCode {
OK = 0;
FAILED = 1;
UNSUPPORTED = 2;
};
struct SettingsObject {
SettingType setting_type;
SettingData data;
};
struct UpdateResponse {
ReturnCode return_code;
};
struct MutationResponse {
ReturnCode return_code;
};
// The main interface for UIs to change system settings. Currently, the
// settings are scoped to the device, but will eventually be scoped to the user
// as is applicable.
[Discoverable]
interface SetUiService {
// Begins listening to changes to a given settings object. This may cause the
// SetUiService to connect to any applicable device services until all listeners
// for a given type are closed.
// The service will call the listener with the current state immediately on
// initialization.
1: Listen(SettingType settingType, SettingListener listener);
// Sets the value of a given settings object. Returns once operation
// has completed.
2: Update(SettingsObject value) -> (UpdateResponse response);
3: Mutate(SettingType settingType, Mutation mutation) -> (MutationResponse response);
4: InteractiveMutate(SettingType settingType, Mutation mutation, MutationHandles mutation_handles) -> (MutationResponse response);
};
interface SettingListener {
1: Notify(SettingsObject object);
};