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

Silence phone for unknown callers

Hello, chiphaven, thanks for joining Android Forums! :)

It's quite possible to do what you're asking... below explains how to set it up for sleep mode, but you could quite easily modify it if you wanted.

First, you need to create a profile called "Sleep Mode":

Add Context Power
Source: AC //You can also set this to all when you
//charge your phone using USB.

Add Context Time
From: 22:00
To: 07:00
Repeat: Off

Add Start Task
1. Silent Mode
Mode: On
2. Variable Set
Name: %SLEEPMODE
To: 1

Add Exit Task
1. Silent Mode
Mode: Off
2. Variable Clear
Name: %SLEEPMODE

Next, you would need to create profile "Sleep Mode Emergency Calls":

Add Event Phone Ringing
Caller Number: Add all the numbers you want to get through.

Add Start Task
1. If
%SLEEPMODE = 1 // Make sure you use the Maths: Equals (=),
// and not the Matches (~) to compare. We are
// dealing with numbers here :p.
2. Silent Mode
Mode: Off
3. Wait
Minutes: 5
4. Silent Mode
Mode: On
If: %SLEEPMODE = 1// Here, we check if SLEEPMODE = 1 again, since
// we do not want to set Silent Mode to on again
// if you took the call.
5. End If

This was all taken from the Tasker Wikidot page - if you'd rather download and import the task, you can head there :)
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones