I use the attached macro, which incorporates concepts from both
@Qarboz and
@Endercraft. I wanted my phone to ring only for people in my Contacts list, and quickly vibrate once for non-contacts...
You'll want to do the following, in addition to importing the macro:
- Go into Android settings and set the Ringtone to "None". That way you won't hear both that ringtone and the MacroDroid-initiated sound
- Edit the macro's 5th action (the Play/Stop Sound action) to point to whatever ringtone you want to use for Contacts
- If desired, create a shortcut for the macro on your home screen, which will toggle on and off ringing for all calls (non-contacts as well as contacts). I use that if I don't want to miss a call from a non-contact (a return call from a e.g. plumber).
- If you wanted to hear a different ringtone for non-contacts instead of just a quick vibration, you'd want to add change the Vibrate action (the 11th action) to a similar Play/Stop Sound scheme as used for contacts, or just rework that section to have different If clauses and play a different sound file for non-contacts
Also note: the macro is not supposed to play the sound file if one is already in a call (i.e., someone else calls you while you're already on a call) -- the
While loop is supposed to execute only while "In Call" is false. For some reason, this doesn't work, and the sound still plays if a second call comes in while already on a call. That's why there's the "Shake" trigger, to force the sound to stop -- a bit of a hack. It doesn't happen that I get multiple calls at once, so I've just lived with it.