1 /*
2  * Copyright (C) 2022 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 package com.android.bedstead.harrier.annotations
17 
18 import com.android.bedstead.harrier.AnnotationExecutor
19 
20 /**
21  * Annotation to apply to an annotation outside of Harrier to indicate it should be processed
22  * with a particular [AnnotationExecutor].
23  */
24 @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
25 @Retention(AnnotationRetention.RUNTIME)
26 annotation class UsesAnnotationExecutor(
27 
28     /**
29      * The fully qualified name of the [AnnotationExecutor] to use when parsing this annotation.
30      *
31      * This works even for cases where the annotation needs to be defined in a separate target
32      * to the executor, for example where the annotation cannot be defined in an Android target.
33      */
34     val value: String
35 ) {
36     companion object {
37         const val PERMISSIONS = "com.android.bedstead.permissions.PermissionsAnnotationExecutor"
38         const val ROOT = "com.android.xts.root.RootAnnotationExecutor"
39         const val INTERACTIVE = "com.android.interactive.InteractiveAnnotationExecutor"
40         const val FLAGS = "com.android.bedstead.flags.FlagsAnnotationExecutor"
41         const val MULTI_USER = "com.android.bedstead.multiuser.MultiUserAnnotationExecutor"
42         const val ENTERPRISE = "com.android.bedstead.enterprise.EnterpriseAnnotationExecutor"
43         const val MAIN = "com.android.bedstead.harrier.MainAnnotationExecutor"
44         const val TEST_APPS = "com.android.bedstead.testapps.TestAppsAnnotationExecutor"
45         const val ACCOUNTS = "com.android.bedstead.accounts.AccountsAnnotationExecutor"
46         const val CONTENT_SUGGESTIONS =
47             "com.android.bedstead.contentsuggestions.ContentSuggestionsAnnotationExecutor"
48         const val BLUETOOTH = "com.android.bedstead.bluetooth.BluetoothAnnotationExecutor"
49     }
50 }
51