How to achieve the above? I want to perform certain actions when the phone rings while it is not being used. So, for this, I used the setup as per the subject.
But the actions were not being performed. When I checked the log, I saw that it's due to "constraint failed: Screen Off."
I think what's happening is that as soon as the phone rings, the screen turns on, so this constraint is failing.
So, now how to distinguish an incoming call when the phone's screen is off vs. when the screen is on?
But the actions were not being performed. When I checked the log, I saw that it's due to "constraint failed: Screen Off."
I think what's happening is that as soon as the phone rings, the screen turns on, so this constraint is failing.
So, now how to distinguish an incoming call when the phone's screen is off vs. when the screen is on?