Loading packages/SystemUI/Android.bp +16 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,16 @@ java_library { srcs: ["src/com/android/systemui/EventLogTags.logtags"], } filegroup { name: "ReleaseJavaFiles", srcs: ["src/com/android/systemui/flags/FeatureFlagManager.java"], } filegroup { name: "DebugJavaFiles", srcs: ["src-debug/com/android/systemui/flags/FeatureFlagManager.java"], } android_library { name: "SystemUI-core", srcs: [ Loading @@ -57,6 +67,12 @@ android_library { "src/**/*.java", "src/**/I*.aidl", ], product_variables: { debuggable: { srcs: [":DebugJavaFiles"], exclude_srcs: [":ReleaseJavaFiles"], }, }, resource_dirs: [ "res-product", "res-keyguard", Loading packages/SystemUI/src-debug/com/android/systemui/flags/FeatureFlagManager.java 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.flags; import android.util.ArraySet; import com.android.systemui.dagger.SysUISingleton; /** * Concrete implementation of the a Flag manager that returns default values for debug builds */ @SysUISingleton public class FeatureFlagManager { public boolean isEnabled(int key, boolean defaultValue) { return isEnabled(Integer.toString(key), defaultValue); } public boolean isEnabled(String key, boolean defaultValue) { // TODO return false; } public void setEnabled(int key, boolean value) { setEnabled(Integer.toString(key), value); } public void setEnabled(String key, boolean value) { // TODO } } No newline at end of file packages/SystemUI/src/com/android/systemui/flags/FeatureFlagManager.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.flags; import com.android.systemui.dagger.SysUISingleton; /** * Default implementation of the a Flag manager that returns default values for release builds */ @SysUISingleton public class FeatureFlagManager { public boolean getBoolean(int key, boolean defaultValue) { return defaultValue; } public void setBoolean(int key, boolean value) {} public boolean getBoolean(String key, boolean defaultValue) { return defaultValue; } public void setBoolean(String key, boolean value) {} public void addFlagChangedListener(Runnable run) {} public void removeFlagUpdatedListener(Runnable run) {} } Loading
packages/SystemUI/Android.bp +16 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,16 @@ java_library { srcs: ["src/com/android/systemui/EventLogTags.logtags"], } filegroup { name: "ReleaseJavaFiles", srcs: ["src/com/android/systemui/flags/FeatureFlagManager.java"], } filegroup { name: "DebugJavaFiles", srcs: ["src-debug/com/android/systemui/flags/FeatureFlagManager.java"], } android_library { name: "SystemUI-core", srcs: [ Loading @@ -57,6 +67,12 @@ android_library { "src/**/*.java", "src/**/I*.aidl", ], product_variables: { debuggable: { srcs: [":DebugJavaFiles"], exclude_srcs: [":ReleaseJavaFiles"], }, }, resource_dirs: [ "res-product", "res-keyguard", Loading
packages/SystemUI/src-debug/com/android/systemui/flags/FeatureFlagManager.java 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.flags; import android.util.ArraySet; import com.android.systemui.dagger.SysUISingleton; /** * Concrete implementation of the a Flag manager that returns default values for debug builds */ @SysUISingleton public class FeatureFlagManager { public boolean isEnabled(int key, boolean defaultValue) { return isEnabled(Integer.toString(key), defaultValue); } public boolean isEnabled(String key, boolean defaultValue) { // TODO return false; } public void setEnabled(int key, boolean value) { setEnabled(Integer.toString(key), value); } public void setEnabled(String key, boolean value) { // TODO } } No newline at end of file
packages/SystemUI/src/com/android/systemui/flags/FeatureFlagManager.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.flags; import com.android.systemui.dagger.SysUISingleton; /** * Default implementation of the a Flag manager that returns default values for release builds */ @SysUISingleton public class FeatureFlagManager { public boolean getBoolean(int key, boolean defaultValue) { return defaultValue; } public void setBoolean(int key, boolean value) {} public boolean getBoolean(String key, boolean defaultValue) { return defaultValue; } public void setBoolean(String key, boolean value) {} public void addFlagChangedListener(Runnable run) {} public void removeFlagUpdatedListener(Runnable run) {} }