summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Simranjit Kohli <simranjit@google.com> 2025-01-03 02:13:40 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-01-03 02:13:40 -0800
commit42dbd658ca8032e0cf41cbf76f1d998775dc427a (patch)
treedd600648bb78f98887fdb1f69a4f461b5f025e3b
parent8fed0eec70a3d46addf5ff86fde1f40cad582384 (diff)
parent1eb012191302fab6a2163737f9c7519ae1e021c0 (diff)
Merge "[Autofill] Fix getAutofillComponent returning null sometimes" into main
-rw-r--r--services/autofill/bugfixes.aconfig10
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillManagerService.java9
2 files changed, 17 insertions, 2 deletions
diff --git a/services/autofill/bugfixes.aconfig b/services/autofill/bugfixes.aconfig
index ec6c3b7ebf7a..68bb224ad166 100644
--- a/services/autofill/bugfixes.aconfig
+++ b/services/autofill/bugfixes.aconfig
@@ -64,6 +64,16 @@ flag {
}
flag {
+ name: "fix_get_autofill_component"
+ namespace: "autofill"
+ description: "Fix getAutofillComponent returning null, even when user has selected provider"
+ bug: "319503432"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "test_flag"
namespace: "autofill"
description: "Test flag "
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
index cba8c66cd5e3..c68e54956c99 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
@@ -18,6 +18,7 @@ package com.android.server.autofill;
import static android.Manifest.permission.MANAGE_AUTO_FILL;
import static android.content.Context.AUTOFILL_MANAGER_SERVICE;
+import static android.service.autofill.Flags.fixGetAutofillComponent;
import static android.view.autofill.AutofillManager.MAX_TEMP_AUGMENTED_SERVICE_DURATION_MS;
import static android.view.autofill.AutofillManager.getSmartSuggestionModeToString;
@@ -1920,8 +1921,12 @@ public final class AutofillManagerService
try {
synchronized (mLock) {
- final AutofillManagerServiceImpl service =
- peekServiceForUserWithLocalBinderIdentityLocked(userId);
+ final AutofillManagerServiceImpl service;
+ if (fixGetAutofillComponent()) {
+ service = getServiceForUserWithLocalBinderIdentityLocked(userId);
+ } else {
+ service = peekServiceForUserWithLocalBinderIdentityLocked(userId);
+ }
if (service != null) {
componentName = service.getServiceComponentName();
} else if (sVerbose) {