Feature request: Button to reload all backends
Please add a button in microG settings to reload all backends.
When permissions of backends are lost I have to disable them, confirm and re-enable them in microG settings to get the permission requests again.
Sounds more like a problem with the backends than with microG itself. . . Each backend should check to see if it has the privileges it needs when it runs and ask for them if it doesn't. At least it should work that way on recent versions of Android.
What backends have you noticed this being a problem with?
What situations lead up to them losing their permissions?
@n76 Well, I'm not sure if it is a good thing that while using other apps it popup a backend asking for permissions. But I think that while opening microG settings it should check everytime.
Mainly the Mozilla backend (but I think it may happen also to others).
I'm not sure about the cause but it may be something like updating ROM, clean dalvik/ART cache or similar things.
When permissions of backends are lost I have to disable them, confirm and re-enable them in microG settings to get the permission requests again.
This is old, but permissions is set by the OS (and LineageOS Privacy Guard if used), not microG.
@realmain: No, they are runtime permissions so they must be granted by the user.
Another approach could be to add an exported function in every backend, something like "VerifyAndRegrantPermissions()"; so UnifiedNLP can cycle all enabled backends and execute these functions (if exist).
The LocationBackendService object which back ends inherit to be a backend supports a getInitIntent() method which returns an Intent containing all the permissions the backend needs but has not been granted. So your "VerifyAndRegrantPermissions()" is effectively supported by some backends today. You would need code in UnifiedNlp to cycle through the installed backends, make the call to the getInitIntent() method, deal with the needed permissions, etc.
At present, at least in the GmsCore version of UnifiedNlp, calls to that method are only made when you enable a backend.
You would need code in UnifiedNlp to cycle through the installed backends, make the call to the getInitIntent() method
@ale5000-git So I think this Feature request: "Button to reload all backends" as such is inappropriate. Instead, there should be bug report that UnifiedNlp doesn't call that getInitIntent() method anywhere where needed.
@bam80 Well, it may be called: "Button to cycle all backends and call getInitIntent()".
There should be a manual global action to recover from lost permissions without the need of doing it manually for every backend.
as I understood this, if the permissions was lost, the UnifiedNlp should handle it itself and call getInitIntent() when needed, so no separate "Button" needed. But I may be wrong
@bam80: Well, call it continuously would be a waste of resources since backends are always needed.
+1 to this request, as debugging backends issues can get really tedious, especially when combined with LineageOS' Privacy Guard/Trust settings.
Also, I feel that sometimes, backends would silently crash. Re-enabling them manually usually solves the issue, but it's tedious. A button to reload them all would ease the process.