[APP] Do Not Disturb sync for Wear 2.0

Search This thread

Lucas_Skyline

Senior Member
May 11, 2011
153
15
Fortaleza - CE
Hi, guys.

It's just me, or the app itself just put my phone in silent mode instead of do not disturb?

I know that they're almost the same, but I have some rules added to Do not disturb mode, as accept calls from some contacts...

I'm using an S8+ A 7.0 and a Huawei Watch with AW 2.0.

Thanks!
 
Last edited:
  • Like
Reactions: Pkt_Lnt

Pkt_Lnt

Inactive Recognized Contributor
Dec 26, 2011
7,894
5,804
SLO
Hi, guys.

It's just me, or the app itself just put my phone in silent mode instead of do not disturb?

I know that they're almost the same, but I have some rules added to Do not disturb mode, as accept calls from some contacts...

I'm using an S8+ A 7.0 and a Huawei Watch with AW 2.0.

Thanks!
Might be just your phone. My Huawei 1 watch with AW 2.0 paired to my Nexus 6 with Pure Nexus (AOSP 7.1.1) does the full DND sync whether started from watch or phone.
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
Hi, guys.
It's just me, or the app itself just put my phone in silent mode instead of do not disturb?

There are 3 Do Not Disturb modes: Priority, Alarms and Silent. Wear only has one: Alarms. Now that you mentioned I did find a bug where watch would sometimes force the Alarms mode in the phone when the other was selected. It is hard to notice this in a Nexus, but maybe it is more obvious in a Samsung. A fix with version 1.8 is being pushed along with filter to have less wear->watch network traffic.

If this is not the bug you're having, then please PM with more detailed steps. This is the second time S8 owner is complaining. So either everyone has an S8 nowadays, or it actually doesn't work there :D
 
  • Like
Reactions: Pkt_Lnt

Lucas_Skyline

Senior Member
May 11, 2011
153
15
Fortaleza - CE
There are 3 Do Not Disturb modes: Priority, Alarms and Silent. Wear only has one: Alarms. Now that you mentioned I did find a bug where watch would sometimes force the Alarms mode in the phone when the other was selected. It is hard to notice this in a Nexus, but maybe it is more obvious in a Samsung. A fix with version 1.8 is being pushed along with filter to have less wear->watch network traffic.

If this is not the bug you're having, then please PM with more detailed steps. This is the second time S8 owner is complaining. So either everyone has an S8 nowadays, or it actually doesn't work there :D

Just installed V 1.8, it appears to work now! But I still don't get all the checks. The steps I made:

1. Installed app on phone
2. Installed app on watch
3. Openen the app, clicked on manage permissions... it goes to samsung DND permission screen, granted for you app
4. When I go back to app, I don't have all the checks (see image attached)
 

Attachments

  • screen.png
    screen.png
    137.8 KB · Views: 193

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
What this says is that DND permission is not granted in the Watch. You need to fallow the "Watch Setup" steps to enable it. This is only needed if you want Phone->Watch sync (otherwise you don't need to bother and Watch->Phone will still work).
 
  • Like
Reactions: Pkt_Lnt

JustACatRu

Member
Oct 25, 2012
14
8
Android 4.3+ support is being pushed. This needed a code refactoring, so bugs are probable.
Great to hear!
I've already installed and tried it.
But on my setup (Huawei Honor X2 Android 5.1.1 + Huawei Watch 1 Android 2.0) it works like this:
- on phone it reacts only on sound mode change (not interrupt mode): when I change from normal sound to vibrate - nothing happens on watch, when I change from vibrate to silent - DND enables on watch, when I change from silent to normal sound - DND disables on watch.
- on watch: when I disable DND - sound turns on on phone (if was on silent), when I enable DND - nothing happens on phone.
So from Phone to Watch it only works if changing Silent/Nosilent.
And from Watch to Phone: it can only goes from Silent to Nosilent and not back.

And the main question is: can we use Interrupt Mode on Android prior 6 instead of Sound Modes?
Like Tasker do. Can be found here: http://tasker.dinglisch.net/userguide_summary.html search for "Interrupt Mode".

Thank you!
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
- In my app Priority Only = Silent. I could have picked Vibrate, but it would be equally hacky. I can make watch go into DND when phone is on Vibrate. I'll still have to set either Silent or Vibrate when DND is selected in Watch.
- Android 5 interruption modes are all messed up. getCurrentInterruptionFilter() is only available since 6. I did find an API for 5 now, but it's only valid for one version: getCurrentInterruptionFilter(). Worst case scenario- that can be implemented.
- The bug that you have for setting Phone mode sounds like this: https://stackoverflow.com/a/30453461/7975770. The app can't get the current sound mode so it doesn't override it. I've added a simple hack to "Just Do It" in the attached version. Please test if it works for you.
 

Attachments

  • mobile-release.apk
    755.1 KB · Views: 24

JustACatRu

Member
Oct 25, 2012
14
8
Please test if it works for you.
Hello!
I've tested this version.
Now the behavior is this:
- Phone -> Watch:
--- Vibrate -> DND enabled
--- Silent -> DND enabled
--- Normal sound -> DND disabled
- Watch -> Phone:
--- Enable DND -> Nothing happens on phone
--- Disable DND -> Phone goes to normal sound (if was on Silent or Vibrate)

Android 5 interruption modes are all messed up.
Sad to hear that it is so complicated in Android 5. Then maybe it is not worth to fight and bother with it.
I just thought that everything is not so bad, since Tasker is able to track and change the state of Interrupt Mode on my phone (Android 5).
But, apparently, I was wrong.
Thanks for your efforts anyway!
 

JustACatRu

Member
Oct 25, 2012
14
8
New version attached.
Hello!
Tested :) Now I see button "Manage Permissions (Alternate)" - pressed and checked "DND Sync for Wear" in the list (Tasker and Android Wear is in there too).
And the behavior is this:
- Phone -> Watch:
--- Reacts on Interrupt Mode but only when changing Sound Mode
- Watch -> Phone:
--- Enable DND -> DND enabled on Phone ("Interrupt Mode" set to "priority" which is great!) in all conditions
--- Disable DND -> DND disabled on Phone ("Interrupt Mode" set to "all") BUT sometimes (when I change on the Phone Sound Mode and Interrupt Mode in some variations) it stops to disable DND on Phone.
It's hard to describe, so I've recorded a video, please, look, if you have time: https://www.youtube.com/watch?v=FbjPzAVrl_4
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
And the behavior is this:
- Phone -> Watch:
--- Reacts on Interrupt Mode but only when changing Sound Mode
- Watch -> Phone:
--- Enable DND -> DND enabled on Phone ("Interrupt Mode" set to "priority" which is great!) in all conditions
--- Disable DND -> DND disabled on Phone ("Interrupt Mode" set to "all") BUT sometimes (when I change on the Phone Sound Mode and Interrupt Mode in some variations) it stops to disable DND on Phone.

