简体   繁体   English

以编程方式静音Android可穿戴设备

[英]Programmatically mute an Android wearable

I programmatically want to mute the entire watch. 我以编程方式想要将整个手表静音。 So I wanted to do these things: 1. Mute to on , so go into non vibration mode. 所以我想做这些事情:1。静音到开,所以进入非振动模式。 Will manufacturers be able to add sound capabilities to watches? 制造商是否能够为手表添加声音功能? Otherwise I would also have to add muting of sound... 2. Screen always on , to off. 否则我还要添加声音静音...... 2.屏幕始终开启,关闭。 It's a system setting. 这是一个系统设置。 Can I change it programmatically? 我可以通过编程方式更改吗?

I already tried for point one to use the MediaManager: 我已经尝试过第一点使用MediaManager:

AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);

I tried all other ringer modes also just to be sure and nothing seems to work and change anything in the emulator and on my real watch but nothing is doing the job... 我尝试了所有其他铃声模式也只是为了确定,似乎没有任何工作,并在模拟器和我的真实手表上改变任何东西,但没有任何工作......

A pebble watch has night or silent mode support... So I won't be that hard to do it on a wearable I thought.. Any ideas on this one? 一块鹅卵石手表有夜间或静音模式支持...所以我不会那么难以在我认为的可穿戴设备上做这个...有关这个的任何想法吗?

Wear 5.0.1 has some ability! 穿5.0.1有一定的能力! the SDK sample Watchface has a way to detect it. SDK示例Watchface有一种方法可以检测它。 Look for WatchFaceService.INTERRUPTION_FILTER_NONE - RoundSparrow hilltx 寻找WatchFaceService.INTERRUPTION_FILTER_NONE - RoundSparrow hilltx

from this question here: Android Wear detect "Mute" 来自这个问题: Android Wear检测“静音”

Maybe with requestInterruptionFilter where fitler mode are: 也许使用requestInterruptionFilter ,其中fitler模式是:

  • INTERRUPTION_FILTER_ALL INTERRUPTION_FILTER_ALL
  • NTERRUPTION_FILTER_NONE NTERRUPTION_FILTER_NONE
  • INTERRUPTION_FILTER_PRIORITY INTERRUPTION_FILTER_PRIORITY

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM