commit | 7b468b86871b26e164c9bf8163fe7ca810ddbe08 | [log] [tgz] |
---|---|---|
author | Adam Bookatz <bookatz@google.com> | Fri Jan 26 13:26:01 2024 -0800 |
committer | Adam Bookatz <bookatz@google.com> | Fri Jan 26 13:45:14 2024 -0800 |
tree | a8edd2e6a045e864afc661f86e908dbf92dc1c8c | |
parent | 8b814a1856c02b339e7bba57b82e03bcc0989f88 [diff] |
ChooserAdapter: fix NPE for non-work profiles For some non-work profiles (Communal, and maybe Private), the getListAdapterForUserHandle is returning null. The method is indeed nullable. But we run getCount on it without doing a null-check, causing crashes for such profiles. This previously couldn't have happened, since shouldShowTabs() returns false in these cases, and the evaluation was skipped; however, ag/I8273cf365a1e00b1acff4030086f1a044ad7531f moved that check to later, so we are hitting this problem. Bug: 322523699 Bug: 320369524 Bug: 320615143 Bug: 322497953 Test: atest IntentResolver-tests-unit Change-Id: I82303d6a6a1be1066f5c3e05c53f6a70d486bf5a
IntentResolver
provides the implementation for Intent ACTION_CHOOSER
See also: ShareCompat.IntentBuilder