Where is the setting setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, false) in the phone?

扶醉桌前 提交于 2019-12-24 10:01:00

问题


i made an app that messes with the system vibrate settings. namely, it turns them off.

AudioManager audioManager = (AudioManager)ctx.getSystemService(Context.AUDIO_SERVICE);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF);
System.putInt(ctx.getContentResolver(), VIBRATE_IN_SILENT, 0);

i wonder now, where i can turn the vibration manually back on. the ringer vibrate setting can be found in the Sound settings, but where is the notification setting? the setting in the SMS app is still on "vibrate always", but the phone does not vibrate anymore when receiving a text. can this setting just be turned on/off programmatically?

btw: i am using a Nexus One with Android 2.3.3

Thx Simon


回答1:


All you have to do is the exact same thing you did above except set AudioManager.VIBRATE_SETTING_OFF to AudioManager.VIBRATE_SETTING_ON



来源:https://stackoverflow.com/questions/7933470/where-is-the-setting-setvibratesettingaudiomanager-vibrate-type-notification-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!