summaryrefslogtreecommitdiff
path: root/core/java/android/annotation/SystemService.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2017-06-02 17:36:26 -0600
committerJeff Sharkey <jsharkey@android.com>2017-06-05 13:27:11 -0600
commitd86b8fea43ebb6e5c31691b44d8ceb0d8d3c9072 (patch)
tree547566f25eb693f99c48ff9afd81fafaef44e435 /core/java/android/annotation/SystemService.java
parent373ab72112a652982bf51bb3f50b0678065be0aa (diff)
Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher) permissions, so annotate common methods with @RequiresPermission to make automatic verification easier. Verification is really only relevant when calling into system services (where permissions checking can happen on the other side of a Binder call), so annotate managers with the new @SystemService annotation, which is now automatically documented. This is purely a docs change; no logic changes are being made. Test: make -j32 update-api && make -j32 offline-sdk-docs Bug: 62263906 Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
Diffstat (limited to 'core/java/android/annotation/SystemService.java')
-rw-r--r--core/java/android/annotation/SystemService.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/core/java/android/annotation/SystemService.java b/core/java/android/annotation/SystemService.java
new file mode 100644
index 000000000000..ba5002a4f1b5
--- /dev/null
+++ b/core/java/android/annotation/SystemService.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 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 android.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+import android.content.Context;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Description of a system service available through
+ * {@link Context#getSystemService(Class)}.
+ *
+ * @hide
+ */
+@Retention(SOURCE)
+@Target(TYPE)
+public @interface SystemService {
+ String value();
+}