Giter Club home page Giter Club logo

dnd-sync's Introduction

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]

dnd-sync's People

Contributors

rhaeus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.