blob: 5641cfc4959dd2dffce8a14ad5df3b5e69ab677d [file] [log] [blame]
Aurimas Liutikasdc3f8852024-07-11 10:07:48 -07001/*
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 */
16package android.annotation;
17
18import static java.lang.annotation.ElementType.METHOD;
19import static java.lang.annotation.RetentionPolicy.CLASS;
20
21import java.lang.annotation.Retention;
22import java.lang.annotation.Target;
23
24/**
25 * Denotes that the annotated method validates permissions manually.
26 * <p>
27 * This explicit annotation helps distinguish which of states an
28 * element may exist in:
29 * <ul>
30 * <li>Annotated with {@link EnforcePermission}, indicating that an element
31 * strictly requires one or more permissions. The verification occurs within
32 * the annotated element.
33 * <li>Annotated with {@link RequiresNoPermission}, indicating that an element
34 * requires no permissions.
35 * <li>Annotated with {@link PermissionManuallyEnforced}, indicating that the
36 * element requires some kind of permission which cannot be described using the
37 * other annotations.
38 * </ul>
39 *
40 * @see EnforcePermission
41 * @see RequiresNoPermission
42 * @hide
43 */
44@Retention(CLASS)
45@Target({METHOD})
46public @interface PermissionManuallyEnforced {
47}