summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt2
-rw-r--r--api/system-current.txt2
-rw-r--r--api/test-current.txt2
-rw-r--r--core/java/android/service/autofill/SaveInfo.java12
-rw-r--r--core/res/res/values/strings.xml4
-rw-r--r--core/res/res/values/symbols.xml2
-rw-r--r--services/autofill/java/com/android/server/autofill/ui/SaveUi.java6
7 files changed, 30 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index 64d49a27597f..37316eeec519 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -37068,8 +37068,10 @@ package android.service.autofill {
field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR;
field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2
field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3
+ field public static final int SAVE_DATA_TYPE_EMAIL_ADDRESS = 5; // 0x5
field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0
field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1
+ field public static final int SAVE_DATA_TYPE_USERNAME = 4; // 0x4
}
public static final class SaveInfo.Builder {
diff --git a/api/system-current.txt b/api/system-current.txt
index 995778688337..0f2a7684a19a 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -40133,8 +40133,10 @@ package android.service.autofill {
field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR;
field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2
field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3
+ field public static final int SAVE_DATA_TYPE_EMAIL_ADDRESS = 5; // 0x5
field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0
field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1
+ field public static final int SAVE_DATA_TYPE_USERNAME = 4; // 0x4
}
public static final class SaveInfo.Builder {
diff --git a/api/test-current.txt b/api/test-current.txt
index e2aaee971899..af23843565d7 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -37226,8 +37226,10 @@ package android.service.autofill {
field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR;
field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2
field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3
+ field public static final int SAVE_DATA_TYPE_EMAIL_ADDRESS = 5; // 0x5
field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0
field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1
+ field public static final int SAVE_DATA_TYPE_USERNAME = 4; // 0x4
}
public static final class SaveInfo.Builder {
diff --git a/core/java/android/service/autofill/SaveInfo.java b/core/java/android/service/autofill/SaveInfo.java
index 95608a54a72c..f75b7afe4c46 100644
--- a/core/java/android/service/autofill/SaveInfo.java
+++ b/core/java/android/service/autofill/SaveInfo.java
@@ -129,6 +129,16 @@ public final class SaveInfo implements Parcelable {
*/
public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3;
+ /**
+ * Type used when the {@link FillResponse} represents just an username, without a password.
+ */
+ public static final int SAVE_DATA_TYPE_USERNAME = 4;
+
+ /**
+ * Type used when the {@link FillResponse} represents just an email address, without a password.
+ */
+ public static final int SAVE_DATA_TYPE_EMAIL_ADDRESS = 5;
+
private final @SaveDataType int mType;
private final CharSequence mNegativeActionTitle;
private final IntentSender mNegativeActionListener;
@@ -222,6 +232,8 @@ public final class SaveInfo implements Parcelable {
case SAVE_DATA_TYPE_PASSWORD:
case SAVE_DATA_TYPE_ADDRESS:
case SAVE_DATA_TYPE_CREDIT_CARD:
+ case SAVE_DATA_TYPE_USERNAME:
+ case SAVE_DATA_TYPE_EMAIL_ADDRESS:
mType = type;
break;
default:
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index bf2f355efe52..459b48fc5423 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -4602,6 +4602,10 @@
<string name="autofill_save_type_address">address</string>
<!-- Label for the type of data being saved for autofill when it represents a credit card [CHAR LIMIT=NONE] -->
<string name="autofill_save_type_credit_card">credit card</string>
+ <!-- Label for the type of data being saved for autofill when it represents an username [CHAR LIMIT=NONE] -->
+ <string name="autofill_save_type_username">username</string>
+ <!-- Label for the type of data being saved for autofill when it represents an email address [CHAR LIMIT=NONE] -->
+ <string name="autofill_save_type_email_address">email address</string>
<!-- Primary ETWS (Earthquake and Tsunami Warning System) default message for earthquake -->
<string name="etws_primary_default_message_earthquake">Stay calm and seek shelter nearby.</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index c12116a22b16..fa13fbf93267 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2883,6 +2883,8 @@
<java-symbol type="string" name="autofill_save_type_password" />
<java-symbol type="string" name="autofill_save_type_address" />
<java-symbol type="string" name="autofill_save_type_credit_card" />
+ <java-symbol type="string" name="autofill_save_type_username" />
+ <java-symbol type="string" name="autofill_save_type_email_address" />
<!-- Accessibility fingerprint gestures -->
<java-symbol type="string" name="capability_title_canCaptureFingerprintGestures" />
diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
index 509351bf0858..2c08afadf10b 100644
--- a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
@@ -117,6 +117,12 @@ final class SaveUi {
case SaveInfo.SAVE_DATA_TYPE_CREDIT_CARD:
type = context.getString(R.string.autofill_save_type_credit_card);
break;
+ case SaveInfo.SAVE_DATA_TYPE_USERNAME:
+ type = context.getString(R.string.autofill_save_type_username);
+ break;
+ case SaveInfo.SAVE_DATA_TYPE_EMAIL_ADDRESS:
+ type = context.getString(R.string.autofill_save_type_email_address);
+ break;
default:
type = null;
}