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

Commit 3f56d21b authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change I89e74ba1 into eclair

* changes:
  Fix Issue 2158631: AudioService: volume control sometimes not restored after media server process crash.
parents 0ec1bc60 89e74ba1
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -178,12 +178,14 @@ public class AudioService extends IAudioService.Stub {
                if (mMediaServerOk) {
                    sendMsg(mAudioHandler, MSG_MEDIA_SERVER_DIED, SHARED_MSG, SENDMSG_NOOP, 0, 0,
                            null, 1500);
                    mMediaServerOk = false;
                }
                break;
            case AudioSystem.AUDIO_STATUS_OK:
                if (!mMediaServerOk) {
                    sendMsg(mAudioHandler, MSG_MEDIA_SERVER_STARTED, SHARED_MSG, SENDMSG_NOOP, 0, 0,
                            null, 0);
                    mMediaServerOk = true;
                }
                break;
            default:
@@ -1282,10 +1284,13 @@ public class AudioService extends IAudioService.Stub {
                    break;

                case MSG_MEDIA_SERVER_DIED:
                    Log.e(TAG, "Media server died.");
                    // Force creation of new IAudioflinger interface
                    mMediaServerOk = false;
                    if (!mMediaServerOk) {
                        Log.e(TAG, "Media server died.");
                        AudioSystem.isMusicActive();
                        sendMsg(mAudioHandler, MSG_MEDIA_SERVER_DIED, SHARED_MSG, SENDMSG_NOOP, 0, 0,
                                null, 500);
                    }
                    break;

                case MSG_MEDIA_SERVER_STARTED:
@@ -1323,8 +1328,6 @@ public class AudioService extends IAudioService.Stub {

                    // Restore ringer mode
                    setRingerModeInt(getRingerMode(), false);

                    mMediaServerOk = true;
                    break;

                case MSG_PLAY_SOUND_EFFECT: