From 4eff26b4235535d49c6d5fbebc3a8fb79ef0660d Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 31 Jan 2017 13:34:19 -0800 Subject: [PATCH] Ignore auto-fill requests from system. Change-Id: I3c318aeb96c1ba7a751feba2a0d9042015eaaffb Fixes: 34819567 Bug: 34171325 Test: could not reproduce --- .../com/android/server/autofill/AutoFillManagerService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/autofill/java/com/android/server/autofill/AutoFillManagerService.java b/services/autofill/java/com/android/server/autofill/AutoFillManagerService.java index 8ce52782d1148..1c1c6651d2b73 100644 --- a/services/autofill/java/com/android/server/autofill/AutoFillManagerService.java +++ b/services/autofill/java/com/android/server/autofill/AutoFillManagerService.java @@ -36,6 +36,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; +import android.os.Process; import android.os.RemoteException; import android.os.ResultReceiver; import android.os.ShellCallback; @@ -288,6 +289,11 @@ public final class AutoFillManagerService extends SystemService { final IBinder activityToken = LocalServices.getService(ActivityManagerInternal.class) .getTopVisibleActivity(uid); if (activityToken == null) { + // TODO(b/33197203, b/34819567, b/34171325): figure out proper way to handle it + if (uid == Process.SYSTEM_UID) { + if (DEBUG) Log.w(TAG, "requestAutoFill(): ignoring call from system"); + return; + } throw new SecurityException("uid " + uid + " does not own the top activity"); }