Subscription preference

Notification emails are sent to your Samsung account email address.

* Email : anonymous@samsung.com

  

Close

vibration in silent and blocking mode

Forums View
Started by Samsung Developer hielko.ophoff , 31770 Seed May 04, 2014 13:57 Replies : 2 View : 7505 Likes : 6
In a Gear 2 widget I use navigator.vibrate(). The idea is that no vibration will occur when the device is put in silent mode or in blocking mode (activated by the sleep app). But the vibration that is caused by my widget, occurs always and is not surpressed by silent mode or blocking mode! So it seems that I have to check for these modes within my widget. 
I'm willing to do this, but I can't find the api to check for the sound mode ('sound', 'vibrate', 'silent') or the blocking mode. 

Does someone know how to do this? And make the vibration behave like users would appreciate: no vibration in blocking or silent mode?


Tags

gear , vibration , silent , sleep

Post Reply
Board View
Samsung Developer bikash.ranjan.panda , 65840 Seed May 05, 2014 06:46 Post #1 4
navigator.vibrate() : This API is used to send alert i.e. vibration irrespective of the sound mode.
if you are calling the api it will vibrate.

you can check the mode using Android Api as follows :

AudioManager audio = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
int mode = audio.getRingerMode();
//mode can be : AudioManager.RINGER_MODE_NORMAL,AudioManager.RINGER_MODE_VIBRATE etc.
Post Reply
Board View
Samsung Developer hielko.ophoff , 31770 Seed May 05, 2014 08:11 Post #2 2
Thanks for your response. I saw these interfaces but can't find them in the wearable environment. In a Tizen Wearable project, it seems that I don't have access to the full application context and system services. With tizen.application.getAppContext() I get a very limited api with no possibility to get to the system services.

So my questions are:
- is there a way to obtain the current ringer mode within a wearable widget?
- is there a way to obtain the blocking mode status of the wearable?
- is there another vibrate api that automatically checks for the ringermode and doesn't vibrate when the device is put to silent mode?


This content has been quoted from bikash.ranjan.panda’s thought.

navigator.vibrate() : This API is used to send alert i.e. vibration irrespective of the sound mode.
if you are calling the api it will vibrate.

you can check the mode using Android Api as follows :

AudioManager audio = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
int mode = audio.getRingerMode();
//mode can be : AudioManager.RINGER_MODE_NORMAL,AudioManager.RINGER_MODE_VIBRATE etc.


Post Reply