yashsingh1/xdaforums huggingface dataset:
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] :
UnifiedNLP not working

So I would have much more liked to be the only one with this problem because there would be a solution but...

For me its the same. Having tried RC4, RC5 and RC6 I only get a network-based location when switching to 3G or 2G, not with LTE! It's not just the Mozilla Backend, it's regardless of the backend and regardless if I take the UnifiedNLP without any changes right after a clean install of LOS or uninstall UnifiedNLP and install MicroG Service Core (manually or via nanodroid doesn't matter).

Is there any chance of solving this?

I also put up an issue on github on this.

Thanks in advance
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] anarki@butterblume:
You're right, the definitively is another bug. After enabling system wide use of location, I have to disable and again enable my network location provider in UnifiedNlp settings to get a network location fix. Have you tried that?

By the way, I use GSM location service from F-Droid, which even suggests that procedure after installation. (It is not that accurate, but it does not send my location to any company and it works with LTE and 3G enabled)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Dean F:
I am having trouble with my apps writing to my external SD card which is formatted as portable storage. On the stock sony rom I never had such an issue. Is this something related to this build, or linageos in general? Anyone have a solution?

I noticed this when some offline maps app where having problems download the maps files to the SD card.

Regards,

Dean
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] XDA-shark:
After about a week of flawless operation, I ran into a "No signal" situation again. Rebooting, switching airplane mode on and off did not help. What fixed it was force closing CustomizationSelector, clearing its cache, and then rebooting. I also had this on RC5 and RC6 prior to my clean install. Since it happens again now, I believe it is an issue with the ROM, not just my installation.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] :
Thanks for the fast answer but I don't really get what you meant: You're writing " this is definitively another bug" but at the same you time "it works" for you?!

What do you mean by "enabling system wide use of location"?

I also prefer to use GSM location service with the OpenCellID-database (for me living in Austria its very accurate actually) together with Deja vu and as with all the other backends (regardless if Mozilla, Radiocell or Apple) I get the same results: no network-location via LTE, only via 3G or 2G.

Do you use the build in UnifiedNLP-only or MicroG?

Could you describe the steps you needed to perform from clean install to working LTE-Network-location, please?

Thanks in advance...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] techno-viking:
Assuming your phone is rooted with Magisk installed, you can use Magisk to install the ExSDCard Access Enabler module. It worked for me though I needed to reinstall the apps (Here Maps, and Canada Topo Maps) that needed to access the SD card.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] anarki@butterblume:
I did not do anything else, because the the ROM brings the current versions of microG/UnifiedNlp.

To sum up the bugs I know of:

- Ichnaea, the Mozilla backend for UnifiedNlp suffers from this bug for MNCs beginning with a '0', which makes it not see cell ids

- Anytime I enable global use of location in 'Settings / Security & Location / Location / Use Location' , I also have to toggle 'UnifiedNlp Settings / Configure location backends / GSM Location Service' off and on again to get a network fix

So you could do the following:

- Do you get a location fix via GPS (first tab in SatStat)? Also find the corresponding event in logcat:

$ adb logcat | grep -i 'gnsslocationprovider.*gps'

If you see a lot of coordinates, you're good (here are mine):

GnssLocationProvider: WakeLock released by handleMessage(REPORT_LOCATION, 1, Location[gps 52.153569,13.517314 hAcc=27]

If you do not, you global location providers might not be running. Check:

$ adb shell pm list packages -e | grep location | sort

for:

com.android.location.fused: the service that evaluates network location

com.qualcomm.location: this reads out the gps receiver and reports to location.fused

org.fitchfamily.android.gsmlocation: your network location provider backend

(com.qualcomm.location.XT is some dodgy extended service with a whole lot of AGBs, do not enable)

So, if one of these services is missing, enable them and reboot:

$ adb shell pm enable <service name>

If they are already running, delete their corresponding data folders. For each service, do:

$ adb shell rm -rf /data/user/0/<service name>

Reboot to recovery and delete dalvik / cache

- Now I hope you'll get at least any GPS location and / or corresponting status info in logcat. Let's face network location, then. Put SatStat into network only mode to make sure, you see just the network location: 'SatStat / Settings / Location Sources' and enable network, only. Press OK and go to map tab. The network location is shown by a blue pin.

See no location? Go to 'Settings / Security and location / ... / UnifiedNlp Settings / Configure location backends / GSM Location Service' and toggle it off and on. Go back to SatStat - see anything? Have a look at the log also:

$ adb logcat | grep -i gsmcelllocation

Response should look like:

D CellTowerListLte: Added GsmCellLocation for lte:262-2-49302-4621372, 4 G

Or look for the fused location:

$ adb logcat | grep -i nlplocationbackendfuser
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] nononomen:
Now that you've made a 1.0 release, any plans for becoming official?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petrokr122:
why is download 1.0 [2019-12-15] not available?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Meth0d:
i guess [MENTION=4297219]modpunk[/MENTION] is keeping it secret :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] modpunk:
The upload failed at 99%, yay! I've re-uploaded it.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petrokr122:
Thank you, I have already updated !!!:)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] petrokr122:
I chose a dark theme in the settings, but the notifications are still light. Please fix it if possible.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] techno-viking:
Did anyone get this to work for a failing GPS fix? Before the potential solution was posted, I went back to stock rom, rooted it and then did a debloat but I would go back to Lineage if the GPS issue is fixed.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] :
Thanks a lot, for this detailed instructions. I'm sure this will be of help for others as well!

