MainActivity: Play completion sound from alarm intent
On Android 10 (at least), the CompleteActivity is not started until the app is activated again, so this fixes the problem where no completion sound is played while the phone is asleep. Closes #62merge-requests/7/head
parent
47827463f9
commit
48dd79b539
|
@ -145,10 +145,7 @@ public class CompleteActivity extends Activity {
|
|||
break;
|
||||
}
|
||||
|
||||
String finishSoundPath = getMeditationAssistant().getPrefs().getString("pref_meditation_sound_finish", "");
|
||||
if (!manual) {
|
||||
getMeditationAssistant().notifySession(2, false, false);
|
||||
} else {
|
||||
if (manual) {
|
||||
getMeditationAssistant().restoreVolume();
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1889,9 +1889,8 @@ public class MainActivity extends Activity implements OnShowcaseEventListener {
|
|||
}
|
||||
|
||||
if (fullWakeUp) {
|
||||
if (getMeditationAssistant().getPrefs().getBoolean("pref_softfinish", false)) {
|
||||
getMeditationAssistant().notifySession(2, false, false);
|
||||
} else {
|
||||
getMeditationAssistant().notifySession(2, false, false);
|
||||
if (!getMeditationAssistant().getPrefs().getBoolean("pref_softfinish", false)) {
|
||||
Intent openAlarmReceiverActivity = new Intent(getApplicationContext(), CompleteActivity.class);
|
||||
openAlarmReceiverActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
openAlarmReceiverActivity.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
|
||||
|
|
Loading…
Reference in New Issue