1 /*
2  * Copyright (C) 2023 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 android.platform.test.flag.junit;
18 
19 /** A Fake Flags to test the {@code AconfigFlagsValueProvider}. */
20 public class Flags {
21 
22     public static final String FLAG_FLAG_NAME3 = "android.platform.test.flag.junit.flag_name3";
23     public static final String FLAG_FLAG_NAME4 = "android.platform.test.flag.junit.flag_name4";
24     public static final String FLAG_RO_ENABLED = "android.platform.test.flag.junit.ro_enabled";
25     public static final String FLAG_RO_DISABLED = "android.platform.test.flag.junit.ro_disabled";
26 
27     /** Returns the flag value. */
flagName3()28     public static boolean flagName3() {
29         return FEATURE_FLAGS.flagName3();
30     }
31 
32     /** Another flag. */
flagName4()33     public static boolean flagName4() {
34         return FEATURE_FLAGS.flagName4();
35     }
36 
roEnabled()37     public static boolean roEnabled() {
38         return true;
39     }
40 
roDisabled()41     public static boolean roDisabled() {
42         return false;
43     }
44 
setFeatureFlags(FeatureFlags featureFlagsImpl)45     public static void setFeatureFlags(FeatureFlags featureFlagsImpl) {
46         FEATURE_FLAGS = featureFlagsImpl;
47     }
48 
49     private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
50 }
51