From a51a6ba2e50fcf05eba7004123e74d682d80034f Mon Sep 17 00:00:00 2001 From: alexmex90 Date: Tue, 7 Nov 2023 17:02:24 -0600 Subject: [PATCH] Unchecking 'Silence the phone when connected' was not returning my phone to 'vibrate mode' correctly, this change saves the state of the ringer regardless of its status during connection, allowing to correctly set it back when 'silence the phone' is unchecked. --- .../asteroidos/sync/connectivity/SilentModeService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/asteroidos/sync/connectivity/SilentModeService.java b/app/src/main/java/org/asteroidos/sync/connectivity/SilentModeService.java index 88d5e9e3..590601cc 100644 --- a/app/src/main/java/org/asteroidos/sync/connectivity/SilentModeService.java +++ b/app/src/main/java/org/asteroidos/sync/connectivity/SilentModeService.java @@ -44,10 +44,11 @@ public final void sync() { if (notificationPref == null) { notificationPref = prefs.getBoolean(PREF_RINGER, false); + SharedPreferences.Editor editor = prefs.edit(); + editor.putInt(PREF_ORIG_RINGER, am.getRingerMode()); + editor.apply(); + if (notificationPref) { - SharedPreferences.Editor editor = prefs.edit(); - editor.putInt(PREF_ORIG_RINGER, am.getRingerMode()); - editor.apply(); am.setRingerMode(AudioManager.RINGER_MODE_SILENT); } }