Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnifiedNLP not working on Oneplus 7T Pro with LineageOS 17.1 #1420

Closed
codepayne opened this issue Mar 11, 2021 · 12 comments
Closed

UnifiedNLP not working on Oneplus 7T Pro with LineageOS 17.1 #1420

codepayne opened this issue Mar 11, 2021 · 12 comments
Labels

Comments

@codepayne
Copy link

Describe the bug
I have some problems with location services. All the other microg features work, but not location.

I can get geo coordinates(in SatStat) but any application that uses maps doesn't work, complains that location service doesn't work.

I installed the 4 microg apps through the microg f-droid repo. I have the f-droid privileged extension installed in magisk.

What seems different to other people is that I don't have a unifiedNLP status menu entry in the self-check page of microg. So this would indicate that I didn't install something correctly.

To Reproduce
Steps to reproduce the behavior:
Open any maps app

Expected behavior
Phone location is shown on the map

Screenshots
self1

self2

System
Custom ROM: LineageOS 17.1 + manually applied patch for signature spoofing

Additional context

03-09 23:59:37.687 2047 2047 D AutoManageHelper: onStart true {0=com.google.android.gms.common.api.internal.zzi$zza@a258861}
03-09 23:59:37.693 4251 4251 D GmsPlcDtctSvc: onBind: Intent { act=com.google.android.gms.location.places.PlaceDetectionApi pkg=com.google.android.gms }
03-09 23:59:37.695 4251 4251 D GmsPlcGeoSvc: onBind: Intent { act=com.google.android.gms.location.places.GeoDataApi pkg=com.google.android.gms }
03-09 23:59:37.731 2047 2047 V Mbgl-ConnectivityReceiver: connected - true
03-09 23:59:37.731 2047 2047 D MapboxLocationEngine: onProviderDisabled: network
03-09 23:59:37.742 4251 4302 D GmsLocManagerSvc: bound by: GetServiceRequest{serviceId=LOCATION_MANAGER, gmsVersion=12451000, packageName='com.cr.takemehome', extras=Bundle[{client_name=locationServices}]}
03-09 23:59:37.742 4251 4302 D GmsPlcGeoSvc: bound by: GetServiceRequest{serviceId=GEODATA, gmsVersion=12451000, packageName='com.cr.takemehome', extras=Bundle[{}]}
03-09 23:59:37.743 4251 4302 D GmsPlcDtctSvc: bound by: GetServiceRequest{serviceId=PLACE_DETECTION, gmsVersion=12451000, packageName='com.cr.takemehome', extras=Bundle[{}]}
03-09 23:59:37.750 4251 4293 D GmsLocManagerSvcImpl: getLastLocationWithPackage: com.cr.takemehome
03-09 23:59:37.750 4251 4293 D GmsLocProviderU: uh-ok: last location for unified network is null!
03-09 23:59:37.761 2047 2047 W System.err: java.io.IOException: Service not Available
03-09 23:59:37.761 2047 2047 W System.err: at android.location.Geocoder.getFromLocation(Geocoder.java:136)
03-09 23:59:37.761 2047 2047 W System.err: at com.cr.takemehome.RouteHome.setAddress(RouteHome.java:608)
03-09 23:59:37.761 2047 2047 W System.err: at com.cr.takemehome.RouteHome.getLoc(RouteHome.java:547)
03-09 23:59:37.761 2047 2047 W System.err: at com.cr.takemehome.RouteHome.timerGetLoc(RouteHome.java:477)
03-09 23:59:37.761 2047 2047 W System.err: at com.cr.takemehome.RouteHome.onConnected(RouteHome.java:260)
03-09 23:59:37.761 2047 2047 W System.err: at com.google.android.gms.common.internal.GmsClientEventManager.onConnectionSuccess(Unknown Source:109)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.api.internal.zzav.zzb(Unknown Source:22)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.api.internal.zzaj.zzat(Unknown Source:92)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.api.internal.zzaj.onConnected(Unknown Source:21)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.api.internal.zzbd.onConnected(Unknown Source:7)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.api.internal.zzp.onConnected(Unknown Source:5)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.internal.zzf.onConnected(Unknown Source:2)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.internal.BaseGmsClient$PostInitCallback.handleServiceSuccess(Unknown Source:130)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.internal.BaseGmsClient$zza.deliverCallback(Unknown Source:62)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.internal.BaseGmsClient$zza.deliverCallback(Unknown Source:2)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.internal.BaseGmsClient$CallbackProxy.deliverCallback(Unknown Source:51)
03-09 23:59:37.762 2047 2047 W System.err: at com.google.android.gms.common.internal.BaseGmsClient$zzb.handleMessage(Unknown Source:270)
03-09 23:59:37.762 2047 2047 W System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
03-09 23:59:37.762 2047 2047 W System.err: at android.os.Looper.loop(Looper.java:214)
03-09 23:59:37.762 2047 2047 W System.err: at android.app.ActivityThread.main(ActivityThread.java:7356)
03-09 23:59:37.762 2047 2047 W System.err: at java.lang.reflect.Method.invoke(Native Method)
03-09 23:59:37.762 2047 2047 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
03-09 23:59:37.762 2047 2047 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
03-09 23:59:37.763 1390 2947 I NotificationService: cancelToast pkg=com.cr.takemehome callback=android.app.ITransientNotification$Stub$Proxy@2796d98
03-09 23:59:37.763 1390 2947 W NotificationService: Toast already cancelled. pkg=com.cr.takemehome callback=android.app.ITransientNotification$Stub$Proxy@2796d98
03-09 23:59:37.763 1390 2947 I NotificationService: cancelToast pkg=com.cr.takemehome callback=android.app.ITransientNotification$Stub$Proxy@8a829f1
03-09 23:59:37.763 1390 2947 W NotificationService: Toast already cancelled. pkg=com.cr.takemehome callback=android.app.ITransientNotification$Stub$Proxy@8a829f1

