Java – Programmatically mute Android wearables

Programmatically mute Android wearables… here is a solution to the problem.

Programmatically mute Android wearables

I want to programmatically mute the entire watch. So I want to do these things:
1. Silent on, enter vibration-free mode. Can manufacturers add sound capabilities to the watch? Otherwise I also have to add mute…
2. The screen is always on, can be extinguished. This is a system setting. Can I change it programmatically?

I’ve tried using MediaManager:, at the first point

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

I also tried all the other ringtone modes, just to be sure, nothing seemed to work and didn’t change anything in the emulator and my real watch, but nothing worked….

Pebble watch supports night or silent mode… So I don’t think it’s hard to do on a wearable… Any thoughts on this?

Solution

Wear 5.0.1 has some ability! the SDK sample Watchface has a way to detect it. Look for WatchFaceService.INTERRUPTION_FILTER_NONE – RoundSparrow hilltx

From this question: Android Wear detect “Mute”

Related Problems and Solutions