1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.tv.config;
18
19/**
20 * Manages Live TV Configuration, allowing remote updates.
21 *
22 * <p>This is a thin wrapper around
23 * <a href="https://firebase.google.com/docs/remote-config/"></a>Firebase Remote Config</a>
24 */
25public interface RemoteConfig {
26
27    /**
28     * Notified on successful completion of a {@link #fetch)}
29     */
30    interface OnRemoteConfigUpdatedListener {
31        void onRemoteConfigUpdated();
32    }
33
34    /**
35     * Starts a fetch and notifies {@code listener} on successful completion.
36     */
37    void fetch(OnRemoteConfigUpdatedListener listener);
38
39    /**
40     * Gets value as a string corresponding to the specified key.
41     */
42    String getString(String key);
43
44    /**
45     * Gets value as a boolean corresponding to the specified key.
46     */
47    boolean getBoolean(String key);
48
49    /** Gets value as a long corresponding to the specified key. */
50    long getLong(String key);
51}
52