• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Using Tasker to read incoming text with prompt

elight

Lurker
Hi everyone,

I'm trying to get Tasker to read an incoming text when I'm connected to a Bluetooth device (which for the most part means that I'm in my car). The wrinkle is that I want a prompt asking me if I want it to be read, as I don't want personal/private texts automatically read when other people are in the car.

I have this mostly worked out, using Tasker's built-in voice action. The problem is that it only works if the screen is on (otherwise the voice prompt just hangs waiting for the phone to be unlocked). This is fine if I'm using a navigation app, but usually I'm not. Using Secure Settings, I can turn the screen on, but even this doesn't unlock the phone (even if the phone only uses a swipe gesture to unlock, as opposed to a password or pattern). If I disable the lock screen entirely, it will work, but I fear that this will result in the phone frequently being turned on in my pocket, etc. I know Secure Settings has an action to unlock the device, but it's not available on the S6 without root.

Anyone have any ideas? Is there an alternative 3rd-party lock screen that works as a Tasker plugin that I could use?
 
Of course, as soon as I post this, after two days of searching, I find that there's a plugin called Keyguard that does this exact thing. So I think the problem is solved.

Here's the Task if anyone's interested (using only Keyguard plug-in; Secure Settings plug-in not required so long as your screen already turns on when you receive a text/notification):

Ask To Read Text (8)
A1: Keyguard [ Configuration:Keyguard dismiss Package:com.balda.keyguard Name:Keyguard Timeout (Seconds):0 ]
A2: Wait [ MS:267 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A3: If [ %SMSRN neq %SMSRF ]
A4: Say [ Text:Incoming text from %SMSRN, shall I read it? Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
A5: Else
A6: Say [ Text:Incoming text, shall I read it? Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
A7: End If
A8: Get Voice [ Title: Language Model:Free Form Language: Maximum Results:1 Timeout (Seconds):5 ]
A9: Say [ Text:%SMSRB Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %VOICE ~ yes ]

Two notes:
1. I added an if clause that announces the texter's name if it is found in my contacts (this is done by comparing the "text from" variable to the "text from name" variable - if they're different, then it means that it found a name).
2. I had to pad in some wait time after the Keyguard action, otherwise the "Incoming text from..." sound got cut off at the beginning.
 
I leave my Droid Turbo unlocked and use a Tasker profile to control the proximity sensor. If covered the screen is turned off unless I am on a call in which case it is left on.

When put in my pocket the screen turns off automatically.

Profile: tlaProximity
State: Proximity Sensor
State: Not Call [ Type:Any Number:* ]
Enter: tlaProximityEnter
A1: System Lock

... Thom
 
Back
Top Bottom