franc wrote: ↑Thu Jan 07, 2021 8:50 am
TrianguloY wrote: ↑Wed Jan 06, 2021 5:36 pm
They are app shortcuts, their availability dependes on whether the app currently has the shortcut or not, the intent of both items is the same...
But where are these shortcuts saved in the Backup?
How can it be, that I don't find it in comparison of a backup with a working shortcut and one without?
The conclusion would be, that restoring a backup would break all shortcuts, but this is not.
Good question. I don't have the exact details so my explanation may be slightly wrong, but this is what I think happens.
Since Android...can't remember version, apps can now register what is called 'app shortcuts'. This is a list of shortcuts that the app manually registers (with a special api) and can remove at any time. This list is shown when you use the action 'show app shortcuts'. Those shortcuts use an identifier given by the app (or more precisely by android with some data from the app) and their intent look like this (which you can check using a script to retrieve the intent uri of an item).
#Intent;action=net.pierrox.lightning_launcher.APP_SHORTCUT;S.id=driveShortcut_abcdeffhijklmnopqrstuvwxyz1234567890;S.pkg=com.google.android.apps.docs;end
This intent, when launched, opens the Google docs app, which takes the id and does the corresponding action based on the shortcuts list. The action is from ll, which perhaps means that the launcher converts this internal intent to a different one, unfortunately I haven't checked.
In any case, if the app removes the shortcut, the pair id->action is removed, so when you try to launch it again it says 'not found' because now that id doesn't have a corresponding action.
I haven't checked backups in a long time, but you should be able to find the specific shortcut intent there. The reason the backups aren't different is because they aren't. The intent is the same, the difference is whether the corresponding app has the id-action pair present or not. This is also why restoring a previously working backup does not fix the issue, because the corresponding pair is missing from the app, not the launcher.
As I discovered, moving the shortcut alone seems to remove the old item THEN create the new one, and this triggers the shortcut (the pair) removal from the app. Restoring a backup probably doesn't trigger the removal, so the shortcut remains usable if you restore a backup while the pair is present.