As for my problem:

1. Yes, I get a reliable and fast gps fix as long as I'm outdoors without having to make any changes to settings or files.

2. I got network location to work while doing the exact same thing I tried all the time and at first it didn't work but after some days just ignoring it, I gave it another try via satstat and voila: it finally gets a network fix via LTE!!! (I've no idea why)

These are my steps in case anybody faces the same problem and need to use MicroG instead of just UnifiedNlp:

a) Make a clean system install (wiped system,cache, dalvik before flashing) of LOS and reboot to recovery then flash Magisk to get root

b) reboot to system and install Magisk module "Debloat" + "Terminal Emulator" and "microG ServiceCore" (via microG repo) + backends (I use Nominatim, Deja vu and LocalGsmNlpBackend) from F-Droid

c) set up microG and backends. If you use LocalGSM you need to download the cell database (I did that via an OpenCellID-Account) which takes some time and might stop downloading if you leave the LocalGSM settings window, so just let it run

c) download "Services Core" apk from microg.org (don't install it)

d) reboot

e) in Terminal Emulator, type "su" then "debloat" then debloat "Nominatim" + "Mozilla UnifiedNlp" + "UnifiedNlp" from System Apps and "LocationServices" + "Qualcomm IZat" from System Priv-Apps

I have no idea why (tried everything regarding permissions and so on but when I manually delete these system-apps via adb I get stuck in a bootloop, while this doesn't happen with other system-apps...

f) reboot to twrp, mount system and put the downloaded MicroG ServicesCore apk (com.google.android.gsm-(some numbers).apk) inside /system/priv-app then give it the right permissions (chmod 644)

g) reboot to system and in terminal emulator execute:

su

followed by

pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION && pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION

h) reboot and switch off the location-toggle then switch of the backends in microG settings, switch the location (I set to high precision, so gps + network) and backends on again

i) download "satstat" from F-Droid, and download AGPS-Data, then try if it works (as I said it took some days for me to work, while I was just ignoring that it didn't

Unfortunately you have to put the "com.google.android.gsm-(some numbers).apk" (MicroG ServicesCore) into /system/priv-apps and give it the 644 permissions every time you flash a new LOS version... but for me thats the only step I have to repeat

Did it work for you this way?

-------------------

Off-Topic: I wanted to use a drop-down style list for the instructions to shorten the post but neither [details] nor

Spoiler content hidden.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] anarki@butterblume:
Thank you for the guide. Regarding e), I don't know what exactly the debloat instruction does, since I don't use Magisk. But after installing microG core as new (priv-app) apk, I saw a lot of permission errors regarding com.google.gms in adb logcat, resulting in a boot loop. To get that working again, I touched a file

/system/etc/permissions/privapp-permissions-microg.xml with content

<permissions>

<privapp-permissions package="com.google.android.gms">

<permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>

<permission name="android.permission.DELETE_PACKAGES"/>

<permission name="android.permission.INSTALL_LOCATION_PROVIDER"/>

<permission name="android.permission.ACCESS_FINE_LOCATION"/>

<permission name="android.permission.ACCESS_COARSE_LOCATION"/>

<permission name="android.permission.RECEIVE"/>

</privapp-permissions>

</permissions>

which gave com.google.gms all the permissions that where asked for in logcat. Including the permission to read fine and coase location, as you did by 'pm grant'.

I think the 'debloat' instruction might just to that - create a permission file for each named service and grant what the service requests.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] techno-viking:
Yes, GPS is working fine now after going back to stock and then running the debloat instructions in this thread https://xdaforums.com/xperia-xz1-compact/how-to/debloat-script-xz1-compact-stock-pie-t4001453

GPS gets a quick location lock without having to turn airplane mode on, like I had to do with my Lineage install.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] anarki@butterblume:
Using LineageOS 16 1.0, I installed microG Services Core by copying the package to /system/priv-app/microg, added privapp-permissions-microg.xml (see previous post) and then, by accident, wiped my /data partition, so I had to set it up again. Annoying at first, but - location behaviour has changed:

