BLumia / pineapple-lock-screen

Turn the screen off without using the physical power button.
https://link.blumia.net/lockscreenplus-playstore
GNU General Public License v3.0
37 stars 1 forks source link

No longer works on Android 14 #8

Closed valiantgenomics closed 1 year ago

valiantgenomics commented 1 year ago

Hey I absolutely love this app!

The Lock Screen button in the drop-down menu is what makes it so good. And it worked flawlessly on Android 13.

But no longer works after updating to Anrdoid 14, unfortunately.

It crashes and this is the error log:

type: crash
osVersion: google/cheetah/cheetah:14/UP1A.231005.007/2023100900:user/release-keys
package: net.blumia.pineapple.lockscreen.oss:8
process: net.blumia.pineapple.lockscreen.oss
processUptime: 9101 + 404 ms
installer: com.looker.droidify
java.lang.UnsupportedOperationException: startActivityAndCollapse: Starting activity from TileService using an Intent is not allowed.
    at android.service.quicksettings.TileService.startActivityAndCollapse(TileService.java:355)
    at net.blumia.pineapple.lockscreen.QuickSettingService.onClick(Unknown Source:15)
    at android.service.quicksettings.TileService$H.handleMessage(TileService.java:494)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8199)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
BLumia commented 1 year ago

Hi, thanks for the report and I'll look into it later.

Starting activity from TileService using an Intent is not allowed.

To confirm, you attempted to lock the screen via the Quick Setting tile, is that correct?

valiantgenomics commented 1 year ago

Thanks for that!!

Yes, it doesn't work via the Quick Setting tile Lock Screen shortcut.

If for example, you create a Lock Screen Widget and place it amongst your apps, it works 2-3 times, but then it also starts to crash.

So neither of the options really work.

It's definitely this:

Starting activity from TileService using an Intent is not allowed.

That's preventing it from working properly.

Fishy00000 commented 1 year ago

Same problem with me

BLumia commented 1 year ago

Thanks for the info!

Currently, you can try if removing the lock screen shortcuts from your launcher screen, then turn off the "Use compat shortcut method" from the lock screen settings screen, and then create an icon shortcut via the system's widget screen, and see if that works.

Either way, I'll look into this issue this weekend.

valiantgenomics commented 1 year ago

Thanks for the info!

Currently, you can try if removing the lock screen shortcuts from your launcher screen, then turn off the "Use compat shortcut method" from the lock screen settings screen, and then create an icon shortcut via the system's widget screen, and see if that works.

Either way, I'll look into this issue this weekend.

Thanks! Yeah, I tried doing that but eventually it crashes as well. Hopefully, there's a fix, since this is by far the app with the most utility on my phone.

BLumia commented 1 year ago

Hi,

I've been working on a fix and here is a local build that I did earlier today. This should probably fixes this issue so you can try this version and see if the issue still exists:

app-oss-debug.zip

It's a debug build apk so the apk file size is larger than a regular build. You might need to uninstall the previous version to use the debug build, and when sideloading the package, you might get a "Restricted setting" warning while trying to enable the accessibility service (which is something new since Android 13). If so, please see https://support.google.com/android/answer/12623953 for the solution.

I did test the fix on my Pixel 7 device with stock Android 14. It'll hopefully work on other custom Android 14 ROMs. I'll do a release if everything goes well, and please feel free to let me know if that doesn't work.

BLumia commented 1 year ago

The TileService issue is addressed in 1.3.0. Version 1.3.0 has been released and is now available on Google Play, and probably soon on F-droid once their CI build is done. Closing as fixed :)

valiantgenomics commented 1 year ago

Hey sorry to open this up again,

I just found something peculiar with the app which I'm not sure is a bug or a feature.

If we don't have any screen lock protection, i.e. PIN. If the screen lock is set to - None.

Then the Pineapple shortcut from the drop-down/tile menu doesn't necessarily lock the screen, it just shuts it off.

When you tap/move the phone to wake it up - the screen lights up as if it was never locked. You're not seeing the lock screen where you have to swipe to unlock. You immediately see where you left of previously before clicking the Pineapple tile shortcut.

If you have a PIN, though. Then it locks the screen.

However, if you open the Pineapple app itself and then click lock screen without a PIN, the screen locks properly.

So again, it's just the drop-down/tile shortcut that's causing this.

And I'm not sure if this is intended or a bug.

Please let me know