From 7441ed4601200c3405d7386b37e903393e7ad5f5 Mon Sep 17 00:00:00 2001 From: Simranjit Kohli Date: Mon, 8 May 2023 20:27:59 -0700 Subject: [PATCH] [Autofill PCC]: Fix SaveInfo IllegalArgumentException Don't create SaveInfo if there are no eligible autofill ids. Test: atest CtsAutoFillServiceTestCases Bug: 281312204 Change-Id: I5c304422dde5576d0f6408e649a420b57bb2a58e --- services/autofill/java/com/android/server/autofill/Session.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index d290c3611f78f..05db1e63503a8 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -1716,6 +1716,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } } + if (ids.isEmpty()) return saveInfo; AutofillId[] autofillIds = new AutofillId[ids.size()]; ids.toArray(autofillIds); return SaveInfo.copy(saveInfo, autofillIds);