Now I get a network location fix instantly, I even see the blue location cursor before Osmand is done with loading map details (Using GSM location provider). Was it the removal of certain outdated files in /data? Was it the installation of microG Service Core? Will do further testing.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] thessy:
So, for you installation of microG was no problem on this ROM? But how did you get support of "Signature Spoofing" which is a prerequisite of microG?

It would be nice if you could tell me the steps how to install microG on this ROM.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Dean F:
To be honest. I don't understand anything you are referring to in your question. All I can say, is i went to the youtube vanced website, downloaded Micro G and Vanced. Installed it and it worked. I can log into my google account via vanced with no issue.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] thessy:
You wrote in https://xdaforums.com/showpost.php?p=81106941&postcount=734 that the hint on the first page of this thread can be removed.

This hint according microG is: "This ROM doesn't support Signature Spoofing. However we are watching MicroG and check if they provide newer builds e.g. for Android Pie."
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Dean F:
Sorry man. I cant really help any more other than saying that I have installed micro g and vanced with no issue. Maybe somebody else can help you.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] thessy:
Is there any chance to get signature spoofing enabled on this ROM? I want microG for push notifications.

Anybody here, who has this running and can give me somy advice?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Namnodorel:
Well, if you're willing to use EdXposed, there's a module there that enables signature spoofing.

Apart from that, you can try the usual tools that attempt to patch ROMs to get signature spoofing support, like NanoDroid. I personally don't like that, because it's pretty cluttered. There are other tools you can find, but I don't know if they are up to date and reasonably easy to use.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] XDA-shark:
Can you elaborate on that, please? Any particular reason for staying away from EdXposed? I mean, apart from the up-, and downsides Xposed itself carries along.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] techno-viking:
Maybe you already know this - but there are minimal installs for Nanodroid that don't include some of the "bloat" that the full Nanodroid install has. Currently the full Nanoidroid install is almost 400MB...

The minimal install just patches your phone for signature spoofing (Nanodroid Patcher 9.25 MB) and if you want Micro-G then Nanondroid Patcher with Micro-G (56 MB).
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Namnodorel:
Nothing about EdXposed in particular - it's just that many people don't like using Xposed or an equivalent solution because it makes SafetyNet fail and can be a security issue if you aren't careful.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] sylphio:
I have just upgraded from LOS15 to LOS16 1.0 and am delighted. That's a great ROM, thanks for all the work!
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] hazote:
it's been a long seen I haven't put cyanogenmod on my phone (yes last time this wasn't lineageOS)

So, I have Installed lineageOS, works great.

some questions:

-edit: I have found fingerprint: works well

- can we group icon of app as on stock frmware under the list menu of app (I see that it is possible on home screen)

- Is there a way to install gapps only under shelter app (sandbox) ? is this a good idea ?

thanks !
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Flapperbol:
Rom works perfectly fine, although I have one weird small issue :

When applications are loading stuff, I see a stationary circle/arrow icon. Back on stock it was animated, but now it doesn't move anymore.

Anyone know why this happens?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] mp107:
[MENTION=852112]Flapperbol[/MENTION]

Check whether "Animation duration scale" is set to "Animation off" in the "Developer options". Setting this disables the animation.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Flapperbol:
Thank you! Had no idea that setting was responsible for those animations (since I turned it off myself)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Mustermann Max:
Hey,

my screen broke a few weeks ago. Now I'm not sure if I should fix it or a replacement phone because I start to experiance two other functionality issues too. I wonder if they are caused by broken hardware or by this Rom and would need your advice:

While using the telephone app the screen always stays black and doesn't switch on when I move it away form my ear.

Also in telephone APP, while calling i sometimes cannot here the other person for a few seconds.

The last issue got better after flashing the newest version of LoS but still exists.

Any ideas to fix this? I'd be greatful for every help :)
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] mp107:
Check whether your proximity sensor works properly as it sounds like it stuck. It is located below the screen glass and if there is a screen crack in front of it then it may stuck in "enabled" state.

You can check it for example using the SatStat application. It shows proximity sensor readings on the bottom of the second tab. On my XZ1 Compact it has three states: "5.0 cm", "0 cm" and "-". Right after starting the app the sensor is in the "-" (I suppose - unknown) state. After I move my hand closer to the top of the device's front the sensor changes to "0 cm" (enabled) and after moving the hand it away to "5.0 cm" (disabled) state.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] Mustermann Max:
Thanks :) it doesn't show anything, just a "-" and there are cracks next the camera and the brightness sensor (lux). So that may be fixed by a new screen.

But how about not being able to hear the other person for a few seconds? Before the screen broke I just switched in loudspeaker mode while calling. That fixed the problem. So speaker and GSM antenna can't be broken (I guess). In addition the other person can always hear me. Any idea about that?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] qilby:
When this is going to be an official LineageOS supported device?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] kugel.:
So the app (HERE WeGo Maps) doesn't request that permission indeed, but it works just fine on stock pie. What's the difference?

