diff options
| author | 2021-02-28 21:59:00 -0800 | |
|---|---|---|
| committer | 2021-02-28 21:59:00 -0800 | |
| commit | b0bddd6ac92b941a64683a0c677b29ed2a017708 (patch) | |
| tree | 75a2434d3397fe2934fc670c90990746a0068cb9 | |
| parent | b33721641ed491ab9deff871fa31739ce8b93be6 (diff) | |
AF: Add a passwordsActivity attribute.
This is used to link directly to passwords settings for each autofill
service from system settings.
Bug: 169455298
Test: manual
Change-Id: Id989601203a87d95d443a23b694b6c21785ee549
| -rw-r--r-- | core/api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/service/autofill/AutofillServiceInfo.java | 16 | ||||
| -rw-r--r-- | core/res/res/values/attrs.xml | 3 | ||||
| -rw-r--r-- | core/res/res/values/public.xml | 1 |
4 files changed, 21 insertions, 0 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 8a543de40b18..6f40051443ac 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -1074,6 +1074,7 @@ package android { field public static final int panelTextAppearance = 16842850; // 0x1010062 field public static final int parentActivityName = 16843687; // 0x10103a7 field @Deprecated public static final int password = 16843100; // 0x101015c + field public static final int passwordsActivity = 16844351; // 0x101063f field public static final int path = 16842794; // 0x101002a field public static final int pathAdvancedPattern = 16844320; // 0x1010620 field public static final int pathData = 16843781; // 0x1010405 diff --git a/core/java/android/service/autofill/AutofillServiceInfo.java b/core/java/android/service/autofill/AutofillServiceInfo.java index fbc25a6aaf74..4f7839ce2ce9 100644 --- a/core/java/android/service/autofill/AutofillServiceInfo.java +++ b/core/java/android/service/autofill/AutofillServiceInfo.java @@ -76,6 +76,8 @@ public final class AutofillServiceInfo { @Nullable private final String mSettingsActivity; + @Nullable + private final String mPasswordsActivity; @Nullable private final ArrayMap<String, Long> mCompatibilityPackages; @@ -113,12 +115,14 @@ public final class AutofillServiceInfo { AutofillService.SERVICE_META_DATA); if (parser == null) { mSettingsActivity = null; + mPasswordsActivity = null; mCompatibilityPackages = null; mInlineSuggestionsEnabled = false; return; } String settingsActivity = null; + String passwordsActivity = null; ArrayMap<String, Long> compatibilityPackages = null; boolean inlineSuggestionsEnabled = false; // false by default. @@ -139,6 +143,8 @@ public final class AutofillServiceInfo { com.android.internal.R.styleable.AutofillService); settingsActivity = afsAttributes.getString( R.styleable.AutofillService_settingsActivity); + passwordsActivity = afsAttributes.getString( + R.styleable.AutofillService_passwordsActivity); inlineSuggestionsEnabled = afsAttributes.getBoolean( R.styleable.AutofillService_supportsInlineSuggestions, false); } finally { @@ -155,6 +161,7 @@ public final class AutofillServiceInfo { } mSettingsActivity = settingsActivity; + mPasswordsActivity = passwordsActivity; mCompatibilityPackages = compatibilityPackages; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; } @@ -221,6 +228,7 @@ public final class AutofillServiceInfo { return compatibilityPackages; } + @NonNull public ServiceInfo getServiceInfo() { return mServiceInfo; } @@ -230,6 +238,12 @@ public final class AutofillServiceInfo { return mSettingsActivity; } + @Nullable + public String getPasswordsActivity() { + return mPasswordsActivity; + } + + @Nullable public ArrayMap<String, Long> getCompatibilityPackages() { return mCompatibilityPackages; } @@ -244,6 +258,7 @@ public final class AutofillServiceInfo { builder.append(getClass().getSimpleName()); builder.append("[").append(mServiceInfo); builder.append(", settings:").append(mSettingsActivity); + builder.append(", passwords activity:").append(mPasswordsActivity); builder.append(", hasCompatPckgs:").append(mCompatibilityPackages != null && !mCompatibilityPackages.isEmpty()).append("]"); builder.append(", inline suggestions enabled:").append(mInlineSuggestionsEnabled); @@ -256,6 +271,7 @@ public final class AutofillServiceInfo { public void dump(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("Component: "); pw.println(getServiceInfo().getComponentName()); pw.print(prefix); pw.print("Settings: "); pw.println(mSettingsActivity); + pw.print(prefix); pw.print("Passwords activity: "); pw.println(mPasswordsActivity); pw.print(prefix); pw.print("Compat packages: "); pw.println(mCompatibilityPackages); pw.print(prefix); pw.print("Inline Suggestions Enabled: "); pw.println(mInlineSuggestionsEnabled); diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 735e122444ef..1e96e0ee7c02 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -8434,6 +8434,9 @@ <!-- Fully qualified class name of an activity that allows the user to modify the settings for this service. --> <attr name="settingsActivity" /> + <!-- Fully qualified class name of an activity that allows the user to view any passwords + saved by this service. --> + <attr name="passwordsActivity" format="string" /> <!-- Specifies whether the AutofillService supports inline suggestions--> <attr name="supportsInlineSuggestions" format="boolean" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 9b2573f3d62f..a75a8f7b1345 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -3085,6 +3085,7 @@ <public name="hand_secondTint"/> <public name="hand_secondTintMode"/> <public name="dataExtractionRules"/> + <public name="passwordsActivity"/> </public-group> <public-group type="drawable" first-id="0x010800b5"> |