[APP] Do Not Disturb sync for Wear 2.0

Search This thread

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
Those who have been lucky to upgrade to Wear 2.0 have probably noticed the removed Do Not Disturb toggle synchronization between wearable and phone. Some like it, some not. I didn't like it, so I made an app that does the sync. Currently it only works one way: wearable -> phone. With some hacking, sync is working both ways.

You can find the application in Play Store.
Source, builds and setup instructions are available in github and licensed under Apache 2.0.

Installation instructions for Watch -> Phone sync:
  1. Install phone application and wearable application from on-watch Play Store
  2. Launch application on Phone
  3. Click "Grant Permission" button
  4. Enable Do Not Disturb access permission for application
  5. Make sure all 3 checks in the application pass

Installation instructions for Phone -> Watch sync:
  1. Setup watch ADB
  2. Execute:
    Code:
    adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:rkr.weardndsync/rkr.weardndsync.NotificationService
  3. Enable state broadcast in Watch Setup wizard

Currently synchronization phone -> watch is only possible by assigning permissions in ADB. Wear OS doesn't provide management settings. As this is not officially supported - it may not work for everyone or the next Wear version.
 
Last edited:

CrEdge

Senior Member
Mar 2, 2013
119
8
I love that something like this is now made, but I have a question. What is the first screenshot in the Google Play Store link for? I thought this was only for DND?

I'd like to install it and find out myself, but my ZenWatch 2 still hasn't received the update.
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
If your watch isn't updated, then the sync should work out of the box. As for the screenshot, I tried to show that the toggle in the watch will sync to the toggle in the phone. I'm not a designer.
 
  • Like
Reactions: Peshyy and Pkt_Lnt

Pkt_Lnt

Inactive Recognized Contributor
Dec 26, 2011
7,894
5,804
SLO
Wonderful little utility. Thank you very much.

Fingers crossed to get phone > watch allowed.

I have a few apps that toggle DND via Tasker on my phone, and having it trigger the watch too would be sweet.
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
Good news and bad news.
The bad: notification access and all the management is unavailable in Wear. So there will not be an official way to make this work (source).
The good: you can grant the permission in ADB. I tried it and the app can actually switch DND on and off (source).

Having to run a single ADB command will probably not stop the brave people of XDA! So synchronization should eventually come to the watch, just give me some time to fix the current bugs.
Bonus news: AudioManager can be used in android <6 for sound modes. Haven't looked into that yet.
 
  • Like
Reactions: Peshyy and Pkt_Lnt

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
Sync from phone to watch is implemented and functional! v1.5 is being pushed to the Play Store. You just need to enable broadcast from phone in setup wizard and execute this command in the watch:

Code:
adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:rkr.weardndsync/rkr.weardndsync.HackService
 
Last edited:

hunter29m

Member
Apr 13, 2015
21
5
Those who have been lucky to upgrade to Wear 2.0 have probably noticed the removed Do Not Disturb toggle synchronization between wearable and phone. Some like it, some not. I didn't like it, so I made an app that does the sync. Currently it only works one way: wearable -> phone. With some hacking, sync is working both ways.

You can find the application in Play Store.
Source is available in github and licensed under Apache 2.0.

Installation instructions for Watch -> Phone sync:
  1. Install phone application and wearable application from on-watch Play Store
  2. Launch application on Phone
  3. Click "Grant Permission" button
  4. Enable Do Not Disturb access permission for application
  5. Make sure all 3 checks in the application pass

Installation instructions for Phone -> Watch sync:
  1. Setup watch ADB
  2. Execute:
    Code:
    adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:rkr.weardndsync/rkr.weardndsync.HackService
  3. Enable state broadcast in Watch Setup wizard

Currently synchronization phone -> watch is only possible by assigning permissions in ADB. Wear OS doesn't provide management settings. As this is not officially supported - it may not work for everyone or the next Wear version.
Thank you so much.

Sent from my ONEPLUS A3003 using Tapatalk
 

BIade

Senior Member
Apr 11, 2013
693
545
Cologne

Attachments

  • image.jpg
    image.jpg
    26.4 KB · Views: 744

seancojr

Senior Member
Jan 25, 2007
132
24
Memphis
I'm just curious. What's the difference between this version available in the Play Store (source code available here) and your own? It looks to me as though that blunden may have forked your code.
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
That's how open source works, you are free to fork it or take it as an inspiration. His code isn't a plain copy paste, it looks like he even has sync to older android versions, which I didn't have time to do.
 

thecarp1975

Senior Member
Apr 5, 2012
458
153
Vinton, VA
I can no longer sync both ways after the newest update, v1.6. I can only control DND from both devices from my watch. Anyone else having this problem with v1.6?

