Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate intents passed to start/stop/bindService.
The Android OS normally throws an IllegalArgumentException if an implicit Intent is passed to one of these methods by an app which targets SDK 21 or higher. However, this logic was lost because Robolectric shadows these methods, and only the actual implementation has access to the private Intent validation method. Copy the relatively simple validation check into Robolectric to achieve the same behavior. Existing usage of these methods in tests must be updated to use explicit intents rather than implicit ones in order for those tests not to crash. Prod code should also be audited to ensure that these methods are never called with implicit intents (at least on SDK 21+). See #5016 PiperOrigin-RevId: 250337437
- Loading branch information
1 parent
eed2995
commit 21375be
Showing
7 changed files
with
141 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.