Android icon indicating copy to clipboard operation
Android copied to clipboard

Deleting card doesn't remove shortcut widget

Open TheLastProject opened this issue 3 years ago • 4 comments

TheLastProject avatar Dec 15 '21 20:12 TheLastProject

Hello! I've been digging around shortcuts related topics and found this https://developer.android.com/develop/ui/views/launch/shortcuts/managing-shortcuts

Because pinned shortcuts appear in the launcher itself, they're always visible. A pinned shortcut is removed from the launcher only in the following situations:

  • The user removes it.
  • The app associated with the shortcut is uninstalled.
  • The user clears an app's data by going to Settings > Apps & notifications, selecting an app, then pressing Storage > Clear storage.

So it looks like it is not possible for app to uninstall shortcuts from launcher. It used to be possible, however, https://developer.android.com/reference/android/Manifest.permission#UNINSTALL_SHORTCUT, but Android devs decided to remove this permission because it allowed any app to delete any shortcut. I think the only option would be to disable shortcuts, so when users sees a greyed out shortcut on their launcher, they remove them manually

Pinkolik avatar Oct 14 '22 12:10 Pinkolik

Hello! I've been digging around shortcuts related topics and found this https://developer.android.com/develop/ui/views/launch/shortcuts/managing-shortcuts

Because pinned shortcuts appear in the launcher itself, they're always visible. A pinned shortcut is removed from the launcher only in the following situations:

  • The user removes it.
  • The app associated with the shortcut is uninstalled.
  • The user clears an app's data by going to Settings > Apps & notifications, selecting an app, then pressing Storage > Clear storage.

So it looks like it is not possible for app to uninstall shortcuts from launcher. It used to be possible, however, https://developer.android.com/reference/android/Manifest.permission#UNINSTALL_SHORTCUT, but Android devs decided to remove this permission because it allowed any app to delete any shortcut. I think the only option would be to disable shortcuts, so when users sees a greyed out shortcut on their launcher, they remove them manually

Thanks a lot for this detailed explanation! Greying out a shortcut sounds like a good idea :)

Altonss avatar Oct 14 '22 12:10 Altonss

@Altonss, no problem :)

@TheLastProject, if you find that it's an appropriate solution I can easily implement this since I've already explored shortcuts related code and working on another shortcuts issue

Pinkolik avatar Oct 14 '22 14:10 Pinkolik

I'm so sorry, I confused shortcuts and widgets when making this issue. Catima doesn't make any extra shortcuts I believe, it's about widgets not being removed and tapping them just causing Catima to start with "Could not find that card".

TheLastProject avatar Oct 14 '22 19:10 TheLastProject