diff options
11 files changed, 359 insertions, 26 deletions
@@ -32,7 +32,7 @@ java_library_static { "repackaged/internal/prefixmapper/src/**/*.java", ], - sdk_version: "core_current", + no_framework_libs: true, java_version: "1.7", } 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) { diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java index 7d3e6fee..1fe8a5a6 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java @@ -266,6 +266,7 @@ public class AsYouTypeFormatter { /** * Clears the internal state of the formatter, so it can be reused. */ + @dalvik.annotation.compat.UnsupportedAppUsage public void clear() { currentOutput = ""; accruedInput.setLength(0); @@ -298,6 +299,7 @@ public class AsYouTypeFormatter { * be shown as they are. * @return the partially formatted phone number. */ + @dalvik.annotation.compat.UnsupportedAppUsage public String inputDigit(char nextChar) { currentOutput = inputDigitWithOptionToRememberPosition(nextChar, false); return currentOutput; @@ -309,6 +311,7 @@ public class AsYouTypeFormatter { * position will be automatically adjusted if additional formatting characters are later * inserted/removed in front of {@code nextChar}. */ + @dalvik.annotation.compat.UnsupportedAppUsage public String inputDigitAndRememberPosition(char nextChar) { currentOutput = inputDigitWithOptionToRememberPosition(nextChar, true); return currentOutput; @@ -449,6 +452,7 @@ public class AsYouTypeFormatter { * Returns the current position in the partially formatted phone number of the character which was * previously passed in as the parameter of {@link #inputDigitAndRememberPosition}. */ + @dalvik.annotation.compat.UnsupportedAppUsage public int getRememberedPosition() { if (!ableToFormat) { return originalPosition; diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/NumberParseException.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/NumberParseException.java index 7307502f..71f3d1f6 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/NumberParseException.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/NumberParseException.java @@ -26,7 +26,7 @@ public class NumberParseException extends Exception { /** * The reason that a string could not be interpreted as a phone number. - * @hide This class is not part of the Android public SDK API + * @hide This class is not part of the Android public SDK API */ public enum ErrorType { /** @@ -68,6 +68,7 @@ public class NumberParseException extends Exception { /** * Returns the error type of the exception that has been thrown. */ + @dalvik.annotation.compat.UnsupportedAppUsage public ErrorType getErrorType() { return errorType; } diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberMatch.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberMatch.java index 18bc76bb..ace0a924 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberMatch.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberMatch.java @@ -81,21 +81,25 @@ public final class PhoneNumberMatch { } /** Returns the phone number matched by the receiver. */ + @dalvik.annotation.compat.UnsupportedAppUsage public PhoneNumber number() { return number; } /** Returns the start index of the matched phone number within the searched text. */ + @dalvik.annotation.compat.UnsupportedAppUsage public int start() { return start; } /** Returns the exclusive end index of the matched phone number within the searched text. */ + @dalvik.annotation.compat.UnsupportedAppUsage public int end() { return start + rawString.length(); } /** Returns the raw string matched as a phone number in the searched text. */ + @dalvik.annotation.compat.UnsupportedAppUsage public String rawString() { return rawString; } diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java index e2eb31e6..dfed4561 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/PhoneNumberUtil.java @@ -392,43 +392,58 @@ public class PhoneNumberUtil { * * Note: If you are considering storing the number in a neutral format, you are highly advised to * use the PhoneNumber class. - * @hide This class is not part of the Android public SDK API + * @hide This class is not part of the Android public SDK API */ public enum PhoneNumberFormat { + @dalvik.annotation.compat.UnsupportedAppUsage E164, + @dalvik.annotation.compat.UnsupportedAppUsage INTERNATIONAL, + @dalvik.annotation.compat.UnsupportedAppUsage NATIONAL, + @dalvik.annotation.compat.UnsupportedAppUsage RFC3966 } /** * Type of phone numbers. - * @hide This class is not part of the Android public SDK API + * @hide This class is not part of the Android public SDK API */ public enum PhoneNumberType { + @dalvik.annotation.compat.UnsupportedAppUsage FIXED_LINE, + @dalvik.annotation.compat.UnsupportedAppUsage MOBILE, // In some regions (e.g. the USA), it is impossible to distinguish between fixed-line and // mobile numbers by looking at the phone number itself. + @dalvik.annotation.compat.UnsupportedAppUsage FIXED_LINE_OR_MOBILE, // Freephone lines + @dalvik.annotation.compat.UnsupportedAppUsage TOLL_FREE, + @dalvik.annotation.compat.UnsupportedAppUsage PREMIUM_RATE, // The cost of this call is shared between the caller and the recipient, and is hence typically // less than PREMIUM_RATE calls. See // http://en.wikipedia.org/wiki/Shared_Cost_Service for // more information. + @dalvik.annotation.compat.UnsupportedAppUsage SHARED_COST, // Voice over IP numbers. This includes TSoIP (Telephony Service over IP). + @dalvik.annotation.compat.UnsupportedAppUsage VOIP, // A personal number is associated with a particular person, and may be routed to either a // MOBILE or FIXED_LINE number. Some more information can be found here: // http://en.wikipedia.org/wiki/Personal_Numbers + @dalvik.annotation.compat.UnsupportedAppUsage PERSONAL_NUMBER, + @dalvik.annotation.compat.UnsupportedAppUsage PAGER, // Used for "Universal Access Numbers" or "Company Numbers". They may be further routed to // specific offices, but allow one number to be used for a company. + @dalvik.annotation.compat.UnsupportedAppUsage UAN, // Used for "Voice Mail Access Numbers". + @dalvik.annotation.compat.UnsupportedAppUsage VOICEMAIL, // A phone number is of type UNKNOWN when it does not fit any of the known patterns for a // specific region. @@ -437,22 +452,28 @@ public class PhoneNumberUtil { /** * Types of phone number matches. See detailed description beside the isNumberMatch() method. - * @hide This class is not part of the Android public SDK API + * @hide This class is not part of the Android public SDK API */ public enum MatchType { + @dalvik.annotation.compat.UnsupportedAppUsage NOT_A_NUMBER, + @dalvik.annotation.compat.UnsupportedAppUsage NO_MATCH, + @dalvik.annotation.compat.UnsupportedAppUsage SHORT_NSN_MATCH, + @dalvik.annotation.compat.UnsupportedAppUsage NSN_MATCH, + @dalvik.annotation.compat.UnsupportedAppUsage EXACT_MATCH, } /** * Possible outcomes when testing if a PhoneNumber is possible. - * @hide This class is not part of the Android public SDK API + * @hide This class is not part of the Android public SDK API */ public enum ValidationResult { /** The number length matches that of valid numbers for this region. */ + @dalvik.annotation.compat.UnsupportedAppUsage IS_POSSIBLE, /** * The number length matches that of local numbers for this region only (i.e. numbers that may @@ -473,19 +494,21 @@ public class PhoneNumberUtil { */ INVALID_LENGTH, /** The number is longer than all valid numbers for this region. */ + @dalvik.annotation.compat.UnsupportedAppUsage TOO_LONG, } /** * Leniency when {@linkplain PhoneNumberUtil#findNumbers finding} potential phone numbers in text * segments. The levels here are ordered in increasing strictness. - * @hide This class is not part of the Android public SDK API + * @hide This class is not part of the Android public SDK API */ public enum Leniency { /** * Phone numbers accepted are {@linkplain PhoneNumberUtil#isPossibleNumber(PhoneNumber) * possible}, but not necessarily {@linkplain PhoneNumberUtil#isValidNumber(PhoneNumber) valid}. */ + @dalvik.annotation.compat.UnsupportedAppUsage POSSIBLE { @Override boolean verify(PhoneNumber number, CharSequence candidate, PhoneNumberUtil util) { @@ -1079,6 +1102,7 @@ public class PhoneNumberUtil { * * @return a PhoneNumberUtil instance */ + @dalvik.annotation.compat.UnsupportedAppUsage public static synchronized PhoneNumberUtil getInstance() { if (instance == null) { setInstance(createInstance(MetadataManager.DEFAULT_METADATA_LOADER)); @@ -1182,6 +1206,7 @@ public class PhoneNumberUtil { * @param numberFormat the format the phone number should be formatted into * @return the formatted phone number */ + @dalvik.annotation.compat.UnsupportedAppUsage public String format(PhoneNumber number, PhoneNumberFormat numberFormat) { if (number.getNationalNumber() == 0 && number.hasRawInput()) { // Unparseable numbers that kept their raw input just use that. @@ -1561,6 +1586,7 @@ public class PhoneNumberUtil { * has one * @return the formatted phone number in its original number format */ + @dalvik.annotation.compat.UnsupportedAppUsage public String formatInOriginalFormat(PhoneNumber number, String regionCallingFrom) { if (number.hasRawInput() && !hasFormattingPatternForNumber(number)) { // We check if we have the formatting pattern because without that, we might format the number @@ -1812,6 +1838,7 @@ public class PhoneNumberUtil { * @param number the phone number for which the national significant number is needed * @return the national significant number of the PhoneNumber object passed in */ + @dalvik.annotation.compat.UnsupportedAppUsage public String getNationalSignificantNumber(PhoneNumber number) { // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix. StringBuilder nationalNumber = new StringBuilder(); @@ -2155,6 +2182,7 @@ public class PhoneNumberUtil { * @param number the phone number that we want to know the type * @return the type of the phone number, or UNKNOWN if it is invalid */ + @dalvik.annotation.compat.UnsupportedAppUsage public PhoneNumberType getNumberType(PhoneNumber number) { String regionCode = getRegionCodeForNumber(number); PhoneMetadata metadata = getMetadataForRegionOrCallingCode(number.getCountryCode(), regionCode); @@ -2254,6 +2282,7 @@ public class PhoneNumberUtil { * @param number the phone number that we want to validate * @return a boolean that indicates whether the number is of a valid pattern */ + @dalvik.annotation.compat.UnsupportedAppUsage public boolean isValidNumber(PhoneNumber number) { String regionCode = getRegionCodeForNumber(number); return isValidNumberForRegion(number, regionCode); @@ -2298,6 +2327,7 @@ public class PhoneNumberUtil { * @return the region where the phone number is from, or null if no region matches this calling * code */ + @dalvik.annotation.compat.UnsupportedAppUsage public String getRegionCodeForNumber(PhoneNumber number) { int countryCode = number.getCountryCode(); List<String> regions = countryCallingCodeToRegionCodeMap.get(countryCode); @@ -2362,6 +2392,7 @@ public class PhoneNumberUtil { * @param regionCode the region that we want to get the country calling code for * @return the country calling code for the region denoted by regionCode */ + @dalvik.annotation.compat.UnsupportedAppUsage public int getCountryCodeForRegion(String regionCode) { if (!isValidRegionCode(regionCode)) { logger.log(Level.WARNING, @@ -2465,6 +2496,7 @@ public class PhoneNumberUtil { * @param number the number that needs to be checked * @return true if the number is possible */ + @dalvik.annotation.compat.UnsupportedAppUsage public boolean isPossibleNumber(PhoneNumber number) { ValidationResult result = isPossibleNumberWithReason(number); return result == ValidationResult.IS_POSSIBLE @@ -2593,6 +2625,7 @@ public class PhoneNumberUtil { * @param number the number that needs to be checked * @return a ValidationResult object which indicates whether the number is possible */ + @dalvik.annotation.compat.UnsupportedAppUsage public ValidationResult isPossibleNumberWithReason(PhoneNumber number) { return isPossibleNumberForTypeWithReason(number, PhoneNumberType.UNKNOWN); } @@ -2702,6 +2735,7 @@ public class PhoneNumberUtil { * @return an {@link com.android.i18n.phonenumbers.AsYouTypeFormatter} object, which can be used * to format phone numbers in the specific region "as you type" */ + @dalvik.annotation.compat.UnsupportedAppUsage public AsYouTypeFormatter getAsYouTypeFormatter(String regionCode) { return new AsYouTypeFormatter(regionCode); } @@ -3097,6 +3131,7 @@ public class PhoneNumberUtil { * This is to cover degenerate cases where the text has a lot of false positives in it. Must * be {@code >= 0}. */ + @dalvik.annotation.compat.UnsupportedAppUsage public Iterable<PhoneNumberMatch> findNumbers( final CharSequence text, final String defaultRegion, final Leniency leniency, final long maxTries) { @@ -3343,6 +3378,7 @@ public class PhoneNumberUtil { * @return NO_MATCH, SHORT_NSN_MATCH, NSN_MATCH or EXACT_MATCH depending on the level of equality * of the two numbers, described in the method definition. */ + @dalvik.annotation.compat.UnsupportedAppUsage public MatchType isNumberMatch(PhoneNumber firstNumberIn, PhoneNumber secondNumberIn) { // We only care about the fields that uniquely define a number, so we copy these across // explicitly. diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonemetadata.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonemetadata.java index a4a70d95..145af6fa 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonemetadata.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonemetadata.java @@ -39,9 +39,9 @@ import java.io.ObjectOutput; public final class Phonemetadata { private Phonemetadata() {} /** - * @hide This class is not part of the Android public SDK API - */ -public static class NumberFormat implements Externalizable { + * @hide This class is not part of the Android public SDK API + */ + public static class NumberFormat implements Externalizable { private static final long serialVersionUID = 1; public NumberFormat() {} @@ -87,6 +87,7 @@ public static class NumberFormat implements Externalizable { private boolean hasPattern; private String pattern_ = ""; public boolean hasPattern() { return hasPattern; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getPattern() { return pattern_; } public NumberFormat setPattern(String value) { hasPattern = true; @@ -98,6 +99,7 @@ public static class NumberFormat implements Externalizable { private boolean hasFormat; private String format_ = ""; public boolean hasFormat() { return hasFormat; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getFormat() { return format_; } public NumberFormat setFormat(String value) { hasFormat = true; @@ -110,7 +112,9 @@ public static class NumberFormat implements Externalizable { public java.util.List<String> leadingDigitPatterns() { return leadingDigitsPattern_; } + @dalvik.annotation.compat.UnsupportedAppUsage public int leadingDigitsPatternSize() { return leadingDigitsPattern_.size(); } + @dalvik.annotation.compat.UnsupportedAppUsage public String getLeadingDigitsPattern(int index) { return leadingDigitsPattern_.get(index); } @@ -126,6 +130,7 @@ public static class NumberFormat implements Externalizable { private boolean hasNationalPrefixFormattingRule; private String nationalPrefixFormattingRule_ = ""; public boolean hasNationalPrefixFormattingRule() { return hasNationalPrefixFormattingRule; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getNationalPrefixFormattingRule() { return nationalPrefixFormattingRule_; } public NumberFormat setNationalPrefixFormattingRule(String value) { hasNationalPrefixFormattingRule = true; @@ -156,6 +161,7 @@ public static class NumberFormat implements Externalizable { private String domesticCarrierCodeFormattingRule_ = ""; public boolean hasDomesticCarrierCodeFormattingRule() { return hasDomesticCarrierCodeFormattingRule; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getDomesticCarrierCodeFormattingRule() { return domesticCarrierCodeFormattingRule_; } public NumberFormat setDomesticCarrierCodeFormattingRule(String value) { @@ -202,9 +208,9 @@ public static class NumberFormat implements Externalizable { } /** - * @hide This class is not part of the Android public SDK API - */ -public static class PhoneNumberDesc implements Externalizable { + * @hide This class is not part of the Android public SDK API + */ + public static class PhoneNumberDesc implements Externalizable { private static final long serialVersionUID = 1; public PhoneNumberDesc() {} @@ -244,6 +250,7 @@ public static class PhoneNumberDesc implements Externalizable { private boolean hasNationalNumberPattern; private String nationalNumberPattern_ = ""; public boolean hasNationalNumberPattern() { return hasNationalNumberPattern; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getNationalNumberPattern() { return nationalNumberPattern_; } public PhoneNumberDesc setNationalNumberPattern(String value) { hasNationalNumberPattern = true; @@ -361,9 +368,9 @@ public static class PhoneNumberDesc implements Externalizable { } /** - * @hide This class is not part of the Android public SDK API - */ -public static class PhoneMetadata implements Externalizable { + * @hide This class is not part of the Android public SDK API + */ + public static class PhoneMetadata implements Externalizable { private static final long serialVersionUID = 1; public PhoneMetadata() {} @@ -386,6 +393,7 @@ public static class PhoneMetadata implements Externalizable { private boolean hasGeneralDesc; private PhoneNumberDesc generalDesc_ = null; public boolean hasGeneralDesc() { return hasGeneralDesc; } + @dalvik.annotation.compat.UnsupportedAppUsage public PhoneNumberDesc getGeneralDesc() { return generalDesc_; } public PhoneMetadata setGeneralDesc(PhoneNumberDesc value) { if (value == null) { @@ -635,6 +643,7 @@ public static class PhoneMetadata implements Externalizable { private boolean hasCountryCode; private int countryCode_ = 0; public boolean hasCountryCode() { return hasCountryCode; } + @dalvik.annotation.compat.UnsupportedAppUsage public int getCountryCode() { return countryCode_; } public PhoneMetadata setCountryCode(int value) { hasCountryCode = true; @@ -672,6 +681,7 @@ public static class PhoneMetadata implements Externalizable { // optional string national_prefix = 12; private boolean hasNationalPrefix; private String nationalPrefix_ = ""; + @dalvik.annotation.compat.UnsupportedAppUsage public boolean hasNationalPrefix() { return hasNationalPrefix; } public String getNationalPrefix() { return nationalPrefix_; } public PhoneMetadata setNationalPrefix(String value) { @@ -688,7 +698,9 @@ public static class PhoneMetadata implements Externalizable { // optional string preferred_extn_prefix = 13; private boolean hasPreferredExtnPrefix; private String preferredExtnPrefix_ = ""; + @dalvik.annotation.compat.UnsupportedAppUsage public boolean hasPreferredExtnPrefix() { return hasPreferredExtnPrefix; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getPreferredExtnPrefix() { return preferredExtnPrefix_; } public PhoneMetadata setPreferredExtnPrefix(String value) { hasPreferredExtnPrefix = true; @@ -705,6 +717,7 @@ public static class PhoneMetadata implements Externalizable { private boolean hasNationalPrefixForParsing; private String nationalPrefixForParsing_ = ""; public boolean hasNationalPrefixForParsing() { return hasNationalPrefixForParsing; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getNationalPrefixForParsing() { return nationalPrefixForParsing_; } public PhoneMetadata setNationalPrefixForParsing(String value) { hasNationalPrefixForParsing = true; @@ -716,6 +729,7 @@ public static class PhoneMetadata implements Externalizable { private boolean hasNationalPrefixTransformRule; private String nationalPrefixTransformRule_ = ""; public boolean hasNationalPrefixTransformRule() { return hasNationalPrefixTransformRule; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getNationalPrefixTransformRule() { return nationalPrefixTransformRule_; } public PhoneMetadata setNationalPrefixTransformRule(String value) { hasNationalPrefixTransformRule = true; @@ -746,6 +760,7 @@ public static class PhoneMetadata implements Externalizable { // repeated NumberFormat number_format = 19; private java.util.List<NumberFormat> numberFormat_ = new java.util.ArrayList<NumberFormat>(); + @dalvik.annotation.compat.UnsupportedAppUsage public java.util.List<NumberFormat> numberFormats() { return numberFormat_; } @@ -764,6 +779,7 @@ public static class PhoneMetadata implements Externalizable { // repeated NumberFormat intl_number_format = 20; private java.util.List<NumberFormat> intlNumberFormat_ = new java.util.ArrayList<NumberFormat>(); + @dalvik.annotation.compat.UnsupportedAppUsage public java.util.List<NumberFormat> intlNumberFormats() { return intlNumberFormat_; } @@ -1134,10 +1150,11 @@ public static class PhoneMetadata implements Externalizable { } /** - * @hide This class is not part of the Android public SDK API - */ -public static class PhoneMetadataCollection implements Externalizable { + * @hide This class is not part of the Android public SDK API + */ + public static class PhoneMetadataCollection implements Externalizable { private static final long serialVersionUID = 1; + @dalvik.annotation.compat.UnsupportedAppUsage public PhoneMetadataCollection() {} /** @@ -1158,6 +1175,7 @@ public static class PhoneMetadataCollection implements Externalizable { // repeated PhoneMetadata metadata = 1; private java.util.List<PhoneMetadata> metadata_ = new java.util.ArrayList<PhoneMetadata>(); + @dalvik.annotation.compat.UnsupportedAppUsage public java.util.List<PhoneMetadata> getMetadataList() { return metadata_; } diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonenumber.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonenumber.java index b69af997..dbdb1d23 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonenumber.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/Phonenumber.java @@ -31,17 +31,21 @@ import java.io.Serializable; public final class Phonenumber { private Phonenumber() {} /** - * @hide This class is not part of the Android public SDK API - */ -public static class PhoneNumber implements Serializable { + * @hide This class is not part of the Android public SDK API + */ + public static class PhoneNumber implements Serializable { private static final long serialVersionUID = 1L; /** * @hide This class is not part of the Android public SDK API */ public enum CountryCodeSource { + @dalvik.annotation.compat.UnsupportedAppUsage FROM_NUMBER_WITH_PLUS_SIGN, + @dalvik.annotation.compat.UnsupportedAppUsage FROM_NUMBER_WITH_IDD, + @dalvik.annotation.compat.UnsupportedAppUsage FROM_NUMBER_WITHOUT_PLUS_SIGN, + @dalvik.annotation.compat.UnsupportedAppUsage FROM_DEFAULT_COUNTRY, UNSPECIFIED } @@ -53,13 +57,16 @@ public static class PhoneNumber implements Serializable { // required int32 country_code = 1; private boolean hasCountryCode; private int countryCode_ = 0; + @dalvik.annotation.compat.UnsupportedAppUsage public boolean hasCountryCode() { return hasCountryCode; } + @dalvik.annotation.compat.UnsupportedAppUsage public int getCountryCode() { return countryCode_; } public PhoneNumber setCountryCode(int value) { hasCountryCode = true; countryCode_ = value; return this; } + @dalvik.annotation.compat.UnsupportedAppUsage public PhoneNumber clearCountryCode() { hasCountryCode = false; countryCode_ = 0; @@ -70,6 +77,7 @@ public static class PhoneNumber implements Serializable { private boolean hasNationalNumber; private long nationalNumber_ = 0L; public boolean hasNationalNumber() { return hasNationalNumber; } + @dalvik.annotation.compat.UnsupportedAppUsage public long getNationalNumber() { return nationalNumber_; } public PhoneNumber setNationalNumber(long value) { hasNationalNumber = true; @@ -85,7 +93,9 @@ public static class PhoneNumber implements Serializable { // optional string extension = 3; private boolean hasExtension; private java.lang.String extension_ = ""; + @dalvik.annotation.compat.UnsupportedAppUsage public boolean hasExtension() { return hasExtension; } + @dalvik.annotation.compat.UnsupportedAppUsage public String getExtension() { return extension_; } public PhoneNumber setExtension(String value) { if (value == null) { @@ -156,6 +166,7 @@ public static class PhoneNumber implements Serializable { private boolean hasCountryCodeSource; private CountryCodeSource countryCodeSource_; public boolean hasCountryCodeSource() { return hasCountryCodeSource; } + @dalvik.annotation.compat.UnsupportedAppUsage public CountryCodeSource getCountryCodeSource() { return countryCodeSource_; } public PhoneNumber setCountryCodeSource(CountryCodeSource value) { if (value == null) { diff --git a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/ShortNumberInfo.java b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/ShortNumberInfo.java index ea2f29c6..a09b9228 100644 --- a/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/ShortNumberInfo.java +++ b/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/ShortNumberInfo.java @@ -59,7 +59,7 @@ public class ShortNumberInfo { } /** Cost categories of short numbers. - * @hide This class is not part of the Android public SDK API*/ + * @hide This class is not part of the Android public SDK API*/ public enum ShortNumberCost { TOLL_FREE, STANDARD_RATE, diff --git a/srcgen/generate_android_src.sh b/srcgen/generate_android_src.sh index c5589ea3..2f569c09 100755 --- a/srcgen/generate_android_src.sh +++ b/srcgen/generate_android_src.sh @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -if [ -z "$ANDROID_BUILD_TOP" ]; then - echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" 1>&2 +if [[ -z "${ANDROID_BUILD_TOP}" ]]; then + echo "Missing environment variables. Did you run build/envsetup.sh and lunch?" >&2 exit 1 fi @@ -24,6 +24,8 @@ PROJECT_DIR=${ANDROID_BUILD_TOP}/external/libphonenumber cd ${ANDROID_BUILD_TOP} make -j15 currysrc +UNSUPPORTED_APP_USAGE_FILE=${PROJECT_DIR}/srcgen/unsupported-app-usage.json + function do_transform() { local SRC_IN_DIR=$1 local SRC_OUT_DIR=$2 @@ -38,7 +40,10 @@ function do_transform() { java -cp ${CLASSPATH} com.google.currysrc.aosp.RepackagingTransform \ --source-dir ${SRC_IN_DIR} \ --target-dir ${SRC_OUT_DIR} \ - --package-transformation "com.google:com.android" + --package-transformation "com.google:com.android" \ + --tab-size 2 \ + --unsupported-app-usage-file ${UNSUPPORTED_APP_USAGE_FILE} \ + } REPACKAGED_DIR=${PROJECT_DIR}/repackaged diff --git a/srcgen/unsupported-app-usage.json b/srcgen/unsupported-app-usage.json new file mode 100644 index 00000000..d7cace6f --- /dev/null +++ b/srcgen/unsupported-app-usage.json @@ -0,0 +1,252 @@ +// See com.google.currysrc.aosp.Annotations.addUnsupportedAppUsage(Path) method for details on the +// syntax. +[ + { + "@location": "method:com.android.i18n.phonenumbers.AsYouTypeFormatter#clear()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.AsYouTypeFormatter#getRememberedPosition()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.AsYouTypeFormatter#inputDigit(char)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.AsYouTypeFormatter#inputDigitAndRememberPosition(char)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder#getDescriptionForNumber(PhoneNumber,Locale)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder#getInstance()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.NumberParseException#getErrorType()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$NumberFormat#getDomesticCarrierCodeFormattingRule()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$NumberFormat#getFormat()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$NumberFormat#getLeadingDigitsPattern(int)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$NumberFormat#getNationalPrefixFormattingRule()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$NumberFormat#getPattern()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$NumberFormat#leadingDigitsPatternSize()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#getCountryCode()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#getGeneralDesc()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#getNationalPrefixForParsing()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#getNationalPrefixTransformRule()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#getPreferredExtnPrefix()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#hasNationalPrefix()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#hasPreferredExtnPrefix()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#intlNumberFormats()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadata#numberFormats()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadataCollection#PhoneMetadataCollection()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneMetadataCollection#getMetadataList()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonemetadata$PhoneNumberDesc#getNationalNumberPattern()" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber$CountryCodeSource#FROM_DEFAULT_COUNTRY" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber$CountryCodeSource#FROM_NUMBER_WITHOUT_PLUS_SIGN" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber$CountryCodeSource#FROM_NUMBER_WITH_IDD" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber$CountryCodeSource#FROM_NUMBER_WITH_PLUS_SIGN" + }, + // Synthetic enum methods cannot yet be handled using annotations and so are maintained in the + // frameworks/base/config/hiddenapi-light-greylist.txt + // { + // "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber$CountryCodeSource#val2ues()" + // }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#clearCountryCode()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#getCountryCode()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#getCountryCodeSource()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#getExtension()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#getNationalNumber()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#hasCountryCode()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.Phonenumber$PhoneNumber#hasExtension()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberMatch#end()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberMatch#number()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberMatch#rawString()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberMatch#start()" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$Leniency#POSSIBLE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$MatchType#EXACT_MATCH" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$MatchType#NOT_A_NUMBER" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$MatchType#NO_MATCH" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$MatchType#NSN_MATCH" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$MatchType#SHORT_NSN_MATCH" + }, + // Synthetic enum methods cannot yet be handled using annotations and so are maintained in the + // frameworks/base/config/hiddenapi-light-greylist.txt + // { + // "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil$MatchType#values()" + // }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat#E164" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat#INTERNATIONAL" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat#NATIONAL" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat#RFC3966" + }, + // Synthetic enum methods cannot yet be handled using annotations and so are maintained in the + // frameworks/base/config/hiddenapi-light-greylist.txt + // { + // "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberFormat#values()" + // }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#FIXED_LINE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#FIXED_LINE_OR_MOBILE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#MOBILE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#PAGER" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#PERSONAL_NUMBER" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#PREMIUM_RATE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#SHARED_COST" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#TOLL_FREE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#UAN" + }, + // Synthetic enum methods cannot yet be handled using annotations and so are maintained in the + // frameworks/base/config/hiddenapi-light-greylist.txt + // { + // "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#values()" + // }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#VOICEMAIL" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$PhoneNumberType#VOIP" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$ValidationResult#IS_POSSIBLE" + }, + { + "@location": "enumConstant:com.android.i18n.phonenumbers.PhoneNumberUtil$ValidationResult#TOO_LONG" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#findNumbers(CharSequence,String,Leniency,long)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#format(PhoneNumber,PhoneNumberFormat)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#formatInOriginalFormat(PhoneNumber,String)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#getAsYouTypeFormatter(String)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#getCountryCodeForRegion(String)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#getInstance()" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#getNationalSignificantNumber(PhoneNumber)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#getNumberType(PhoneNumber)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#getRegionCodeForNumber(PhoneNumber)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#isNumberMatch(PhoneNumber,PhoneNumber)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#isPossibleNumber(PhoneNumber)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#isPossibleNumberWithReason(PhoneNumber)" + }, + { + "@location": "method:com.android.i18n.phonenumbers.PhoneNumberUtil#isValidNumber(PhoneNumber)" + } +]
\ No newline at end of file |