aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOussama Ben Abdelbaki <obenabde@google.com>2019-01-14 15:39:08 -0500
committerOussama Ben Abdelbaki <obenabde@google.com>2019-01-16 17:31:27 -0500
commit080cbee3cea754b06f798cdb62fc727799302b76 (patch)
tree7ae9b99945bb00b15fb258bd4cb8a18e55c40fb9
parentb40f97802785d3e3b8a0e10894e28848e8fb418f (diff)
downloadsupport-080cbee3cea754b06f798cdb62fc727799302b76.tar.gz
Add LIBRARY_GROUP_PREFIX RestrictTo scope
Test: n/a Bug: 122839181 Change-Id: I6ad31052fc2ef9f5fd84d6534eda83f5020500ed
-rw-r--r--annotations/api/1.1.0-alpha01.txt1
-rw-r--r--annotations/api/current.txt1
-rw-r--r--annotations/src/main/java/androidx/annotation/RestrictTo.java14
3 files changed, 16 insertions, 0 deletions
diff --git a/annotations/api/1.1.0-alpha01.txt b/annotations/api/1.1.0-alpha01.txt
index d0f8e56f8aa..30c0941c545 100644
--- a/annotations/api/1.1.0-alpha01.txt
+++ b/annotations/api/1.1.0-alpha01.txt
@@ -167,6 +167,7 @@ package androidx.annotation {
enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP_PREFIX;
enum_constant public static final androidx.annotation.RestrictTo.Scope SUBCLASSES;
enum_constant public static final androidx.annotation.RestrictTo.Scope TESTS;
}
diff --git a/annotations/api/current.txt b/annotations/api/current.txt
index d0f8e56f8aa..30c0941c545 100644
--- a/annotations/api/current.txt
+++ b/annotations/api/current.txt
@@ -167,6 +167,7 @@ package androidx.annotation {
enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
+ enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP_PREFIX;
enum_constant public static final androidx.annotation.RestrictTo.Scope SUBCLASSES;
enum_constant public static final androidx.annotation.RestrictTo.Scope TESTS;
}
diff --git a/annotations/src/main/java/androidx/annotation/RestrictTo.java b/annotations/src/main/java/androidx/annotation/RestrictTo.java
index 7ed41d76cc2..ef7b24399ad 100644
--- a/annotations/src/main/java/androidx/annotation/RestrictTo.java
+++ b/annotations/src/main/java/androidx/annotation/RestrictTo.java
@@ -69,6 +69,20 @@ public @interface RestrictTo {
LIBRARY_GROUP,
/**
+ * Restrict usage to code within packages whose groups share
+ * the same library group prefix up to the last ".", so for
+ * example libraries foo.bar:lib1 amd foo.baz:lib2 share
+ * the prefix "foo." and so they can use each other's
+ * apis that are restricted to this scope. Similarly for
+ * com.foo.bar:lib1 and com.foo.baz:lib2 where they share
+ * "com.foo.". Library com.bar.qux:lib3 however will not
+ * be able to use the restricted api because it only
+ * shares the prefix "foo." and not all the way until the
+ * last ".".
+ */
+ LIBRARY_GROUP_PREFIX,
+
+ /**
* Restrict usage to code within the same group ID (based on gradle
* group ID). This is an alias for {@link #LIBRARY_GROUP}.
*