[Project Share] Monitor when a display is added or removed and when its properties change
Click to download
The code in this project were written with the assistance of AI tools. The code can be checked here. Tested in HyperOS3 (Android 16).
What does this project do ?
- Monitor display events by using DisplayListener class. https://developer.android.com/reference/android/hardware/display/DisplayManager.DisplayListener
- Surface the events via Tasker command system.
- The current display information can be viewed via global variable %Display.
May require the latest version of beta (or Direct purchase) since Joao has condition for Command Event. It's not actually necessary but make things easier to define the profile.
It's still a little bit difficult to use though since I use full class path. But can be shortened with using *DisplayListener.onDisplayAdded* or *onDisplayAdded*
I will try to make it easier later if Joao were to introduce his concept of custom state, event and action mentioned here.