-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Location permissions in AOSP 10 #986
Comments
I can confirm. Experiencing the same on Havoc 3.0. |
I think, the problem is: microG Service Core does only request location permission for "Allow only while using the app". You can't grant the "allways" bermission. not even with local terminal. Shouldn't we report this bug in nlp section? |
The permission in doubt is |
I have the same issue on Havoc 3.0. But trying to run Map without doing this, I get no location, and I suspect it's because microG doesn't request to be able to request permission in the background. That's why if I manually run it and ask it for location it works. |
Logs after adding
|
@mdibaiee I suppose all Nlp providers also need a change in their location permissions. |
@ArchangeGabriel I was thinking the same. I actually tried adding
To the Ichaea (Mozilla) backend, but it didn't work properly. The backends actually do ask whether you want to give them permission to use location "All The Time" even without this change. But, I don't have experience developing Android, so take all my experiments with a grain of salt, it might be me messing up a part. |
Guys I made it working. This is an ugly and manual way of doing it - I am not a software developer - This is just a hacky way to make it work... Requires rebuilding of I am running Havoc 3: Havoc-OS-v3.1-20200110-guacamole-Official.zip Steps: Step 1: I did exactly what @mdibaiee said in this previous comment: #986 (comment)
Step 2: I installed Step 3: Download Step 4:
Step 5: Edit
Step 6: Run
Step 7: Create a keystore (self-signed), Run:
Step 8: copy the Hope this helps some have a working device until a better/more stable/nicer way comes up. (I should make a fork of https://github.com/micro5k/microg-unofficial-installer with a working setup.. but I worry about someone trusting me to publish an edited |
I tried this solution (recompiled GmsCore with background permission, introduced it in nlp backends...) but it does not work: nlp backends work only after checking again in MicroG settings. Indeed, it was not useful to introduce background permission! As stated here : https://developer.android.com/about/versions/10/privacy/changes
And this is the reason why we see the permission request "Always allow" when installing lnp backends... ACCESS_BACKGROUND_LOCATION has been automatically added... |
I had the same experience and impression as @vincentvidal, adding the permission to backends was not necessary and didn't change anything. |
I tried many things, still no success. I then implemented a quick and very dirty fix in my custom lineage build for Xiaomi mi9 (https://forum.xda-developers.com/Mi-9/development/rom-lineageos-17-1-microg-unofficial-t4034757). In file frameworks/base/services/core/java/com/android/server/am/ActiveServices.java, I deactivate permission failure for microG (but still log warnings) :
And guess what? It works ;-) |
@vincentvidal is there somewhere we can chat? I would love to test your fix in my device tree. And i also have a question about your device tree setup for microg. |
@vince31fr on telegram |
|
I just wanted to make it work in my rom, so I did not try to understand the exact reason (after trials with recompiling gmscore with background permission etc). Furthermore I takes time to recompile a rom, flash it etc, and it should take me too much time to climb up to the exact point where something goes wrong. |
Yesterday I played around for a little bit and managed to make locations work again. Please note I am not a programmer and all of my fixes are really dirty and were mainly out of curiosity, but maybe it helps finding a better solution. I edited the following files:
I added/edited the following lines in there: ./play-services-core/src/main/java/org/microg/gms/ui/SelfCheckFragment.java ./play-services-core/src/main/java/org/microg/gms/ui/PlacePickerActivity.java ./play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java It's more of a workaround and after compiling and installing the package I needed to delete the runtime-permissions.xml since I encountered a problem similar to Issue #954. Especially the changes in GoogleLocationManager.java are far from complete, but accessing location e.g. from OsmAnd seems to work correctly. |
I have been working on a fork of the Local-GSM-Backend and made some progress for Android 10 compatibility (I am using crDroid 6.3). See this issue I posted there. |
I got an email notification about a new post here and I wanted to comment, but it seems to have been removed. It reminded me that I had set "disable battery optimization" for the location backend. That is maybe why it kept working in my case. What may be happening without optimization is, you start the service manually in the foreground and as long as it keeps running and bound to microg, it functions properly also in the background. When battery optimization kicks in, it shuts down the backend. Microg NlpLocBackendHelper then tries to rebind it in the background, the system checks microg's permissions again and is denied location access. So I agree microg does need android.permission.ACCESS_BACKGROUND_LOCATION. |
@tragedypoet that was rather rude :) But seriously though, you could've just given a diff instead of typing out all that. Anyway, commited in the fork under my org @NoGooLag. Do keep in mind I haven't tested it yet, and it's on a fork with several diverging commits that was not updated for two years and hastily brought up-to-date by me just a couple minutes ago. Gonna see what I can do for UNLP now. Have a good day, everybody. |
Update: UNLP fork has also been changed to add the permission whereever I though it was needed. I am not a developer either, so I may have missed a lot of spots. Haven't compiled and tested yet, so if anybody is brave enough, please do go ahead. |
@FriendlyNeighborhoodShane great job there.
Right now maps aren't displayed in apps depending on google maps, I haven't figured out how to overcome this. Any ideas? Edit: it may sound trivial, but does anyone know how to build mapbox or vtm version to compare if it's the case?
|
@robson-sz That second thing is weird... Should Play/microG be making the directory itself (but isn't) and do other apps access it using some sort of an API? |
@FriendlyNeighborhoodShane Thanks for reply, but it's something with my build process - GmsCore doesn't work even when i compile with gradle from migrog repo only. |
@ploink |
Any chances getting these fixes into this (main) microg repository anytime soon? Seems like the project has been in a standstill for half a year :P |
can we do anything to speed these fixes up? |
Hi! i get same problem on update (before all work OK) and found working version of MicroG GmsCore.apk that works installed as magisk module. Also i found one thing, if latest GmsCore-v0.2.11.202414.apk installed as user app it also work perfect (same work on NLP modules too). |
Is this supposed to have been fixed by the same refactor that closed #1004 ? |
It is fixed, install your backends as system apps, but also install it again as an update with the same version of the user app, then you will have the option for properly setting each backend to read your location at all times. |
In the meantime both microG GmsCore and Ichnaea Nlp Backend got an update so this is fixed. |
In AOSP 10, the location backends for wifi/cell/local database lose their permissions intermittently. Unless the microg location settings page is open, they don't have permissions. To verify, use satstat a few times. Only gps provider (red) works consistently. The auxiliary ones (blue) don't work reliably. Similarly, the self-test for "unifiednlp does not have location to test geocoder" is unchecked unless you open the location backends page temporarily.
Logcat:
Microg is setup as it is in the lineage4microg repo with prebuilts and the following permissions:
The text was updated successfully, but these errors were encountered: