summaryrefslogtreecommitdiff
path: root/repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2018-11-23 16:01:32 +0000
committerPaul Duffin <paulduffin@google.com>2018-11-27 14:35:45 +0000
commit5acd1295169a85eabeef9af83a4c38b521b70608 (patch)
treebd2fb389af023f80012d7d29908ba6ae7786e357 /repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java
parente8874970e9dd490105aba5f0ecb7374316329c1f (diff)
downloadlibphonenumber-5acd1295169a85eabeef9af83a4c38b521b70608.tar.gz
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
Diffstat (limited to 'repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java')
-rw-r--r--repackaged/libphonenumber/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java4
1 files changed, 4 insertions, 0 deletions
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;