Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to remove
from the unsupported list.
Bug: 170729553
Test: Treehugger
Change-Id: Id54271252e1a7e9e3ffdfeba8b4eba742bcdae3c
diff --git a/android_icu4j/src/main/java/android/icu/impl/CurrencyData.java b/android_icu4j/src/main/java/android/icu/impl/CurrencyData.java
index 589dfab..608e178 100644
--- a/android_icu4j/src/main/java/android/icu/impl/CurrencyData.java
+++ b/android_icu4j/src/main/java/android/icu/impl/CurrencyData.java
@@ -22,7 +22,7 @@
public class CurrencyData {
public static final CurrencyDisplayInfoProvider provider;
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
private CurrencyData() {}
/**
diff --git a/android_icu4j/src/main/java/android/icu/impl/IllegalIcuArgumentException.java b/android_icu4j/src/main/java/android/icu/impl/IllegalIcuArgumentException.java
index e2f09cc..f83ff5b 100644
--- a/android_icu4j/src/main/java/android/icu/impl/IllegalIcuArgumentException.java
+++ b/android_icu4j/src/main/java/android/icu/impl/IllegalIcuArgumentException.java
@@ -17,7 +17,7 @@
public class IllegalIcuArgumentException extends IllegalArgumentException {
private static final long serialVersionUID = 3789261542830211225L;
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public IllegalIcuArgumentException(String errorMessage) {
super(errorMessage);
}
diff --git a/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java b/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java
index 3c4efbb..d01ae57 100644
--- a/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java
+++ b/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java
@@ -2441,7 +2441,7 @@
* @see android.icu.util.ULocale#ACTUAL_LOCALE
* @hide draft / provisional / internal are hidden on Android
*/
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public final ULocale getLocale(ULocale.Type type) {
return type == ULocale.ACTUAL_LOCALE ?
this.actualLocale : this.validLocale;
diff --git a/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java b/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java
index 0f1f10e..5be5b21 100644
--- a/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java
+++ b/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java
@@ -488,7 +488,7 @@
/*
* default constructor; private because we don't want anyone to use
*/
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
@SuppressWarnings("unused")
private DateIntervalFormat() {
}
diff --git a/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java b/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
index 628145a..294a7cb 100644
--- a/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
+++ b/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
@@ -2730,7 +2730,7 @@
private static class DistanceInfo {
int missingFieldMask;
int extraFieldMask;
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
private DistanceInfo() {
}
void clear() {
diff --git a/android_icu4j/src/main/java/android/icu/text/DecimalFormatSymbols.java b/android_icu4j/src/main/java/android/icu/text/DecimalFormatSymbols.java
index abee02a..eabae71 100644
--- a/android_icu4j/src/main/java/android/icu/text/DecimalFormatSymbols.java
+++ b/android_icu4j/src/main/java/android/icu/text/DecimalFormatSymbols.java
@@ -1874,7 +1874,7 @@
* @see android.icu.util.ULocale#ACTUAL_LOCALE
* @hide draft / provisional / internal are hidden on Android
*/
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public final ULocale getLocale(ULocale.Type type) {
return type == ULocale.ACTUAL_LOCALE ?
this.actualLocale : this.validLocale;
diff --git a/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java b/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java
index 24f4047..6012d44 100644
--- a/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java
+++ b/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java
@@ -1800,7 +1800,7 @@
* {@inheritDoc}
* @hide draft / provisional / internal are hidden on Android
*/
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
@Override
public ULocale getLocale(ULocale.Type type) {
if (type == ULocale.ACTUAL_LOCALE) {
diff --git a/android_icu4j/src/main/java/android/icu/text/SpoofChecker.java b/android_icu4j/src/main/java/android/icu/text/SpoofChecker.java
index 206dcca..dad8c07 100644
--- a/android_icu4j/src/main/java/android/icu/text/SpoofChecker.java
+++ b/android_icu4j/src/main/java/android/icu/text/SpoofChecker.java
@@ -1995,22 +1995,22 @@
// }
// }
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
ScriptSet() {
}
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public void and(int script) {
this.clear(0, script);
this.clear(script + 1, UScript.CODE_LIMIT);
}
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public void setAll() {
this.set(0, UScript.CODE_LIMIT);
}
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public boolean isFull() {
return cardinality() == UScript.CODE_LIMIT;
}
diff --git a/android_icu4j/src/main/java/android/icu/text/TimeZoneNames.java b/android_icu4j/src/main/java/android/icu/text/TimeZoneNames.java
index 67c44be..444d1ae 100644
--- a/android_icu4j/src/main/java/android/icu/text/TimeZoneNames.java
+++ b/android_icu4j/src/main/java/android/icu/text/TimeZoneNames.java
@@ -585,7 +585,7 @@
*/
public static class FactoryImpl extends Factory {
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public FactoryImpl() {
}
diff --git a/android_icu4j/src/main/java/android/icu/text/UFormat.java b/android_icu4j/src/main/java/android/icu/text/UFormat.java
index 114e7d8..d405796 100644
--- a/android_icu4j/src/main/java/android/icu/text/UFormat.java
+++ b/android_icu4j/src/main/java/android/icu/text/UFormat.java
@@ -76,7 +76,7 @@
* @see android.icu.util.ULocale#ACTUAL_LOCALE
* @hide draft / provisional / internal are hidden on Android
*/
- @android.compat.annotation.UnsupportedAppUsage
+ @android.compat.annotation.UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
public final ULocale getLocale(ULocale.Type type) {
return type == ULocale.ACTUAL_LOCALE ?
this.actualLocale : this.validLocale;
diff --git a/tools/srcgen/unsupported-app-usage.json b/tools/srcgen/unsupported-app-usage.json
index a1971db..1e3be1c 100644
--- a/tools/srcgen/unsupported-app-usage.json
+++ b/tools/srcgen/unsupported-app-usage.json
@@ -2,7 +2,9 @@
// syntax.
[
{
- "@location": "method:android.icu.impl.CurrencyData#CurrencyData()"
+ "@location": "method:android.icu.impl.CurrencyData#CurrencyData()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
"@location": "method:android.icu.impl.ICUResourceBundle#getULocale()"
@@ -11,7 +13,9 @@
"@location": "method:android.icu.impl.ICUResourceBundle#getWithFallback(String)"
},
{
- "@location": "method:android.icu.impl.IllegalIcuArgumentException#IllegalIcuArgumentException(String)"
+ "@location": "method:android.icu.impl.IllegalIcuArgumentException#IllegalIcuArgumentException(String)",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
"@location": "method:android.icu.text.ArabicShaping#ArabicShaping(int)"
@@ -32,37 +36,59 @@
"@location": "method:android.icu.text.ArabicShaping#shape(String)"
},
{
- "@location": "method:android.icu.text.DateFormatSymbols#getLocale(ULocale.Type)"
+ "@location": "method:android.icu.text.DateFormatSymbols#getLocale(ULocale.Type)",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.DateIntervalFormat#DateIntervalFormat()"
+ "@location": "method:android.icu.text.DateIntervalFormat#DateIntervalFormat()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.DateTimePatternGenerator$DistanceInfo#DistanceInfo()"
+ "@location": "method:android.icu.text.DateTimePatternGenerator$DistanceInfo#DistanceInfo()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.DecimalFormatSymbols#getLocale(ULocale.Type)"
+ "@location": "method:android.icu.text.DecimalFormatSymbols#getLocale(ULocale.Type)",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.RuleBasedCollator#getLocale(ULocale.Type)"
+ "@location": "method:android.icu.text.RuleBasedCollator#getLocale(ULocale.Type)",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.SpoofChecker$ScriptSet#ScriptSet()"
+ "@location": "method:android.icu.text.SpoofChecker$ScriptSet#ScriptSet()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.SpoofChecker$ScriptSet#and(int)"
+ "@location": "method:android.icu.text.SpoofChecker$ScriptSet#and(int)",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.SpoofChecker$ScriptSet#isFull()"
+ "@location": "method:android.icu.text.SpoofChecker$ScriptSet#isFull()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.SpoofChecker$ScriptSet#setAll()"
+ "@location": "method:android.icu.text.SpoofChecker$ScriptSet#setAll()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.TimeZoneNames$DefaultTimeZoneNames$FactoryImpl#FactoryImpl()"
+ "@location": "method:android.icu.text.TimeZoneNames$DefaultTimeZoneNames$FactoryImpl#FactoryImpl()",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
- "@location": "method:android.icu.text.UFormat#getLocale(ULocale.Type)"
+ "@location": "method:android.icu.text.UFormat#getLocale(ULocale.Type)",
+ "maxTargetSdk": 30,
+ "trackingBug": 170729553
},
{
"@location": "method:android.icu.util.Calendar#getLocale(ULocale.Type)"