I have tested the same in 5.1 emulator and it doesn't work the way it works on your Huawei. Officially changing the DND mode triggers the RINGER_MODE_CHANGED event, but it doesn't happen in your side. First app versions used the InterruptionFilter listener, which would be triggered in your case. I removed it as the ringer mode event should have worked across all versions and it didn't require a running service. That can be reverted as S8 guys probably had a similar issue. It will just chop 3MB from everyones RAM.

As for getting from the DND + silent mode, my guess is that the later one takes priority. Maybe setting both at the same time could force it :confused:

Now I just wish that google would put this functionality back in and we wouldn't have to do all this...
 
  • Like
Reactions: drewski_1

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79

New version attached with 3 separate logics for 3 separate generations of android. Background services are back. Version 5 and 6-7 have been tested. Should solve Huawei and S8 issues.

Will push to play store if usable.
 

Attachments

  • mobile-release.apk
    756.4 KB · Views: 60

DarkWolf747

Senior Member
Mar 13, 2013
87
19
Could tasker support be added for this? It would let me set up tasker to do it, and that would be awesome.
 

todd3835

Senior Member
Feb 13, 2008
1,159
245
Using an LG V20 on Nougat, it works fine Phone to Watch, but if I do Watch to Phone, it doesn't set DND, it sets phone to Vibrate. Is this an LG issue? I usually set it on the phone anyways, but it would be nice if it worked both ways.
 

raimondas.rimkus

Senior Member
Aug 13, 2012
59
79
Using an LG V20 on Nougat, it works fine Phone to Watch, but if I do Watch to Phone, it doesn't set DND, it sets phone to Vibrate. Is this an LG issue? I usually set it on the phone anyways, but it would be nice if it worked both ways.

There should not be Silent/Vibrate modes in Nougat. Only Priority/Alarms interruption toggle should be available since android 6 which are being set by app. Unless somehow your phone reports that it runs android 4, then silent mode is set :)

You can make a logcat and send it if you want.
 

todd3835

Senior Member
Feb 13, 2008
1,159
245
There should not be Silent/Vibrate modes in Nougat. Only Priority/Alarms interruption toggle should be available since android 6 which are being set by app. Unless somehow your phone reports that it runs android 4, then silent mode is set :)

You can make a logcat and send it if you want.

I can do a logcat, just not sure how. Also, when Sleep As Android sets "DND Priority Only", it's not triggering DND on the watch. If I manually set DND, it triggers the watch.

Sent from my LG V20 using XDA Labs
 

drewski_1

Senior Member
Jul 20, 2012
3,828
1,602
SF Bay Area, CA
In watch Play Store I'm only finding the Blunden version :(

also, dumb question about this last step:
Code:
Enable state broadcast in Watch Setup wizard
How do I get to the Watch Setup wizard, or does this mean I need to do a factory reset on the watch?

---------- Post added at 07:33 PM ---------- Previous post was at 07:19 PM ----------

New version attached with 3 separate logics for 3 separate generations of android. Background services are back. Version 5 and 6-7 have been tested. Should solve Huawei and S8 issues.

Will push to play store if usable.

Never mind my first question. I pushed this APK to my watch and have it installed.

Still not sure on the State Broadcast step . . .
 
Last edited:

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.