MuntashirAkon / AppManager

A full-featured package manager and viewer for Android
https://muntashirakon.github.io/AppManager/
Other
4.49k stars 264 forks source link

Few bugs with 'Freeze/unfreeze' shortcuts #1040

Open resiehnnes opened 1 year ago

resiehnnes commented 1 year ago

Please check before submitting an issue

Describe the bug

First problem:

After creating a shortcut for already freezed app (long press 'Freeze/unfreeze' button) and setting up 'Open app after unfreezing' and 'Automatically freeze app when the phone is locked' the shortcut is placed on home screen but the icon is darker then it supposed to be, and gets completely black when the app is freezed after locking and unlocking phone (when 'Automatically freeze app when the phone is locked' is triggered)

Second problem:

'Automatically freeze app when the phone is locked' trigger works only for the first time and fails to freeze app after first 'lock/unlock' cycle leaving 'Waiting for the phone to be locked...' active despite further locking and unlocking the phone.

Device info

MuntashirAkon commented 1 year ago

After creating a shortcut for already freezed app (long press 'Freeze/unfreeze' button) and setting up 'Open app after unfreezing' and 'Automatically freeze app when the phone is locked' the shortcut is placed on home screen but the icon is darker then it supposed to be, and gets completely black when the app is freezed after locking and unlocking phone (when 'Automatically freeze app when the phone is locked' is triggered)

I'm not sure what's causing it. Did you check that the launcher is not improvising anything? Some launchers seem to apply certain adaptive filters which can cause this.

'Automatically freeze app when the phone is locked' trigger works only for the first time and fails to freeze app after first 'lock/unlock' cycle leaving 'Waiting for the phone to be locked...' active despite further locking and unlocking the phone.

I don't really know if this issue can be fixed. Detecting phone lock isn't an easy thing to do since Android does not provide an API to monitor that. But I'll see if I can reproduce it.

resiehnnes commented 1 year ago

I'm not sure what's causing it. Did you check that the launcher is not improvising anything? Some launchers seem to apply certain adaptive filters which can cause this.

I am using stock launcher with stock icons if that makes any difference. I also tried with 3rd party launcher which has same problem. Made some screenshots so you can see how it looks.

App info:

01

Creating a shortcut for this app:

03

Shortcut is placed on homescreen:

04

Shortcut after 'Freeze/unfreeze' cycle:

05

And it stays black if I keep freezing or unfreezing app, but gets back to normal if I do close AppManager from recent tasks and use the shortcut again, but then shortly after it becomes darker, and completely black.

I don't really know if this issue can be fixed. Detecting phone lock isn't an easy thing to do since Android does not provide an API to monitor that. But I'll see if I can reproduce it.

Yesterday it seemed that AppManager were able to detect first phone lock successfully and freezed the used app, but today for some reason 'Automatically freeze app when the phone is locked' doesn't get the job done even after the first 'lock/unlock' cycle.

MuntashirAkon commented 1 year ago

I am using stock launcher with stock icons if that makes any difference. I also tried with 3rd party launcher which has same problem. Made some screenshots so you can see how it looks.

It's weird. Since the app was already frozen, the shortcut offered was a dimmed version of the icon. So, when you click on the icon again, i.e. unfreeze the app, it should return to the original icon. I have to see if there's an issue with updating shortcuts in Android 10.

resiehnnes commented 1 year ago

@MuntashirAkon Yep, when frozen app with dimmed shortcut is launched the icon stays dimmed, and gets black when I freeze app using the same shortcut.

J4CKED commented 1 year ago

In my case, these add-ons do not work:

In addition, the icon of the frozen application after unfreezing continues to be dimmed. After creating a new icon, it remains normal, regardless of whether the application is frozen or unfrozen.

Android 12 v3.1.0 Stable Lawnchair Launcher

MuntashirAkon commented 1 year ago

Tested on three devices regarding the dimming of icons:

  1. Android 11 - Lineage OS 18.1 (my device, working as expected)
  2. Android 13 - Emulator (working as expected) ^a13
  3. Android 8.1 - Emulator (working as expected) ^a8.1

So, this might be emitted by something else e.g. adaptive icons or other icon packs when enabled.

MuntashirAkon commented 10 months ago

It looks like icons are not dimmed at all in the production releases, but works in debug releases. Weird.

EDIT: The toggle does not work in production releases. If it's already dimmed, it no longer un-dims when unfrozen, or vice versa.

shuvashish76 commented 9 months ago

'Automatically freeze app when the phone is locked' trigger works only for the first time...

For me it doesn't work at all. Android 12, mode: root, latest debug version.

Detecting phone lock isn't an easy thing to do since Android does not provide an API to monitor that.

Request to check how "block all apps on device locked" firewall feature works for RDNS. (ref: link)

MuntashirAkon commented 9 months ago

Here's the definition of what App Manager means by locked phone:

The phone is secured by a PIN, pattern or password, and the phone or a SIM card is currently locked.

If you do not use these, the phone will not be considered locked, and the apps won't be frozen.