• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 FeatureFlags : FlagListenable, Dumpable {
27     /** Returns a boolean value for the given flag.  */
isEnablednull28     fun isEnabled(flag: UnreleasedFlag): Boolean
29 
30     /** Returns a boolean value for the given flag.  */
31     fun isEnabled(flag: ReleasedFlag): Boolean
32 
33     /** Returns a boolean value for the given flag.  */
34     fun isEnabled(flag: ResourceBooleanFlag): Boolean
35 
36     /** Returns a boolean value for the given flag.  */
37     fun isEnabled(flag: SysPropBooleanFlag): Boolean
38 
39     /** Returns a string value for the given flag.  */
40     fun getString(flag: StringFlag): String
41 
42     /** Returns a string value for the given flag.  */
43     fun getString(flag: ResourceStringFlag): String
44 
45     /** Returns an int value for a given flag/ */
46     fun getInt(flag: IntFlag): Int
47 
48     /** Returns an int value for a given flag/ */
49     fun getInt(flag: ResourceIntFlag): Int
50 }
51