Sync DND state between Android phone and watch

Overview

DNDSync

This App was developed to enable Do Not Disturb (DND) synchronization between my Pixel phone and the Galaxy Watch 4 since this option was only available if paired with a Samsung phone.

If installed on phone and watch it enables either a 1-way sync or a 2-way sync, depending on the preferences. I also added the functionality to automatically toggle Bedtime Mode. Use case: At night I put my phone into DND and I want my watch to automatically enable Bedtime Mode. This functionality is realized via an Accessibility Service, since I couldn't find how to enable it programmatically (any hints are highly appreciated).

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

Part of this project is inspired by blundens work, please check their GitHub if you want to know more.

Tested on Pixel 3a XL paired with a Galaxy Watch 4 (40mm)

DNDSync demo

Video link: https://youtu.be/rHy6kCBNOzA

Setup

For now the App is not in the Play Store. Manual installation is required. The use of ADB is required.

  • Download the .apk files from the release section (dndsync_mobile.apk and dndsync_wear.apk)

Phone

  • Install dndsync_mobile.apk on the phone adb install dndsync_mobile.apk
  • Open the App and grant the permission for DND Access by clicking on the menu entry DND Permission. This will open the permission screen. This Permission is required so that the app can read and write DND state. Without this permission the sync will not work.
  • With the switch Sync DND state to watch you can enable and disable the sync. If enabled a DND change on the phone will lead to DND change on the watch.

Watch

Setting up the watch is a bit more tricky since the watch OS lacks the permission screen for DND access. I found a way to enable the permission via ADB.

Note: This is only tested on my Galaxy Watch 4 and it might not work on other devices!

  • Connect the watch to your computer via adb (watch and computer have to be in the same network!)
    • enable Developer Options: Go to Settings -> About watch -> Software -> tap the Software version 5 times -> developer mode is on (you can disable it in the same way)
    • enable ADB debugging and Debug over WIFI (in Settings -> Developer Options)
    • note the watch IP address and port, something like 192.168.0.100:5555
    • connect to the watch with adb connect 192.168.0.100:5555 (insert your value!)
  • install the app adb install dndsync_wear.apk
  • grant permission for DND access
    adb shell cmd notification allow_listener de.rhaeus.dndsync/de.rhaeus.dndsync.DNDNotificationService
    This allows the app to listen to DND changes and changing the DND setting
  • scroll to the permission section and check if DND permission says access granted (you might need to tap on the menu entry for it to update)
  • IMPORTANT: Disable ADB debugging after you are done because it drains the battery!
  • If you want to use the Bedtime mode feature you have to enable the Accessibility service for the app. Clicking on Accessibility Service will open the setting on your watch. Go to Installed Services and enable DNDSync. The App will use this to simulate the following touch events on the screen: swipe down to open Quick Settings Panel, click the middle icon of the first row (put Bedtime Mode here) and finally close the panel. You can enable this by enabling the Bedtime Mode Setting in the App.
  • If you enable the setting Sync DND in the App a DND change on the watch will lead to a DND change on the phone
  • If you enable the setting Vibration in the App the watch will vibrate when it receives a DND sync request from the phone

Feedback

Feel free to contact me for questions, feature ideas or bugs and I will see if I can do something about it

email: [email protected]

Comments
  • bug fix: on latest galaxy watch 4 firmware, disabling DND by dnd-sync…

    bug fix: on latest galaxy watch 4 firmware, disabling DND by dnd-sync…

    … causes a dnd off => dnd on => dnd off sequence by the OS. This causes a constant change of DND modes due to the DND-Sync messages. Fixed by introducing a delay to send only the last DND state to the phone.

    opened by grueni75 1
  • No Bedtime Sync - Pixel 6 Pro

    No Bedtime Sync - Pixel 6 Pro

    I really miss this having come back to Pixel from Samsung wher eit worked 100% of the time

    Since theres no "middle of the 1st row", and ive tried placing the quick tile everywhere on the first screen of them, im at a loss....

    I miss my screen going grey!!!!!!!!

    opened by stylemessiah 0
  • [Feature Request] Bedtime mode sync

    [Feature Request] Bedtime mode sync

    It would be great if this could also sync bedtime mode. On my Pixel 7 Pro enabling Bedtime mode triggers a notification from Digital Wellbeing with a title "Bedtime mode is on" and the category "Bedtime mode".

    It's probably not a good idea to key this on a string due to internationalization, but we might be able to do it based on category.

    opened by grantland 0
  • Pixel Watch: enabling acessibility services enables a screen lock sound

    Pixel Watch: enabling acessibility services enables a screen lock sound

    For some reason, while I have the acessibility service permission on for the app on the Pixel Watch, the watch will click whenever the screen switches from active to the always-on-display mode. It goes away when I revoke the permission

    opened by noiob 2
  • Pixel Watch minor change needed

    Pixel Watch minor change needed

    This works great on the Pixel watch except for one bit. You're not currently able to modify the quick settings arrangement. So the middle first row is the flashlight. This means you're not able to trigger the bedtime mode which is first icon in the third row down.

    opened by amademan78 8
  • DND Permission granted, but it's actually not (Android 13)

    DND Permission granted, but it's actually not (Android 13)

    This is kind of an issue in the sense that it should be documented, but a workaround is available for now. The application (mobile) says 'DND access granted', but it's actually not true on Android 13 (tested on a Pixel 6, 05-09-2022 security patch). This results in DND getting set from watch to phone, but not the other way around.

    What you need to do, in order to actually grant the permission are the following steps:

    • Go to app info and then hit the three dot menu in the top right, then select the option to allow the app to access restricted settings.
    • Go to Apps -> Special access -> Notifications, and here turn on notification access to DNDSync

    Once this is done, full duplex DND setting should be working again.

    opened by freshgiammi 0
  • DND home button activation

    DND home button activation

    Hi, I been noticing that the DND and Bedtime get activated when I press multiple times the home button (Top Right bottom) when rejecting or muting a call.

    opened by acuatico69 0
