[Autofill PCC]: Fix SaveInfo IllegalArgumentException

Don't create SaveInfo if there are no eligible autofill ids.
Test: atest CtsAutoFillServiceTestCases
Bug: 281312204

Change-Id: I5c304422dde5576d0f6408e649a420b57bb2a58e
This commit is contained in:
Simranjit Kohli
2023-05-08 20:27:59 -07:00
parent d33c5e3df8
commit 7441ed4601

View File

@@ -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);