Neamar / KISS

Lightning fast, open-source, < 250kb Android launcher
https://kisslauncher.com/
GNU General Public License v3.0
2.95k stars 580 forks source link

Can't remove or add shortcut on Android 7 #1399

Open alexanderlavrenko opened 4 years ago

alexanderlavrenko commented 4 years ago

"Remove shortcut" button doesn't work (it disappears and reappears immediately) for a shortcut created from Firefox (Firefox bookmark). It was created about a year ago.

After hitting "Remove shortcut" button for "Sleep and Hibernate" shortcut (Greenify) it worked as it should but after trying to recreate it again the shortcut doesn't appear on the menu.

saveman71 commented 4 years ago

I tried creating a shortcut in FF and I was able to remove it.

Are you able to do that? (create one and remove it)

alexanderlavrenko commented 4 years ago

I tried creating a shortcut in FF and I was able to remove it.

Are you able to do that? (create one and remove it)

What's your system, version of app and device?

After trying to create a shortcut in FF it doesn't appear in KISS but does appear in the stock launcher even though KISS is set to be default launcher. Clearing data didn't help as well as the reinstallation of KISS. Interestingly enough, after reinstalling KISS all my data returned with it. So, now it's just like before I cleared the app's data. Weird.

saveman71 commented 4 years ago

Play store version, Pixel 3XL latest update

alexanderlavrenko commented 4 years ago

Play store version, Pixel 3XL latest update

I also have Xiaomi Mi A2 Lite (Android 9.0, Android One) and it indeed works.

But it doesn't work with LG for some reason. Maybe because it's not a stock Android version (LG's firmware, not a custom ROM)?

Neamar commented 4 years ago

The fact that you're not seeing new shortcuts in KISS is surprising, and may be the root cause indeed.

Have you user other launchers before? Are you able to add custom shortcuts with any other launcher?

alexanderlavrenko commented 4 years ago

The fact that you're not seeing new shortcuts in KISS is surprising, and may be the root cause indeed.

Have you user other launchers before? Are you able to add custom shortcuts with any other launcher?

I've tried Nova Launcher and adding custom shortcuts works indeed.

I want to emphasize that everything is good on my phone and the problem happened only with the tablet. Weird.

Also, I was just wondering why after reinstalling the app my settings have 'restored' (including history) when there is no option to make a backup and then restore your settings?

Neamar commented 4 years ago

Also, I was just wondering why after reinstalling the app my settings have 'restored' (including history) when there is no option to make a backup and then restore your settings?

This is the Play Store doing dark magic with your settings :) All settings are backed up regularly and restored when you reinstall.

Without being able to reproduce, this one is going to be really hard to debug.

Are you able to use Android Studio to get some logs?

alexanderlavrenko commented 4 years ago

I never thought the Play Store could store my data without Google authentication in the Android app.

Well, that's unfortunate. I have a lot of things to do now and just don't have time for this. Most of the time I'm working with Python.

While I have Android Studio installed on my PC to this day I couldn't find time to learn it. Maybe someday in the future but that seems unlikely for now.

So, I'm using Smart Launcher now which is another powerful option. But KISS is still really good, everything works on my phone.

Best of luck @Neamar

cb8121 commented 4 years ago

Hello, I have the same issue.

Trying to create a shortcut to a website or web app (with firefox) as well as creating a shortcut to a whatsapp contact or group fails. Nevertheless, the shortcuts appear in the built in launcher.

Neamar commented 4 years ago

And KISS is your default launcher?

cb8121 commented 4 years ago

Yes, KISS is set as my default launcher. I used like a search app within the default launcher a while but I switched to it as the default launcher.

Neamar commented 4 years ago

Alright, so I'm assuming it's indeed something wrong with Android 7 :\

Would you be able to help if I gave you pointer in the code?

cb8121 commented 4 years ago

I would like to help, but unfortunately I'm not a developer or coder...

jddcef commented 4 years ago

I have this issue too. Create a shortcut to a page using Chrome. Add it to kiss favourites. It doesn't work after using it once or after some time, not sure what trigger is. But happens to me every time I do this and forget it's broken.

I can't long press it nor launch it from Favorites above the search bar.

If I turn off the kiss setting for Favorites above search bar, then it works again and I could even remove the favorite from inside the search bar favorite list.

Redmi 6. Miui 11.0.4. Android 9. Default launcher kiss.

daffydock commented 4 years ago

I have the same issue with an Android 7 device as well. Shortcuts do not work. It really does not matter what app I use, nothing shows. It does not matter if the shortcut is made using FF, or Hermit, or any browser or if making a shortcut via the Signal app. Nothing works. However shortcuts show if I use Nova or the Launcher that came preinstalled with the phone. Or any other launcher, that I have tried.

