From 5acd1295169a85eabeef9af83a4c38b521b70608 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 23 Nov 2018 16:01:32 +0000 Subject: Annotate repackaged API with @UnsupportedAppUsage Adds @UnsupportedAppUsage annotations to the parts of libphonenumber that are in the hidden API. Allows the libphonenumber entries to be removed from the frameworks/base/config/hiddenapi-light-greylist.txt. The build rule had to be changed to depend (by default) on the core.platform.api.stubs as UnsupportedAppUsage annotation is not present in the core_current API. This was tested by making and then manually checking that the generated out/target/common/obj/PACKAGING/hiddenapi-light-greylist.txt was the same (after sorting) before and after this change. Bug: 117818301 Test: see above Change-Id: Ic8c6a424a083b1a6c567126b93f49ce10f4e5f93 --- .../android/i18n/phonenumbers/geocoding/PhoneNumberOfflineGeocoder.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'repackaged/geocoder/src/com/android/i18n/phonenumbers') diff --git a/repackaged/geocoder/src/com/android/i18n/phonenumbers/geocoding/PhoneNumberOfflineGeocoder.java b/repackaged/geocoder/src/com/android/i18n/phonenumbers/geocoding/PhoneNumberOfflineGeocoder.java index 4070f802..55d41c60 100644 --- a/repackaged/geocoder/src/com/android/i18n/phonenumbers/geocoding/PhoneNumberOfflineGeocoder.java +++ b/repackaged/geocoder/src/com/android/i18n/phonenumbers/geocoding/PhoneNumberOfflineGeocoder.java @@ -54,6 +54,7 @@ public class PhoneNumberOfflineGeocoder { * * @return a {@link PhoneNumberOfflineGeocoder} instance */ + @dalvik.annotation.compat.UnsupportedAppUsage public static synchronized PhoneNumberOfflineGeocoder getInstance() { if (instance == null) { instance = new PhoneNumberOfflineGeocoder(MAPPING_DATA_DIRECTORY); @@ -187,6 +188,7 @@ public class PhoneNumberOfflineGeocoder { * @return a text description for the given language code for the given phone number, or empty * string if the number passed in is invalid or could belong to multiple countries */ + @dalvik.annotation.compat.UnsupportedAppUsage public String getDescriptionForNumber(PhoneNumber number, Locale languageCode) { PhoneNumberType numberType = phoneUtil.getNumberType(number); if (numberType == PhoneNumberType.UNKNOWN) { -- cgit v1.2.3