How to check status of Z1 in mute, vibrate or ring?

How to check status of Z1 in mute, vibrate or ring?

BY 11 Aug 2015 Native Application Development

Hello, I’m making simple game with Background music.

So checking phone status is in mute, vibrate or ring is important to pass valdiation test,

 

But I cannot find how to do it,

When I try to do it with the below code, it just determine it mute or not.

 

bool isSilent=false;
 system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE, &isSilent);
 if (isSilent)
  dlog_print(DLOG_DEBUG, LOG_TAG, "silent mode");
 else
  dlog_print(DLOG_DEBUG, LOG_TAG, "no silent mode");

But actually, to contorl Background music on/off, vibrate mode must be considered as silent mode

 

Ring -> no silent

Vibrate -> no silent  (why?)

Mute -> silent

 

Is there someone who can findout ringtone status successfully?

 

Written by