[Samsung Galaxy Watch 4] rhaeus:
Hello everyone!

I'm using the Samsung Galaxy Watch 4 with a Pixel 3a XL and I was a bit annoyed that the option to synchronize the Do Not Disturb (DND) state between watch and phone seems to be only available when paired to a Samsung phone. So I made an App to fix this and I'd like to share it with as many people as possible (I don't know how much interest there is).

View attachment 5398215View attachment 5398217View attachment 5398219View attachment 5398221

As for now it is not in the Google Play Store but you can find the APK files, instructions and the source code on my GitHub.

Besides the DND sync I also implemented to (optionally) toggle Bedtime mode on the watch depending on the DND state of the phone (this is a bit experimental though, since I had to use an Accessibility Service for that, more on that below).

NOTE: For bedtime mode toggle to work it is important that the Bedtime Mode button is on the first page of quick settings and in the first row the button in the middle!

The installation on the watch is a bit technical (needs ADB) and here I want to explain why it is how it is.

Why do I need ADB?​

In order to listen to DND changes and also change the DND state, the app needs the permission from the user. On the phone it is no problem to grant said permission (it's the ACCESS_NOTIFICATION_POLICY for those curious) because the system provides a permission screen where the user can handle that permission. On the watch this screen is missing and therefore the user can't grant the permission to the watch. That's where ADB comes into play. I found a command which allows to enable the permission for the app via ADB. (I could only test this with my watch, I think (and hope) it will work on other devices too) In order for the app to work properly, you have to execute this command once after installation. The details are in the GitHub instructions.

Why is Bedtime mode experimental?​

In an ideal world I would know a command to use in my program that controls the Bedtime mode setting directly. Unfortunately I haven't found such a command (if anyone knows, please let me know). As a workaround I figured I could simulate the touch gestures which you would use to do it manually: Swipe down to open the Quick Settings, tap the icon for Bedtime mode, use back button (or swipe up) to close the Settings. In order to do that I use an Accessibility Service, which you have to enable if you want to use the feature (see instructions). It is experimental because all I can do is perform the gestures and hope everything went alright, no way to really confirm that Bedtime mode is actually on or off (that I know of at the moment).

I made a video that demonstrates both the 2-way synchronization of the DND state and the Bedtime mode feature:

Last but not least a little Disclaimer: I'm not very experienced in Android App Development and I've never released an App before. Even though it works fine for me I have no idea what might happen on other systems and configurations, so please be gentle :)

I'm happy to hear your thoughts, feedback, ideas, bug reports and I will see if I can do something about it.

Let me know if you have any questions!

Stay safe!