diff options
author | Xin Li <delphij@google.com> | 2024-03-07 06:41:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-03-07 06:41:07 +0000 |
commit | 17dabff1dd38e8f0e08736176a8a587e039e610a (patch) | |
tree | bd40604eb4b00a1a0e63edfe28cb0ebe33f23029 /tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt | |
parent | ded14cc2110e39408f74abac8a83e0a0f16608d2 (diff) | |
parent | 7e8ae158f4a73ee580c468d71ca9a1df6f90a8cd (diff) | |
download | Launcher3-17dabff1dd38e8f0e08736176a8a587e039e610a.tar.gz |
Merge "Merge Android 14 QPR2 to AOSP main" into main
Diffstat (limited to 'tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt')
-rw-r--r-- | tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt b/tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt new file mode 100644 index 0000000000..d6824561c1 --- /dev/null +++ b/tests/src/com/android/launcher3/util/rule/SetFlagsRuleExt.kt @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 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.launcher3.util.rule + +import android.platform.test.flag.junit.SetFlagsRule + +fun SetFlagsRule.setFlags(enabled: Boolean, vararg flagName: String) { + if (enabled) enableFlags(*flagName) else disableFlags(*flagName) +} |