Repository navigation
fix: [SDK-5303] treat null OEM PackageInfo as not installed - #2758
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)2/3 touched executable lines covered (66.7% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
❌ Coverage Check FailedAggregate coverage on touched lines is 66.7% (minimum 80%). |
nan-li
approved these changes
Sep 21, 2026
fadi-george
approved these changes
Sep 21, 2026
Closed
This was referenced Oct 23, 2026
Closed
Merged
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Treat a null OEM
PackageInfoas not installed so GMS/HMS detection does not NPE.Details
Motivation
Fixes SDK-5303. Some OEM
PackageManager.getPackageInfoimplementations return null (or throw NPE) instead ofNameNotFoundException.packageInstalledAndEnabledthen crashed oninfo.applicationInfo.enabled. Daily watch 2026-09-21: 4 events / 4 installs, recorded as SDK fatals.Scope
DeviceService.packageInstalledAndEnabledonly. Missing or unreadable package isfalse. Play services present and enabled is unchanged. No public API change.Testing
Unit testing
Added tests for null
PackageInfo, nullapplicationInfo, and enabled package.DeviceServiceTestspassed locally (:OneSignal:core:testDebugUnitTest).Manual testing
Not practical on a stock Pixel. The NPE needs an OEM
PackageManagerthat returns null. Covered by the mocked unit tests.Affected code checklist
Checklist
Overview
Testing
Final pass
Made with Cursor