Incidentally, I don't even have a microsd card in the phone (doesn't work if I insert one either). It seems to be related to the internal storage portion (/data/media) that mounted via sdcardfs to various locations. On stock it works with and without microsd.

PS: pm grant throws an exception because the app doesn't request the location so it cannot be granted.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] modpunk:
It looks like it is a bit more complex: https://developer.android.com/training/data-storage/files.html#WriteExternalStorage
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] kugel.:
The question remains: It works in stock pie (with or without any sdcard in the phone), so what's the difference in LOS? I have two phones ATM, one with stock (rooted) and the other with LOS, so I can compare side by side if you could tell me where to look.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] _that:
And it's even more confusing that the developer docs and the UI call two completely different things "Internal Storage".

"Internal Storage" as in the developer docs is the private /data/data/<appname> directory.

"Internal Storage" or "Internal Shared Storage" as in the UI is what the developer docs call "External Storage" on the /data partition aka the emulated SD card.

I don't see anything in the docs about "External Storage" that states that permissions for emulated shared storage and the physical microSD card are or can be different, or am I missing something?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] derf elot:
Yes, this is all a bit confusing. I found this write-up to be quite good: https://commonsware.com/blog/2017/11/15/storage-situation-removable-storage.html

So in essence, apps should use StorageVolume to requests access to external storage (starting from N), or at least the storage access framework.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] kugel.:
Lets not focus on what apps should do, but instead on why specific apps work in stock but not in LOS (e.g. HERE WeGo Maps).
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] modpunk:
Feel free to decompile the stock framework and figure out what they changed. We're interested in your findings ...
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] detektone:
TWRP 3.3.3.0 + 47.2.A.10.45_R7C (USA customized) puts my device into a reboot loop if a sim card is installed. I've made multiple attempts of a full wipe, install lineage, install firmware, install opengapps. I've tried sim cards from two carriers with the same results. The phone boots and os is usable for around 30 seconds, it then freezes for a few seconds and reboots. Remains stable without a sim card.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] .:B:.:
I believe [MENTION=4297219]modpunk[/MENTION] had a modem related crash as well if you read back a bit. I think he used a European firmware though.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] detektone:
That's what it "feels" like. First I blamed myself, then I blamed the sim card, now I think I live in the wrong country :D
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] mcgi5sr2:
Is there a reason you are using a US set of firmware? afaik anyone firmware should do the trick (please correct me if I am wrong).

Also you describe that you install lineageOS, the firmware, and openGapps, is it in the order? If so I would recommend these steps:

1. flash recovery

2. from recovery wipe all partitions except storage, this includes data.

3. format data from recovery

4. install lineageOS, and addonSU if want root

5. BOOT into the OS

6. return to recovery to flash OpenGapps

---

[MENTION=4297219]modpunk[/MENTION] [MENTION=4063475]derf elot[/MENTION] finally got a personal set of builds up and running, I can thank you enough for all your hard work. It is truly liberating to be able to pull commits from the lineageOS gerrit and make my own custom builds. I am loving the both battery customisations and sony camera right now. If you think it would help create the community I would be happy to write up a full guide for other users of how to roll their own versions of lineageOS, and then support the thread
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] loknar299:
It works like a charm.

Thank you for the build.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] .:B:.:
Did [MENTION=4063475]derf elot[/MENTION] sell you on those battery customisations as well :laugh:
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] b8ee469a:
Awesome work! Thank you!

Installed LineageOS on my phone and I have to say I'm loving the security, privacy and battery saving features.

I hope this will be a official LineageOS rom soon.

Reminding everyone not to lock their bootloader after flashing. Locking bootloader will cause a brick. Good thing the commands failed after my attempt, I hated the nasty boot message. I should've known earlier that it really isn't necessary to lock or avoid locking bootloader at all.

Edit: Can someone help me out on rooting this?
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] modpunk:
Just flash the su addon -> https://download.lineageos.org/extras
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] steffa77:
I've also problems with different apps. Google TTS tells me that it can't save the downloaded language file. Using 'osmand' is only possible when the working directory is the internal app dir. Writing to sdcard and the external sdcard isn't possible with this app. Annoyingly with the large map files. In the past never had this problem with lineage ROMs on other phone, actually on AEX ROM these apps are working without problems.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] modpunk:
This is not a lilac (xz1c) problem, it is a LineageOS problem. If it works with AEX then try to find out what they are doing different that it works for apps to write to the SD card.
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] doeternietoe:
I'm still on LineageOS 15.1, but that has the same problem. You can solve it with GravityBox (requires Xposed).
[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] modpunk:
Fixed :)