Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After finishing ACS Schedule don't go always to homescreen #1240

Closed
MarkyMarkDE opened this issue Jun 21, 2024 · 11 comments · Fixed by #1320
Closed

After finishing ACS Schedule don't go always to homescreen #1240

MarkyMarkDE opened this issue Jun 21, 2024 · 11 comments · Fixed by #1320
Labels
Automation Accessibility service related c: Scheduler Device specific A device specific issue or behavior.

Comments

@MarkyMarkDE
Copy link

MarkyMarkDE commented Jun 21, 2024

In addition to #1229:

It's not the best way, to go always to Homescreen after finishing the ACS Schedule, on AndroidTV this action closes the current running TV App (in my case waipu TV) and goes to the "waipu TV Home" App.
On Android 15 it close also the last running and "active" App.

Is it not possible only try to force close SDMaid if it was not opend before the Scheduler run?

Version 1.1.1-beta0
AndroidTV 11, Android 15

@MarkyMarkDE MarkyMarkDE changed the title After Schedule don't go always to homescreen After finishing ACS Schedule don't go always to homescreen Jun 21, 2024
@d4rken d4rken added c: Scheduler Device specific A device specific issue or behavior. Automation Accessibility service related labels Jun 21, 2024
@d4rken
Copy link
Member

d4rken commented Jun 21, 2024

There is no direct way to just close SD Maid without root or shizuku.

The previous way of pressing back button stopped working in Android 14 or 15 in my tests, which is why I changed the method of closing the last app.

🤔 not sure at the moment on how to further improve this.

@MarkyMarkDE
Copy link
Author

MarkyMarkDE commented Jun 21, 2024

Sorry but the current solution isn't good at all.

Please bring back the old method with pressing the back button.
I'm pretty sure, that this method on AndroidTV 11 will work and maybe on Pixel 7 with Android 14 too.
If this changes becomes effect in Android 15, so we need to find another way to handle or maybe a little different way will be possible then.

So i think, why should g* remove a navigation method or function element without any kind of replacement?
Let me help you to investigate, need so much information as I can have to be able to do.

