Add @UnsupportedAppUsage annotations
For packages:
com.android.internal.app
com.android.internal.database
com.android.internal.http
com.android.internal.os
com.android.internal.policy
com.android.internal.util
com.android.internal.view
com.android.internal.view.menu
com.android.internal.widget
com.android.server.net
com.android.server
com.google.android.collect
com.google.android.util
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: Ia5306f4713298b46ae3aba6fc9d87fae41f8a593
diff --git a/core/java/com/android/internal/util/Preconditions.java b/core/java/com/android/internal/util/Preconditions.java
index 2c6a0e0..731b93c 100644
--- a/core/java/com/android/internal/util/Preconditions.java
+++ b/core/java/com/android/internal/util/Preconditions.java
@@ -18,6 +18,7 @@
import android.annotation.IntRange;
import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
import android.text.TextUtils;
import java.util.Collection;
@@ -28,6 +29,7 @@
*/
public class Preconditions {
+ @UnsupportedAppUsage
public static void checkArgument(boolean expression) {
if (!expression) {
throw new IllegalArgumentException();
@@ -42,6 +44,7 @@
* be converted to a string using {@link String#valueOf(Object)}
* @throws IllegalArgumentException if {@code expression} is false
*/
+ @UnsupportedAppUsage
public static void checkArgument(boolean expression, final Object errorMessage) {
if (!expression) {
throw new IllegalArgumentException(String.valueOf(errorMessage));
@@ -106,6 +109,7 @@
* @return the non-null reference that was validated
* @throws NullPointerException if {@code reference} is null
*/
+ @UnsupportedAppUsage
public static @NonNull <T> T checkNotNull(final T reference) {
if (reference == null) {
throw new NullPointerException();
@@ -123,6 +127,7 @@
* @return the non-null reference that was validated
* @throws NullPointerException if {@code reference} is null
*/
+ @UnsupportedAppUsage
public static @NonNull <T> T checkNotNull(final T reference, final Object errorMessage) {
if (reference == null) {
throw new NullPointerException(String.valueOf(errorMessage));
@@ -158,6 +163,7 @@
* @param message exception message
* @throws IllegalStateException if {@code expression} is false
*/
+ @UnsupportedAppUsage
public static void checkState(final boolean expression, String message) {
if (!expression) {
throw new IllegalStateException(message);
@@ -171,6 +177,7 @@
* @param expression a boolean expression
* @throws IllegalStateException if {@code expression} is false
*/
+ @UnsupportedAppUsage
public static void checkState(final boolean expression) {
checkState(expression, null);
}
@@ -368,6 +375,7 @@
*
* @throws IllegalArgumentException if {@code value} was not within the range
*/
+ @UnsupportedAppUsage
public static int checkArgumentInRange(int value, int lower, int upper,
String valueName) {
if (value < lower) {