summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author seokgyun.hong <seokgyun.hong@lge.com> 2024-10-30 17:54:12 +0000
committer Yabin Huang <yabinh@google.com> 2024-10-30 18:04:16 +0000
commitbc78ceb189e7ec9ce765d83e3dd7f311ccb6de94 (patch)
tree94c4788196dc568acdfc83a9ca62390da4af97e6
parent39b34a182982aa7b37eac768a26f86a8b246c811 (diff)
Disallow autofill session for visible background users
Currently, autofill service does not fully support visible background users. Prevent starting autofill sessions for visible background users to avoid issues with their autofill behavior. Bug: 375500806 Test: manual - check that autofill is not working for a visible background user. Flag: EXEMPT bugfix (cherry picked from https://partner-android-review.googlesource.com/q/commit:9489b856d41b15df98a09e2c5e384e041892ade5) Change-Id: Ibe368d7dd01d62ad5ca3e36ea3dd93e02077d7ad
-rw-r--r--services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index c9f892907b59..b52c65054e51 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -92,6 +92,7 @@ import com.android.server.autofill.ui.AutoFillUI;
import com.android.server.contentcapture.ContentCaptureManagerInternal;
import com.android.server.infra.AbstractPerUserSystemService;
import com.android.server.inputmethod.InputMethodManagerInternal;
+import com.android.server.pm.UserManagerInternal;
import com.android.server.wm.ActivityTaskManagerInternal;
import java.io.PrintWriter;
@@ -192,6 +193,8 @@ final class AutofillManagerServiceImpl
private final ContentCaptureManagerInternal mContentCaptureManagerInternal;
+ private final UserManagerInternal mUserManagerInternal;
+
private final DisabledInfoCache mDisabledInfoCache;
AutofillManagerServiceImpl(AutofillManagerService master, Object lock,
@@ -208,6 +211,7 @@ final class AutofillManagerServiceImpl
mInputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class);
mContentCaptureManagerInternal = LocalServices.getService(
ContentCaptureManagerInternal.class);
+ mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
mDisabledInfoCache = disableCache;
updateLocked(disabled);
}
@@ -379,6 +383,13 @@ final class AutofillManagerServiceImpl
return 0;
}
+ // TODO(b/376482880): remove this check once autofill service supports visible
+ // background users.
+ if (mUserManagerInternal.isVisibleBackgroundFullUser(mUserId)) {
+ Slog.d(TAG, "Currently, autofill service does not support visible background users.");
+ return 0;
+ }
+
if (!forAugmentedAutofillOnly && isAutofillDisabledLocked(clientActivity)) {
// Standard autofill is enabled, but service disabled autofill for this activity; that
// means no session, unless the activity is allowlisted for augmented autofill