Android Wear detect “Mute”

你。 提交于 2019-12-03 03:45:47

Unfortunately Google has not seen fit to expose this to us lowly developers at this time as far as I can tell.

Thanks to the research of a friend of mine, Ive found this code.

public static boolean inZenMode(Context paramContext)
  {
    return paramContext.getSharedPreferences("home_preferences", 0).getBoolean("in_zen_mode", false);
  }

Zen mode is what Google calls the mute state, and currently you can only access that value with root by directly reading that file. Hopefully with an update in the near future, google will expose this value to us.

gatlingxyz

Did you try these? It looks like you're looking for VOLUME, which doesn't exist in Android Wear. https://stackoverflow.com/a/11985560/1539431

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