Detect when apps are manually removed from memory
Posted: 25 Mar 2019 23:48
Hi, posting here again, as I couldn't find the answer to this searching around in the forum. As I mentioned in the previous topic I made, I recently upgraded from Android 8 to 9. In the previous version, I found out that everytime I removed an app from the multitask, an Announcement was made by the system, which could be detected by trigger UI Event, and due to its straight forward format ("[app_name] dismissed"), I could exactly know which app was removed. This served for me the purpose to know when certain apps I opened before that required to disable root access, were no longer running in the background, and so allowed to, after closing them, enabling root access again.
Now in Android 9, that announcement is no longer made or it's just empty, and other UI Events don't help either. So I guess I had to look for another and maybe better method. I read that I could use a root command to check if an app process is running, so I could run that whenever I swiped away an app, and so know if that app was the one I wanted. But as I said, by that moment Automagic wouldn't be able to run any root related actions, so I'm stuck and maybe hope you can help me.
As always, thanks.
Now in Android 9, that announcement is no longer made or it's just empty, and other UI Events don't help either. So I guess I had to look for another and maybe better method. I read that I could use a root command to check if an app process is running, so I could run that whenever I swiped away an app, and so know if that app was the one I wanted. But as I said, by that moment Automagic wouldn't be able to run any root related actions, so I'm stuck and maybe hope you can help me.
As always, thanks.