Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to provide customized vibration on specific incoming calls
    text
    copied!<p>The program functions like this: the user has a list of phone numbers, for which the cellphone could vibrate upon an incoming call only when no other system-wide application would provide vibration (such as in mute mode). I know that this is somehow against the rules, for that an application should respect the users' settings, but the application is limited to some certain users with this need. I have tried two ways but neither of them are satisfying:</p> <ol> <li><p>Listen to the telephony state and directly trigger the vibration service with my own pattern (with <code>Vibrator.vibrate()</code>). This method is effective with no incoming calls yet randomly effective when the phone is in <code>CALL_STATE_RINGING</code> state and I guess it's because of the conflict with the system-wide application that actually handles the vibration upon incoming call.</p></li> <li><p>Judge whether the cellphone is vibrating upon an incoming call (with <code>AudioManager.shouldVibrate()</code>), and decide whether to change the vibrate settings (with <code>AudioManager.setRingerMode()</code> and <code>AudioManager.setVibrateSetting()</code>). If the vibrate settings are changed by my application, they are to be restored once the cellphone is back to <code>CALL_STATE_IDLE</code> state. This method, however, is still not functioning sometimes, without any sign of the reason.</p></li> </ol> <p>I hope that someone could give some advice on this issue. Comments on these two ways or other suggest are welcome.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload