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 finally works on AOSP 9.0 #171

Open
perdubug opened this issue Feb 25, 2019 · 1 comment
Open

UnifiedNlp finally works on AOSP 9.0 #171

perdubug opened this issue Feb 25, 2019 · 1 comment

Comments

@perdubug
Copy link

perdubug commented Feb 25, 2019

I build an Android P ROM that's based on AOSP(android-9.0.0_r18) for my Pixel device. But UnifiedNlp of MicroG didn't work on my device. The getLastKnownLocation API of Android SDK got null. Also, 'Network-based location enabled' is unchecked in Self-Check.

The following is what I did:

  • Add microG patch in framework/base/services/core/java/com/android/server/ServiceWatcher.java by refer to https://github.com/microg/android_packages_apps_GmsCore/tree/master/patches
  • Install MicroG as /system/priv-app by putting it in AOSP build tree with below lines in its Android.mk
    ...
    LOCAL_CERTIFICATE := platform
    LOCAL_PRIVILEGED_MODULE := true
  • After reboot device, install Backends from F-Droid, like AppleWifi, Mozilla Location Service, etc.
  • Enable backends in microG Settings->UnifiedNlp Settings->Configure location backends;
  • Reboot device
  • Self-Check in microG Settings. The 'Network-based location enabled' option is unchecked.

Finally, I made UnifiedNlp works. Here's what I changed:
Allowing 'network' as Location Provider in framework/base/packages/SettingsProvider/res/values/defaults.xml.
Change "def_location_providers_allowed" value from 'gps' to 'gps,network'

@perdubug perdubug changed the title 'Network-based location enabled' is unchecked on AOSP 9.0 UnifiedNlp finally works on AOSP 9.0 Mar 1, 2019
@stapel
Copy link

stapel commented Apr 19, 2019

Nice catch, thanks! Finally I can use it. You can also enable this at runtime in a shell with: settings put secure location_providers_allowed +network.
So is this an Android-problem/bug or one of microg? Should microg (unifiednlp) set this setting or should it be configurable in some android-gui?

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

No branches or pull requests

2 participants