Skip to content

Commit 55c275d

Browse files
alexmex90jrtberlin
authored andcommitted
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.
1 parent db200ac commit 55c275d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/main/java/org/asteroidos/sync/connectivity/SilentModeService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ public final void sync() {
4444
if (notificationPref == null) {
4545
notificationPref = prefs.getBoolean(PREF_RINGER, false);
4646

47+
SharedPreferences.Editor editor = prefs.edit();
48+
editor.putInt(PREF_ORIG_RINGER, am.getRingerMode());
49+
editor.apply();
50+
4751
if (notificationPref) {
48-
SharedPreferences.Editor editor = prefs.edit();
49-
editor.putInt(PREF_ORIG_RINGER, am.getRingerMode());
50-
editor.apply();
5152
am.setRingerMode(AudioManager.RINGER_MODE_SILENT);
5253
}
5354
}

0 commit comments

Comments
 (0)