Sent from my SM-G955U using Tapatalk
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
I can no longer sync both ways after the newest update, v1.6. I can only control DND from both devices from my watch. Anyone else having this problem with v1.6?

Sent from my SM-G955U using Tapatalk

The first idea is that app got suspended after the update. Make sure watch app is updated and start the app on phone. I've added a check that will tell you if watch DND permission is granted. If everything passes, then there is probably something weird with the AudioManager. Previous version used the new NotificationManager, but it requires a running service for broadcast events. I've switched to legacy AudioManager that can use a stateless broadcast receiver.

[Edit:] Android 4.3+ support is being pushed. This needed a code refactoring, so bugs are probable.
 
Last edited:
  • Like
Reactions: Pkt_Lnt

thecarp1975

Senior Member
Apr 5, 2012
458
153
Vinton, VA
The first idea is that app got suspended after the update. Make sure watch app is updated and start the app on phone. I've added a check that will tell you if watch DND permission is granted. If everything passes, then there is probably something weird with the AudioManager. Previous version used the new NotificationManager, but it requires a running service for broadcast events. I've switched to legacy AudioManager that can use a stateless broadcast receiver.

[Edit:] Android 4.3+ support is being pushed. This needed a code refactoring, so bugs are probable.
Yeah, all three permissions were granted. You wouldn't happen to have the APK for the previous version?

Sent from my SM-G955U using Tapatalk
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
V1.5 attached.

I would still prefer if you could make a logcat and I could fix the problem for the rest of the people. Just do these steps:
  1. Connect phone to ADB
  2. Enable DND, Disable DND on phone
  3. Enable DND, Disable DND in watch
  4. Run: adb logcat -d > bug_phone.txt
  5. Repeat with watch connected to bug_watch.txt
PM the logs and I may try to fix it. It's not the first time android APIs don't work in specific phones.
 

Attachments

  • v15.apk
    740.4 KB · Views: 28

Pkt_Lnt

Inactive Recognized Contributor
Dec 26, 2011
7,894
5,804
SLO
Just a quick FYI. Version 1.6 works fine here. Nexus 6 / Pure Nexus 7.1.1 / Magisk root. Huawei watch AW 2.0 7.1.1 stock.

I can start DND from either watch or phone and the other device enables.

It works when I start Sleep as Android; SaS enables phone DND and that enables DND for AW 2.0, then Tasker via AutoWear triggers theater mode on my watch. One step goodness! :victory:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    Those who have been lucky to upgrade to Wear 2.0 have probably noticed the removed Do Not Disturb toggle synchronization between wearable and phone. Some like it, some not. I didn't like it, so I made an app that does the sync. Currently it only works one way: wearable -> phone. With some hacking, sync is working both ways.

    You can find the application in Play Store.
    Source, builds and setup instructions are available in github and licensed under Apache 2.0.

    Installation instructions for Watch -> Phone sync:
    1. Install phone application and wearable application from on-watch Play Store
    2. Launch application on Phone
    3. Click "Grant Permission" button
    4. Enable Do Not Disturb access permission for application
    5. Make sure all 3 checks in the application pass

    Installation instructions for Phone -> Watch sync:
    1. Setup watch ADB
    2. Execute:
      Code:
      adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:rkr.weardndsync/rkr.weardndsync.NotificationService
    3. Enable state broadcast in Watch Setup wizard

    Currently synchronization phone -> watch is only possible by assigning permissions in ADB. Wear OS doesn't provide management settings. As this is not officially supported - it may not work for everyone or the next Wear version.
    3
    Watch app was updated to support Oreo Wear where broadcasts are no longer available. Which means that nothing will work without the Notifications permission in the watch. You'll have to connect the watch to ADB and run the command:
    Code:
    adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:rkr.weardndsync/rkr.weardndsync.HackService
    3
    Sync from phone to watch is implemented and functional! v1.5 is being pushed to the Play Store. You just need to enable broadcast from phone in setup wizard and execute this command in the watch:

    Code:
    adb shell settings put secure enabled_notification_listeners com.google.android.wearable.app/com.google.android.clockwork.stream.NotificationCollectorService:rkr.weardndsync/rkr.weardndsync.HackService
    3
    New version with Send Logs button added. You can send logs via email to me directly (email in play store listing) or export somewhere else and attach to forum here.
    Also in Android 8, phone calls do net set DND mode any more. So I won't be able to reproduce the "phone calls" issue.
    3
    Great news everyone. Google has decided to block all non Wear OS compliant apps from Play Store on March 4. This application hasn't been chosen as a compliant one (surprise surprise) so it will be gone in a month. APK files are posted in https://github.com/rkkr/wear-dnd-sync/releases for sideloading. RIP Wear.