Open opk12 opened 2 years ago
The app is checking here the returned value of [isRequestPinShortcutSupported()](https://developer.android.com/reference/android/content/pm/ShortcutManager#isRequestPinShortcutSupported()) before displaying this action item. There is maybe a missing permission, can you check on the device app settings?
Install shortcuts
and uninstall shortcuts
are in the list for other apps, but not for Element. Do I report to F-droid?
which version of android 7 is the device running? from my understanding android added shortcut support in 7.1.1, so if this device is running 7.0 then unfortunately we won't be able to add shortcuts
https://developer.android.com/reference/android/content/pm/ShortcutManager.html (Api 25) https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels
Version 7.1.1. As said above, the other apps have working shortcuts and have install shortcuts
/remove shortcuts
in the "All permissions" list, Element does not.
@bmarty this might actually be a simple case of using the ShorcutManagerCompat
instead
By default the system version seems to support android 8.0+ but the compat version can go lower
Note: See also the support library counterpart ShortcutManagerCompat.isRequestPinShortcutSupported(Context), which supports Android versions lower than VERSION_CODES#O using the legacy private intent com.android.launcher.action.INSTALL_SHORTCUT.
Yes, this is the current imple : https://github.com/vector-im/element-android/blob/main/vector/src/main/java/im/vector/app/features/home/ShortcutCreator.kt#L57. Is there something else you are thinking about?
ah :facepalm: I confused the ShortcutCreator
for the system version
The X-Needs-Info
label is still present - is there other info I can provide about the phone?
nope, only needed to confirm the exact android 7 version, have removed
Ok. I have not experience in Android development, but where do the install shortcuts
/ remove shortcuts
in the "All permissions" list come from for the other apps? I mean, the app has a hard-coded manifest with the permissions list? Or a build tool generates the list based on the invoked system library's methods?
ideally the permission should come through via the ShortcutCompat
library but there's something strange going on...
I'm also able to reproduce the issue on a 7.1.1 emulator and fix it by manually adding the com.android.launcher.permission.INSTALL_SHORTCUT
permission
7.1.1 | 10 | 7.1.1 WITH PERMISSION | 7.1.1 LAUNCHER (WP) |
---|---|---|---|
For some reason the shortcut permission is being commented by the ShortcutBadger library out during the manifest merging process
it seems the workaround is to long press the element icon from the launcher which will show shortcut options and then long press those to add to the homescreen
it seems the workaround is to long press the element icon from the launcher which will show shortcut options and then long press those to add to the homescreen
How? When I long-press the Element icon on the home (Samsung builtin home screen), I have Select multiple items
- Remove shortcut
- Sleep
- Uninstall
- App info
. Long-pressing them has the effect of a short press.
For some reason the shortcut permission is being commented by the ShortcutBadger library out during the manifest merging process
It was commented 7 years ago...
Maybe just add
<uses-permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:maxSdkVersion="25" />
in our Manifest as a workaround, WDYT @ouchadam ?
How? When I long-press the Element icon on the home (Samsung builtin home screen), I have
Select multiple items
-Remove shortcut
-Sleep
-Uninstall
-App info
. Long-pressing them has the effect of a short press.
I see, this must be launcher dependant, using the Pixel launcher on 7.1.1 I'm able to long press the launcher icon which reveals the launcher shortcuts which I can then long press to add to the home screen
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" android:maxSdkVersion="25" />
in our Manifest as a workaround, WDYT @ouchadam ?
sounds reasonable to me
Steps to reproduce
On my phone, the room settings screen and the app's long-tap context menu have no option to add a shortcut on the home screen. Shortcuts do work in other apps on the same phone.
Intended result and actual result
What did you expect?
To see options to add a shortcut to the home.
What happened instead?
There are no options to add a shortcut to the home.
Your phone model
Samsung
Operating system version
Android 7
Application version and app store
Element Android 1.3.3 (40103030) from F-Droid
Homeserver
matrix.org
Will you send logs?
No