mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-08 07:37:41 +00:00
do not vibrate if do not disturb is enabled, fixes #1125
This commit is contained in:
parent
27d257ce1d
commit
d754e7ca7f
2 changed files with 12 additions and 4 deletions
|
@ -1853,7 +1853,13 @@ public class LatinIME extends InputMethodService implements
|
|||
public void onReceive(final Context context, final Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
|
||||
AudioAndHapticFeedbackManager.getInstance().onRingerModeChanged();
|
||||
boolean dnd;
|
||||
try {
|
||||
dnd = android.provider.Settings.Global.getInt(context.getContentResolver(), "zen_mode") != 0;
|
||||
} catch (android.provider.Settings.SettingNotFoundException e) {
|
||||
dnd = false;
|
||||
}
|
||||
AudioAndHapticFeedbackManager.getInstance().onRingerModeChanged(dnd);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue