microg / microg/UnifiedNlp

UnifiedNlp finally works on AOSP 9.0

Open
#171 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
221
PR merge metrics
No merged PRs in 30d

Description

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'

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the AOSP framework/base/services/core/java/com/android/server/ServiceWatcher.java microG patch and framework/base/packages/SettingsProvider/res/values/defaults.xml. Reproduce the Android 9.0 setup and verify whether UnifiedNlp reports network-based location as enabled without the reported defaults.xml change; done means the location provider works and Self-Check passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.