GoogleApiAvailability.isGooglePlayServicesAvailable(Context context) always return SUCCESS
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 3.2k
- Avg merge
- 12d 11h
- Merged PRs (30d)
- 4
Description
Describe the bug
As a library used as a substitute for Google libraries, the function should have the expect behavior. Currently, this return SUCCESS on devices with neither Google Play Services or microG services.
To Reproduce
See the code, it's self-speaking:
https://github.com/microg/GmsCore/blob/v0.3.1.240913/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java#L160-L164
Expected behavior
The function should return one of the following:
ConnectionResult.SERVICE_MISSINGifcom.google.android.gmsis not installedConnectionResult.SERVICE_UPDATINGif ̀com.google.android.gmsis currently updating and is not availableConnectionResult.SERVICE_VERSION_UPDATE_REQUIREDif the lib version by the app is incompatible withcom.google.android.gmsversion (must handle both microG and Google Play versions).ConnectionResult.SERVICE_DISABLEDif user has disabledcom.google.android.gmspackageConnectionResult.SERVICE_INVALIDfor example if the signature of thecom.google.android.gmspackage is not Google or microG signature, if failed to parse Manifest, etcConnectionResult.SUCCESSfinally, ifcom.google.android.gmssucceeded in all checks, this is what should be returned
I think the most important things to do in priority are: package is installed, not disabled and signature is valid.
Additional context
I intend to use play-services-location as a subtitle library in Breezy Weather, see breezy-weather/breezy-weather#901
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java around lines 160-164, where isGooglePlayServicesAvailable(Context context) currently returns SUCCESS. Trace the existing checks and compare them with the requested installed, updating, version, disabled, and signature outcomes. Done means the method distinguishes these cases for both Google Play Services and microG, returning SUCCESS only after all checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100