Hmm, my bad, the method is actually setRingerMode, not setMode. This way it
works (no permission needed, although it's weird :). Thanks!
On Mon, Aug 17, 2009 at 2:41 AM, Michael Leung <[email protected]>wrote:

> try the premission:
>    
> MODIFY_AUDIO_SETTINGS<http://developer.android.com/reference/android/Manifest.permission.html#MODIFY_AUDIO_SETTINGS>
>  Allows
> an application to modify global audio settings  
> MODIFY_PHONE_STATE<http://developer.android.com/reference/android/Manifest.permission.html#MODIFY_PHONE_STATE>
>  Allows
> modification of the telephony state - power on, mmi, etc.
> your code seems to need the premission to audio and phone state
>
>
> On Sun, Aug 16, 2009 at 11:23 PM, Teo <[email protected]> wrote:
>
>>
>> Hi,
>>
>> has anyone made the phone silent from code? Is there any permission
>> needed? I am using this method, but it's doing nothing:
>>
>> ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE))
>>        .setMode(AudioManager.RINGER_MODE_SILENT);
>>
>> Thanks,
>> Teo
>>
>> --
>> Regards,
>> Michael Leung
>> http://www.itblogs.info
>> http://www.michaelleung.info
>>
>> >>
>>


-- 
Teo (a.k.a. Teominator a.k.a. Teodor Filimon)
site www.teodorfilimon.com | blog www.teodorfilimon.blogspot.com
GMT +2

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to