UnifiedNlp icon indicating copy to clipboard operation
UnifiedNlp copied to clipboard

Feature request: Button to reload all backends

Open ale5000-git opened this issue 8 years ago • 12 comments

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.

ale5000-git avatar Aug 02 '17 16:08 ale5000-git

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 avatar Aug 02 '17 17:08 n76

@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.

ale5000-git avatar Aug 02 '17 17:08 ale5000-git

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.

Raeitus avatar Mar 16 '18 19:03 Raeitus

@realmain: No, they are runtime permissions so they must be granted by the user.

ale5000-git avatar Mar 16 '18 22:03 ale5000-git

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).

ale5000-git avatar Mar 16 '18 23:03 ale5000-git

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.

n76 avatar Mar 16 '18 23:03 n76

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 avatar Mar 16 '18 23:03 bam80

@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.

ale5000-git avatar Mar 17 '18 00:03 ale5000-git

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 avatar Mar 17 '18 01:03 bam80

@bam80: Well, call it continuously would be a waste of resources since backends are always needed.

ale5000-git avatar Mar 17 '18 16:03 ale5000-git

+1 to this request, as debugging backends issues can get really tedious, especially when combined with LineageOS' Privacy Guard/Trust settings.

breversa avatar Aug 20 '18 08:08 breversa

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.

breversa avatar Oct 01 '18 09:10 breversa