@codepayne codepayne added the bug label Mar 11, 2021
@ghost
Copy link

ghost commented Mar 11, 2021

https://github.com/microg/GmsCore/wiki/Installation

Note: On Android 7 (or later) an additional patch is needed to make location work, or alternatively:

  • You can install GmsCore.apk in the /system/priv-app folder. This can be done by using adb push.

@codepayne
Copy link
Author

https://github.com/microg/GmsCore/wiki/Installation

Note: On Android 7 (or later) an additional patch is needed to make location work, or alternatively:

  • You can install GmsCore.apk in the /system/priv-app folder. This can be done by using adb push.

Thanks, now I seem to get a location, but it's from time to time. In other words, I can't use navigation, it shows me in one place, than maybe after a minute in the new place. Is this supposed to happen?

@ghost
Copy link

ghost commented Mar 13, 2021

This might be related to microg/UnifiedNlp#211, but yeah, that would be an issue. I don't really use location stuff so I can't really confirm anything, but I guess we'd have to wait for it to be noticed and acknowledged.

@dogs-1985
Copy link

@mar-v-in
Sorry for disturb.

Last time I found this thread and sent to ROM maintainer.
photo6170066480775932828
But he replied didn't seen other maintainer adding this.
So I keep on using the xposed module "XposedGsmCoreUnifiedNlp" for the Network Based Location.

Few day ago, I saw LineageOS committed this thing:
https://review.lineageos.org/c/LineageOS/android_vendor_lineage/+/305178/

Yesterday I update the LineageOS included above enhancement. After disable the xposed module "XposedGsmCoreUnifiedNlp", I still not able to get the Network Based Location.

Is it really need a set the "config_enableNetworkLocationOverlay", "config_enableFusedLocationOverlay" in-order to solve this problem?

@dogs-1985
Copy link

@dogs-1985 take a look at this

https://review.lineageos.org/c/LineageOS/android_vendor_lineage/+/295384/5#message-f33f5bdf521b5c16d7c31c2a9d1d1a6af44fcec1

Sorry, I am not a very technical person and I am not really understanding.
Can you please tell me what should I do?

@ghost
Copy link

ghost commented Mar 16, 2021

The LineageOS commit only adds UnifiedNLP to the whitelist of allowed location providers.

The linked comment explains that if config_enableNetworkLocationOverlay is set to false, and there is a package defined in config_networkLocationProviderPackageName, then the system will ignore every other package, regardless of whether or not it is whitelisted, and only use the one defined by config_networkLocationProviderPackageName.

This means that yes, in your case, at least config_enableNetworkLocationOverlay needs to be set to true.

@dogs-1985
Copy link

The LineageOS commit only adds UnifiedNLP to the whitelist of allowed location providers.

The linked comment explains that if config_enableNetworkLocationOverlay is set to false, and there is a package defined in config_networkLocationProviderPackageName, then the system will ignore every other package, regardless of whether or not it is whitelisted, and only use the one defined by config_networkLocationProviderPackageName.

This means that yes, in your case, at least config_enableNetworkLocationOverlay needs to be set to true.

Thank you so much, I will talk to ROM maintainer again.

@ghost
Copy link

ghost commented Mar 16, 2021

Yes, I recommend that. They may have declined last time, but now that their change actively prevents a LineageOS feature from working, hopefully they'll reconsider.

@jwrdegoede
Copy link

@codepayne wrote:

Thanks, now I seem to get a location, but it's from time to time. In other words, I can't use navigation, it shows me in one place, than maybe after a minute in the new place. Is this supposed to happen?

I'm seeing similar network location timing issues on a lineage-17.1 + latest micro-G config. I've run several tests and the amount of time between updates (and the amount of time when only a "stale" location is available) seems to depend on which Nlp providers are used:

  • Networklocation works with 5 seconds ok + 10 seconds stale data when downgrading mozilla NLP (IchnaeaNlpBackend) to version 1.3.3
  • Where as with mozilla NLP 1.5.0 I only see a proper up2date network location once every minute / couple of minutes and when starting an app inside the cooldown window it seems no data is provided instead of the last location with a flag that it is old-data, breaking many apps
  • The mozilla NLP 1.5.0 issue is likely caused by: microg/IchnaeaNlpBackend@174e736 . Maybe in combination with GmsCore including the UnifiedNlp v2.0-alpha# versions
  • Networklocation works fine when using Apple Wifi NLP as sole provider

If you have no objection against using the Apple Wifi webAPIs (and thus sending some data to Apple) then using the Apple Wifi NLP provider from F-Droid is a good workaround for the timings issues. At least this seems to work well for me.

@jwrdegoede
Copy link

A quick update on this, I just retried this on a fresh install and for the apple backend to work properly I also need to disable the "throttle wifi scanning" option under developer options and then disable + re-enable the apple wifi backend in the microg location settings.

Without this the apple backend was behaving quite similar to the mozilla NLP (IchnaeaNlpBackend) version 1.3.3 case, where Networklocation works with 5 seconds ok + 10 seconds stale data. Unfortunately disabling "throttle wifi scanning" does not help for the 1.3.3 mozilla NLP backend.

@ale5000-git
Copy link
Member

I'm closing it since it isn't a microG issue:

  • ROM configuration issue should be reported to ROM maintainers
  • NLP Backend issue should be reported to their repository

If you want an easier way to setup everything you can use my microG unofficial installer
For all other problems you can open a new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants