Skip to content

Commit 5e41bb5

Browse files
SeokgyunHongAndroid Build Coastguard Worker
authored andcommitted
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) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:bc78ceb189e7ec9ce765d83e3dd7f311ccb6de94) Merged-In: Ibe368d7dd01d62ad5ca3e36ea3dd93e02077d7ad Change-Id: Ibe368d7dd01d62ad5ca3e36ea3dd93e02077d7ad
1 parent 15f7f44 commit 5e41bb5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
import com.android.server.contentcapture.ContentCaptureManagerInternal;
9393
import com.android.server.infra.AbstractPerUserSystemService;
9494
import com.android.server.inputmethod.InputMethodManagerInternal;
95+
import com.android.server.pm.UserManagerInternal;
9596
import com.android.server.wm.ActivityTaskManagerInternal;
9697

9798
import java.io.PrintWriter;
@@ -192,6 +193,8 @@ final class AutofillManagerServiceImpl
192193

193194
private final ContentCaptureManagerInternal mContentCaptureManagerInternal;
194195

196+
private final UserManagerInternal mUserManagerInternal;
197+
195198
private final DisabledInfoCache mDisabledInfoCache;
196199

197200
AutofillManagerServiceImpl(AutofillManagerService master, Object lock,
@@ -208,6 +211,7 @@ final class AutofillManagerServiceImpl
208211
mInputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class);
209212
mContentCaptureManagerInternal = LocalServices.getService(
210213
ContentCaptureManagerInternal.class);
214+
mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
211215
mDisabledInfoCache = disableCache;
212216
updateLocked(disabled);
213217
}
@@ -379,6 +383,13 @@ long startSessionLocked(@NonNull IBinder activityToken, int taskId, int clientUi
379383
return 0;
380384
}
381385

386+
// TODO(b/376482880): remove this check once autofill service supports visible
387+
// background users.
388+
if (mUserManagerInternal.isVisibleBackgroundFullUser(mUserId)) {
389+
Slog.d(TAG, "Currently, autofill service does not support visible background users.");
390+
return 0;
391+
}
392+
382393
if (!forAugmentedAutofillOnly && isAutofillDisabledLocked(clientActivity)) {
383394
// Standard autofill is enabled, but service disabled autofill for this activity; that
384395
// means no session, unless the activity is allowlisted for augmented autofill

0 commit comments

Comments
 (0)