With the current solution the user can lost data while sdmaid-se kills all and always go to home.
Example: the user writes something like email or chat (he didn't save it) and sdmaid-se runs with schedule and ACS and after finishing, it closes all previous opend apps, the text from user before is lost.

Can only talk about myself the old solution with the back button has always worked for me on all devices in the past.
Think about AndroidTV, here we are on 11 so the old method will work.

@MarkyMarkDE
Copy link
Author

MarkyMarkDE commented Jul 13, 2024

I have tested now from the current version down to 0.23.0 and all is great again. On all my devices the "push back" method do work perfect.

AndroidTV 11 Patches from April 5th 2024
Android 14 Patches from July 5th 2024

Conclusion:
0.23.0 works as expected and SDMaid SE really "fly through the system"
0.24.0 up to 1.0.0 has open SDMaid SE UI which wasn't opened by me (should background process only)
Start with 1.0.1 goes after finishing scheduled ACS always to home screen and closes all previous opened apps

Please check 0.23.0 too and if you are able to confirm, bring back this method from 0.23.0, maybe you had if you tested it in past an bug in your testing system or something, so I really, really hope 😉

To summarize, something happened between 0.23.0 and 0.24.0 that changed either the push back method or SDMaid SE itself, I don't know what exactly with all the changes and improvements.
But I'm pretty sure, that you will find the main problem and after we can use the push back method in future releases again 😉.

d4rken added a commit that referenced this issue Jul 16, 2024
…stead of home button after finishing ACS operations.

This restores behavior the < v0.24.0 behavior of returning to SD Maid or the previous app by using the back button.
Using the home button can interfere with Android TV launchers (see #1240).

Fixes #1240
d4rken added a commit that referenced this issue Jul 16, 2024
…stead of home button after finishing ACS operations.

This restores behavior the < v0.24.0 behavior of returning to SD Maid or the previous app by using the back button.
Using the home button can interfere with Android TV launchers (see #1240).

Fixes #1240
@MarkyMarkDE
Copy link
Author

MarkyMarkDE commented Jul 16, 2024

Fixed on AndroidTV only?
In Android 24 the old method do also work well

@d4rken
Copy link
Member

d4rken commented Jul 16, 2024

As far as I understood it:
The core issue was that SD Maid pressing the home button would close a previous app that was open. In my mind, this could be common on a TV (which may be always on), but doesn't seem common to me for a phone. Which phone is always on with an app that isn't the launcher?

In my tests it only needed 1 back press on Android TV, so it's reliable here and restoring the previous behavior has no downside, but for phones this is not the case.

I changed the behavior because the back button presses have two issues:

  • On some ROMs, pressing the back button via accessibility service had no reaction (I think it was Android 14 or 15, not sure which manufacturer).
  • The amount of "back presses" that are needed to just close the system windows is not the same for each ROM, so I would need to make this dynamic. So sometimes it was not enough back presses and sometimes too many.

Can you elaborate your Android phone use-case further?

Why do you have an unlocked Android 14 phone with another application open when the scheduler trigers?

@MarkyMarkDE
Copy link
Author

MarkyMarkDE commented Jul 16, 2024

I have a Pixel 7 (not rooted in any way) with the default Pixel launcher and version 0.23.0 works here perfect (Android 14 with July 24 patches).

If Android 15 really change anything for that case, we should find a better way as close really all opened apps and go to the home screen.
I will help so good I can.
When you need more details please come back to me.
For my case, you can also restore the push back method, it really works!

@MarkyMarkDE
Copy link
Author

MarkyMarkDE commented Jul 16, 2024

Sorry deutsch:

Auf AndroidTV immer push back Methode, darüber sind wir uns ja einig 😍👍.
Dass Google hier sowas wichtiges ersatzlos entfernt, kann ich mir nicht vorstellen, da es ja keine Wischgesten oä. gibt.

Auf anderen ROMs versuchen wir zuerst die Push back Methode und wenn die fehlschlägt, nutzen wir die go home Methode.
Wäre das akzeptabel und möglich?

Die Regeln kann man ja sicher auch abwandeln oder erweitern, falls nötig.

@d4rken
Copy link
Member

d4rken commented Jul 16, 2024

Wäre das akzeptabel und möglich?

🤔 possible...

Auf anderen ROMs versuchen wir zuerst die Push back Methode und wenn die fehlschlägt, nutzen wir die go home Methode.

This would solve the issue of "back button" not working, but leave issue of needing different (1-3?) back button presses depending on the ROM. This could be fixed though if I make this a configurable action depending on the ROM type 🤔

I will need to test this to see if the failed back button presses can be detected.

Can you make a new ticket? This would be an enhancement to the AppCleaner's ACS feature. To improve the reliabilitly.

@MarkyMarkDE
Copy link
Author

Please do open the ticket by self, my English is bad and maybe misunderstanding, so it is better when you wording it, at least you must understand it 😉

@MarkyMarkDE
Copy link
Author

Which rules we need, don't know.
I thought we find a relative "Simple" way.
No, always go home isn't the method what I thinking of 😉

@MarkyMarkDE
Copy link
Author

MarkyMarkDE commented Jul 16, 2024

Übrigens wird warum auch immer und von wem auch immer, das Rollout von AndroidTV 12 immer wieder verschoben.
Hoffentlich behalte ich mit der Vermutung Recht, dass Google sowas wichtiges nicht ersatzlos streicht. Bei waipu.tv gibt es ja noch die Besonderheit, dass es hier eine klassische Fernbedienung gibt, die natürlich weiterhin funktionieren muss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation Accessibility service related c: Scheduler Device specific A device specific issue or behavior.
Projects
None yet
2 participants