Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00763e01 authored by AlexandrKozlovskiy's avatar AlexandrKozlovskiy Committed by Nolen Johnson
Browse files

FmService: Fix loss of audio if we exit from main activity

* Only can recreate when FM Radio is switched off.

Recreation Steps:
1. Enter the FM Radio app and toggle FM radio on.
2. Press the toggle again to switch off FM radio.
3. Press the back button on your device to close activity.
4. Enjoy no sound until you reboot your device.

Change-Id: I6457760a9425c568f6f5ce912a40029bd9fb630c
parent 8bf069be
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1472,7 +1472,7 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan


    @Override
    @Override
    public void onDestroy() {
    public void onDestroy() {
        mAudioManager.setParameters("AudioFmPreStop=1");
        mAudioManager.setParameters("AudioFmPreStop=0");
        setMute(true);
        setMute(true);
        // stop rds first, avoid blocking other native method
        // stop rds first, avoid blocking other native method
        if (isRdsSupported()) {
        if (isRdsSupported()) {