语言

Menu
Sites
Language
Disable changing volume by user and showing popup after clicking volume up/down

Hi,

I want to disable changing volume by user and disable showing popup after pressing volume up/down. How can I achieve this?

I realized that when I change a sound type using

sound_manager_set_current_sound_type(SOUND_TYPE_RINGTONE)

it disable changing volume but popup is still showing.

 

In nutshell, I want to get the same behavior like during incoming call and then pressing volume up/down.

Thanks for any help.

编辑者为: Dariusz Sak 13 7月, 2015

响应

3 回复
Vikram

Hi,

Seems you want to disable the volume hardkey function in your app, right? why?

As your sample code, my testing result is that the volume key still works well, the volume can be changed, also there is a notification pops up.

I think, the pop up is a system level notification, it cant be interrupted by the application code. Also, I dont face such api to disable the volume hard key and to interrupt an unknow pop up notification. 

Dariusz Sak

Vikram, thanks for your reply.

Yes, I want to disable the volume hardkey function, beceuse I need to have the same behavior like in Call application during incoming call. Please assume following example:

1. Volume level is greater than 0

2.Someone calls you

3.Click volume up/down button during ringtone is playing

4.You can observe that notification doesn't popup and rigtone is stopped

Have you got any idea how to do this in this way?

Thanks.

 

Seongwon Cho

As I know you can't grab h/w key (volume key) exclusively.

Because if your application grab h/w key exclusively and deosn't ungrab h/w key

then User can't use h/w key anymore.