Merge "67002586: Create @NavigationRes + Lint check" into oc-mr1-support-27.0-dev
am: bd7f9492be
Change-Id: If8184ae9e605a75aee8b3d1911f7f6d9086dc919
diff --git a/annotations/api/current.txt b/annotations/api/current.txt
index c52f7e1..901e8f7 100644
--- a/annotations/api/current.txt
+++ b/annotations/api/current.txt
@@ -93,6 +93,9 @@
public abstract class MenuRes implements java.lang.annotation.Annotation {
}
+ public abstract class NavigationRes implements java.lang.annotation.Annotation {
+ }
+
public abstract class NonNull implements java.lang.annotation.Annotation {
}
diff --git a/annotations/src/android/support/annotation/NavigationRes.java b/annotations/src/android/support/annotation/NavigationRes.java
new file mode 100644
index 0000000..a051026
--- /dev/null
+++ b/annotations/src/android/support/annotation/NavigationRes.java
@@ -0,0 +1,36 @@
+/*
+ * 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.support.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.CLASS;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Denotes that an integer parameter, field or method return value is expected
+ * to be a navigation resource reference (e.g. {@code R.navigation.flow}).
+ */
+@Documented
+@Retention(CLASS)
+@Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE})
+public @interface NavigationRes {
+}