Skip to content

Commit

Permalink
Unchecking 'Silence the phone when connected' was not returning my ph…
Browse files Browse the repository at this point in the history
…one 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.
  • Loading branch information
alexmex90 committed Nov 7, 2023
1 parent 37ae5bd commit a51a6ba
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit a51a6ba

Please sign in to comment.