It is worth noting that TBog's own launcher that is based off KISS has working shortcuts. From any app. They all show.

esijg commented 4 years ago

I am noticing the same behaviour on Android 7.1.2, LG K10. Shortcuts don't seem to show up in KISS although they do in other launchers.

I am a developer (although not experienced with android development) so feel free to poke me @Neamar if you want me to debug this further and give you more detailed information.

Neamar commented 4 years ago

Hey! Great :) Can you run a debug version on your device and look if there is any log when you try adding a shortcut?

Thanks!

esijg commented 4 years ago

As noted, not really experienced with android development, but I think I've set things up correctly here on my end. The only log lines that appear when I try to add a shortcut are the following. I've tried adding shortcuts with latest Firefox from PlayStore, and also Lightning from FDroid.

2020-10-12 19:43:46.938 24070-24070/fr.neamar.kiss.debug D/MainActivity: onResume()
2020-10-12 19:43:46.985 24070-24105/fr.neamar.kiss.debug D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
2020-10-12 19:43:46.995 24070-24070/fr.neamar.kiss.debug V/Timing: Time to run query `<history>` on HistorySearcher to completion: 56ms
2020-10-12 19:43:47.066 24070-24070/fr.neamar.kiss.debug I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@b42bad1 time:109997886

Does this help? anything else I can do to debug this?

Neamar commented 4 years ago

Sadly, not really.

Searching back in my (flawed) memory. If I remember correctly, in Android 8, they introduced dynamic shortcuts, a heaping pile of garbage that replaced the old flexible system with a new "more secure" system where only the main launcher can access shortcuts, under certain condition.

They completely stopped supporting the old way.

We must have removed all code from "the old way" at some point...

Adding it back now would probably require some work, but not too much: one would have to retrieve the old ShortcutProvider, ShortcutPojo and LoadShortcut files, rename them to OldshortcutProvider, etc. and load them from the DataHandler.

I can probably guide someone, but I don't have an older device available and my laptop is not able to run a VM at decent speed anymore :roll_eyes:

Anyone interested?

esijg commented 4 years ago

To be honest, from my perspective, even if I am on an Android 7 device myself, I feel like the work is not really worth it. Especially given the fact that Android 7 is not officially supported anymore by Google, and if I am not mistaken, 7.0's market share (relative to other android versions) is only about 7 or 8%.

With that said, would be lovely if someone would be interested in taking on this task, but I don't think it will be me sadly.

PS: If someone does give this a try, I would be more than happy to help testing the work.

daffydock commented 3 years ago

Well, @johannesgunnar, I guess people who have devices on 7 can switch to @Tbog's TinyBit Launcher since shortcuts work there and his launcher is based off KISS. Not the most elegant solution from a software perspective but if you want working shortcuts there is that option. That is what I do now.

syphyr commented 5 months ago

Is this bug related to "Add to Home screen" in Firefox? I have a device running cm-14.1 and when I select "Add to Home screen", nothing is added. Here is the relative lines from logcat:

04-24 01:58:51.180  2077  2077 I LatinIME: onFinishInput
04-24 01:58:51.207  7249  7249 W Launcher: setApplicationContext called twice! old=android.app.Application@620226c new=android.app.Application@620226c
04-24 01:58:51.256   929 18736 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=fr.neamar.kiss/.MainActivity} from uid 10074 on display 0
04-24 01:58:51.385  2077  2077 I LatinIME: onFinishInput
04-24 01:58:51.426   929   939 I art     : Background partial concurrent mark sweep GC freed 145638(6MB) AllocSpace objects, 3(116KB) LOS objects, 33% free, 21MB/32MB, paused 1.168ms total 104.798ms

Edit: Looks like the shortcut was added to Trebuchet launcher's homescreen, even though that is not defined as the default launcher.

syphyr commented 5 months ago

Sadly, not really.

Searching back in my (flawed) memory. If I remember correctly, in Android 8, they introduced dynamic shortcuts, a heaping pile of garbage that replaced the old flexible system with a new "more secure" system where only the main launcher can access shortcuts, under certain condition.

They completely stopped supporting the old way.

We must have removed all code from "the old way" at some point...

Adding it back now would probably require some work, but not too much: one would have to retrieve the old ShortcutProvider, ShortcutPojo and LoadShortcut files, rename them to OldshortcutProvider, etc. and load them from the DataHandler.

I can probably guide someone, but I don't have an older device available and my laptop is not able to run a VM at decent speed anymore 🙄

Anyone interested?

If you want to provide a patch, I can test it on Android 7.1.