Skip to content

Commit

Permalink
fix some issues
Browse files Browse the repository at this point in the history
  • Loading branch information
punksta committed Aug 18, 2021
1 parent f93f70f commit 04e67d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.example.punksta.volumecontrol.data.Settings;
import com.example.punksta.volumecontrol.model.SettingsStorage;
import com.example.punksta.volumecontrol.util.DNDModeChecker;

import java.util.Arrays;
import java.util.List;
Expand All @@ -24,7 +25,7 @@ public void onReceive(Context context, Intent intent) {
if (actionsToStartService.contains(intent.getAction())) {
SettingsStorage settingsStorage = SoundApplication.getSettingsStorage(context);
Settings settings = settingsStorage.settings();
if (settings.isNotificationWidgetEnabled) {
if (settings.isNotificationWidgetEnabled && DNDModeChecker.isDNDPermissionGranted(context)) {
Intent i = SoundService.getIntentForForeground(context, settings);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private void updateVibrateOnCalls() {

private void stopSoundService() {
Intent i = SoundService.getStopIntent(this);
startService(i);
stopService(i);
}

private void startSoundService() {
Expand Down

0 comments on commit 04e67d2

Please sign in to comment.