Releases(v1.0)
Owner
rhaeus
rhaeus
Add custom auth options (e.g. face unlock) to your phone using Xposed.

UniversalAuth This project aims to bring a variety of custom authentication options to various Android ROMs. Your phone needs to have Xposed (or EdXpo

Andy Bao 134 Dec 29, 2022
Fall is an app that lets your phone scream if you throw it somewhere.

Fall Fall is an app that lets your phone scream if you throw it somewhere. License Copyright (C) 2022 Gh05t-1337 This program is free software: you ca

null 15 Oct 31, 2022
The Apache Software Foundation 605 Dec 30, 2022
This sample shows how to implement two-way text chat over Bluetooth between two Android devices, using all the fundamental Bluetooth API capabilities.

Zenitsu-Bluetooth Chat Application This sample shows how to implement two-way text chat over Bluetooth between two Android devices, using all the fund

Gururaj Koni 1 Jan 16, 2022
Executable state charts, workflows and more.

Act Getting started If you are using Maven, include the following in your POM: <dependency> <groupId>org.requirementsascode.act</groupId> <a

Bertil Muth 30 Dec 30, 2022
Representational State Transfer + Structured Query Language(RSQL): Demo application using RSQL parser to filter records based on provided condition(s)

Representational State Transfer + Structured Query Language: RSQL Demo application using RSQL parser to filter records based on provided condition(s)

Hardik Singh Behl 9 Nov 23, 2022
💾 Simple persisted state in react-native

React Native Use Persisted State Preview Introduce ?? Simple persisted state in react-native ?? Globally accessable like redux, recoil... ?? No loadin

Hyun 11 Aug 28, 2022
Ethylene is a open-source, lightweight, general-purpose compatibility layer standing between the developer and the chaotic world of configuration file formats.

Ethylene Ethylene is a open-source, lightweight, general-purpose compatibility layer standing between the developer and the chaotic world of configura

Steank 7 Aug 9, 2022
Transfer Service app to transfer money between source and destination account

transferserviceapp Transfer Service app to transfer money between source and destination account H2 Console available at : http://localhost:8080/h2-co

null 1 Oct 21, 2021
An OpenHIM mediator for handling system integration between HRHIS and NHIF

Tanzania HRHIS - NHIF Mediator An OpenHIM mediator for handling system integration from HRHIS to NHIF. Getting Started Clone the repository and run np

Softmed Tehnologies 2 Oct 19, 2021
A blockchain system to manage monetary transactions between the different nodes of a decentralized network.

Blockchain under a clear vision A blockchain system to manage monetary transactions between the different nodes of a decentralized network. Authors @s

SamDik 3 Jun 9, 2022
paste bot for discord. Choose between multiple paste services.

WriterBot Description A simple paste bot written in java. This bot uploads all kinds of text files sent in the channels to https://paste.gg and provid

Dibyajyoti Dey 5 Aug 27, 2022
Share food-Android- - Food donation coded in native android with firebase, google maps api and php server xampp

share_food-Android- Instructions: 1. Create a firebase account and link it with the project via google-services.json. 2. This project also uses a XAMP

Abubakar 3 Dec 28, 2021
Simple Android app during a coding night. Just Learning Firebase and Android

KUI-App Simple Android app during a coding night. Just Learning Firebase and Android What we learned: Some basics of Android Basic setup of Firebase:

Kibabii University Informatics Club (KUI) 7 Aug 28, 2022
This app brings Privacy dashboard features from Android 12 to older android devices.

PrivacyDashboard This app brings Privacy dashboard features from Android 12 to older android devices. Have you ever thought which apps are accessing y

Rushikesh Kamewar 234 Jan 7, 2023
A complete and performing library to highlight text snippets (EditText, SpannableString and TextView) using Spannable with Regular Expressions (Regex) for Android.

Highlight A complete and performing library to highlight text snippets (EditText/Editable and TextView) using Spannable with Regular Expressions (Rege

Irineu A. Silva 16 Dec 22, 2022
Powerful and flexible library for loading, caching and displaying images on Android.

Universal Image Loader The great ancestor of modern image-loading libraries :) UIL aims to provide a powerful, flexible and highly customizable instru

Sergey Tarasevich 16.8k Jan 2, 2023
Render After Effects animations natively on Android and iOS, Web, and React Native

Lottie for Android, iOS, React Native, Web, and Windows Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations expo

Airbnb 33.5k Jan 3, 2023