microg / microg/GmsCore

Make Phenotype usable

Open
#1,691 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Fix Phenotype, allowing users to manually flip on/off Phenotype Service flags.

Describe the solution you'd like
The ability for users to add Phenotype Service flags per app, much like Firefox's about:config

Doing this will allow users to flip on flags that Google usually push out to internal staff first for testing: https://www.androidpolice.com/android-autos-upcoming-ui-redesign-is-just-looking-more-and-more-like-apple-carplay/

Describe alternatives you've considered
N/A

Additional context
There's already a minimal stub implmented, currently it just returns an empty array
https://github.com/microg/GmsCore/blob/master/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt#L42

From what I can tell, apps that support Phenotype call getConfigurationSnapshot and update their own local SQLite database with flags from GMS.

I think we're missing a method and a field currently resulting in a silent crash (Android Auto as an example)

03-17 12:14:16.231  4640  5694 D GmsPhenotypeSvc: register(com.google.android.libraries.consentverifier#com.google.android.projection.gearhead, 74620914, [Ljava.lang.String;@9cc5e36, null)
03-17 12:14:16.231  4640  5694 D GmsPhenotypeSvc: getConfigurationSnapshot(com.google.android.libraries.consentverifier#com.google.android.projection.gearhead, , null)
03-17 12:14:16.232  4640  4669 D SafeParcel: Unknown field id 12 in com.google.android.gms.clearcut.LogEventParcelable, skipping.
03-17 12:14:16.232  4640  5694 W BinderUtils: Unknown method 5 in com.google.android.gms.phenotype.internal.IPhenotypeService, skipping
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: Unable to update local snapshot for com.google.android.libraries.consentverifier#com.google.android.projection.gearhead, may result in stale flags.
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at nzr.s(SourceFile:6)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at nzr.get(SourceFile:4)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at nze.o(SourceFile:1)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at nze.D(SourceFile:2)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at loj.d(SourceFile:1)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at lok.run(SourceFile:83)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at java.lang.Thread.run(Thread.java:920)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at loa.a(SourceFile:6)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at jdr.run(SourceFile:55)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at oan.execute(SourceFile:1)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at jlc.a(SourceFile:8)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at rcw.d(SourceFile:5)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at jlo.o(SourceFile:3)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at ide.l(SourceFile:1)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at jjd.cl(SourceFile:2)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at jke.dispatchTransaction(SourceFile:58)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at btc.onTransact(SourceFile:3)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at android.os.Binder.execTransactInternal(Binder.java:1208)
03-17 12:14:16.233 12979 13037 W MobStoreFlagStore: 	at android.os.Binder.execTransact(Binder.java:1166)

SafeParcel: Unknown field id 12 in com.google.android.gms.clearcut.LogEventParcelable, skipping.
BinderUtils: Unknown method 5 in com.google.android.gms.phenotype.internal.IPhenotypeService, skipping

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt, especially the stub around getConfigurationSnapshot, then trace the register and IPhenotypeService calls shown in the report. Determine the required response data and missing method or field from the logged failure; done means per-app Phenotype flags can be manually configured and the reported update no longer fails silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, kotlin
Domain
api, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.