Unified NLP on Fairphone 2 Open OS

If @root has a rooted phone … I think he/she should be able to just modify the two xml files as described. Also once most of the code is complied … rebuilding is pretty fast, most of the time.

Thanks! Indeed - as I run and beta-test the “official” FPOSOS, the phone is rooted. I was not sure if deleting the files after OS compilation would work. I will look into this as soon as I have a spare moment… Guess it will be Tuesday night… :slight_smile:

Good thing is, you don’t have to delete anything. First modify the two .xml files and test. And if you really want, you can rename the Qualcomm files for testing purposes. Good luck & enjoy your weekend!

OK, I located the two Qualcomm files @jochensp is referring to in his first post on my FP2. Renaming these two files - as expected - did not help. However, I don’t know how to add com.google.android.gms to the location providers on a compiled an running OS?! Any hints?

You have to edit the xml files on a r/w mounted file system. Else you have to edit them before.

Sure! “adb root”, “adb remount” are my friends… :slight_smile: Where do I find these XML?

Honestly, I don’t know whether it’s possible to do this after compilation. At least, I haven’t found the xml files:

~$ adb shell
shell@FP2:/ $ su
root@FP2:/ # find . -type f -name config.xml                                   
find: ./mnt/shell/emulated/0/KernelAdiutor: Permission denied
find: ./proc/6181/task/6181/ns/net: No such file or directory
find: ./proc/6181/ns/net: No such file or directory
find: ./proc/25137: No such file or directory
root@FP2:/ #

@physm these xml files are usually compiled into a binary format, so it’s a bit more involved than this.

1 Like

@root: I’m sorry, my mistake. It looks like you have to rebuild software or replace the software with an already re-build binary from someone else.

OK, no problem. Thought so initially, but you never know… :wink: So we need to bribe the Fairphone Dev team now to allow for Unified NLP in FPOSOS? :wink:

@jochensp figured it all out, together with marvin from microG. You can just apply his patches. For me adding those changes would be a big step towards a google free phone, so yes, I guess?

I also think (I have not checked this) that the application binary itself could be shared without any bin blobs involved. So maybe it’s even possible to offer it as a drop-in-replace. But someone has to read about all the details here.

1 Like

Has anyone sucessfully compiled the latest FPOS code with the uNLP patches? I’m having trouble…

Details in the compiling FPOS thread:

Compiles fine over here, more in the other thread as it’s not uNLP related.
Btw. please don’t crosspost, it’s rather hard to follow.

Thanks.
This forum style is pretty hard to follow no matter what. :stuck_out_tongue:

Hello everyone,

I am having trouble using unifiedNLP: Whenever I start an application which uses location, the phone reboots. (not exactly reboots, but shows the blue FP2 start screen) Here’s what I did:

  • Get the repo
  • Apply patches :
    patch -p0 << EOF --- frameworks/base/core/res/res/values/config.xml.orig 2016-05-22 20:15:16.816563782 +0200 +++ frameworks/base/core/res/res/values/config.xml 2016-05-22 20:15:44.152563388 +0200 @@ -1054,6 +1054,7 @@ <string-array name="config_locationProviderPackageNames" translatable="false"> <!-- The standard AOSP fused location provider --> <item>com.android.location.fused</item> ``+ <item>com.google.android.gms</item>
    </string-array>
    ``
    <!-- This string array can be overriden to enable test location providers initially. -->
    EOF
  • delete device/qcom/common/product/overlay/frameworks/base/core/res/res/values/config.xml
    vendor/qcom/proprietary/target/product/FP2/system/etc/permissions/com.qualcomm.location.xml
    vendor/qcom/proprietary/target/product/FP2/system/priv-app/com.qualcomm.location/com.qualcomm.location.apk`
  • make, flash via fastboot
  • Install µG UnifiedNLP (no GAPPS) via F-Droid
  • Start Andronsens 2

At this point, the phone crashes. I can see satellites for a short time, then the phone goes to the “Loading…” screen. Interestingly, it does not seem to be a reboot (I get random reboots sometimes, it’s not the same), and SSH stays connected for some seconds while already “Loading…”.

I pasted a log file here: https://justpaste.it/ulmr , containing this:
05-24 22:19:21.513 F/libc ( 5600): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 5647 (android.bg)

Any hints on what I did wrong?

It worked for me last time I tested it. Some notes:

  • Any reason why you didn’t applied the patches as I wrote in the first?
  • The segfault in libc sounds bad but rather unrelated. Did you try an other program like SatStat?
  • Does GPS work without the modifications? (Does it work using the official rom? Does it using a self compiled one?)

update: rebuilding the os using docker did the trick, seems to have been a build environment related problem.

  • From what I understand, using the above repo commands, I check out branches from an older version of the FP os. See the attached png: Left column is the device/qcom/common dir after applying repo download fp2-dev/device/qcom/common 4, right column is after only removing device/qcom/common/product/overlay/frameworks/base/core/res/res/values/config.xml


    Would you suggest checking out the branches anyway? Repo gives me a quite long list of changes I “lose” when running repo download ...

  • I did try google maps, gave me the same error. I also just tried using a clean installation, wiped everything. Same error. Must be something build related.

  • GPS worked in the official stock ROM. I experienced the issues described in GPS doesn´t work on FP Open OS using the official openOS

  • Interestingly, I get location using the “network only” mode. Crashed only occur in “device only” and “high precision” modes.

I will try rebuilding the whole OS from scratch.

Thanks for your help.

Thanks for noticing. I’ve fixed the instructions in the first post.

If it worked in network only mode, it can’t be this patch, as I only target exactly that mode.

The open source release 16.05.0 announcement mentions: Unified Location provider (Thanks Jochen).
And indeed, after installing the new OS and µg UnifiedNlp (no GAPPS) along with some location providers, I find that it works. This was the last think I was waiting for to be able to use my FP2. Thanks a lot to everyone who contributed.

1 Like

UnifiedNlp (no GAPPS) doesn’t work for me. I have an unrooted fairphone 2 running fp open os 16.06.0 without GAPPS, currently with mozilla and GSM backends. Nlps selfcheck says that:
android version supported
system supports location provider
unifiednlp is registered in system
location backend(s) set up
Network-based location enabled

are all ok. But it fails with:

UnifiedNlp has known location
UnifiedNlp provides location updates

Does anyone have a suggestion? I was under the impression that 16.06 didn’t need any patches for unifiednlp to work.