1 /*
2  * Copyright (C) 2021 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 
17 package com.android.systemui.flags
18 
19 import android.util.Dumpable
20 
21 /**
22  * Class to manage simple DeviceConfig-based feature flags.
23  *
24  * See [Flags] for instructions on defining new flags.
25  */
26 interface FeatureFlagsClassic : FeatureFlags
27 
28 /**
29  * Class to manage simple DeviceConfig-based feature flags.
30  *
31  * See [Flags] for instructions on defining new flags.
32  */
33 @Deprecated(
34     message = "Use FeatureFlagsClassic instead.",
35     replaceWith =
36         ReplaceWith(
37             "FeatureFlagsClassic",
38             "com.android.systemui.flags.FeatureFlagsClassic",
39         ),
40 )
41 interface FeatureFlags : FlagListenable, Dumpable {
42     /** Returns a boolean value for the given flag.  */
isEnablednull43     fun isEnabled(flag: UnreleasedFlag): Boolean
44 
45     /** Returns a boolean value for the given flag.  */
46     fun isEnabled(flag: ReleasedFlag): Boolean
47 
48     /** Returns a boolean value for the given flag.  */
49     fun isEnabled(flag: ResourceBooleanFlag): Boolean
50 
51     /** Returns a boolean value for the given flag.  */
52     fun isEnabled(flag: SysPropBooleanFlag): Boolean
53 
54     /** Returns a string value for the given flag.  */
55     fun getString(flag: StringFlag): String
56 
57     /** Returns a string value for the given flag.  */
58     fun getString(flag: ResourceStringFlag): String
59 
60     /** Returns an int value for a given flag/ */
61     fun getInt(flag: IntFlag): Int
62 
63     /** Returns an int value for a given flag/ */
64     fun getInt(flag: ResourceIntFlag): Int
65 }