Skip to content

fix: handle null package name in WearableService.handleServiceRequest - #3950

Open
sezginkipel wants to merge 1 commit into
microg:masterfrom
sezginkipel:fix/issue-2843
Open

sezginkipel wants to merge 1 commit into
microg:masterfrom
sezginkipel:fix/issue-2843

Conversation

@sezginkipel

Copy link
Copy Markdown

Root Cause

The WearableService.handleServiceRequest method assumed that GetServiceRequest.packageName is always non‑null. When a request with a null package name is received, PackageUtils.getAndCheckCallingPackage throws a NullPointerException, causing the service to crash.

Key Changes

  • Added a null‑check for request.packageName and defaulted it to the service’s own package name before validation.
  • Introduced a unit test WearableServiceTest that verifies the method works correctly with a null package name and that the callback is invoked with a success status.

Verification

  • The new test ensures no exception is thrown and the callback receives CommonStatusCodes.SUCCESS.
  • All existing tests continue to pass, confirming backward compatibility.

Fixes #2843

Files Changed

  • play-services-wearable/core/src/main/java/org/microg/gms/wearable/WearableService.java, play-services-wearable/core/src/test/java/org/microg/gms/wearable/WearableServiceTest.java

/claim #2843

Fixes microg#2843

Signed-off-by: Sezgin Kipel <1444sezgin@gmail.com>
@eepymeowers

Copy link
Copy Markdown

ai slop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOUNTY] WearOS Support [$2340]

2 participants