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

Commit fc12b5be authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android Git Automerger
Browse files

am b5fa4dff: Merge "Fix bug 2594126 Do not crash when ViewRoot is trying to...

am b5fa4dff: Merge "Fix bug 2594126 Do not crash when ViewRoot is trying to play a UI sound. This CL doesn\'t fix why mView can be null in the first place, but prevents a crash when mView is null and a UI sound is to be played." into froyo

Merge commit 'b5fa4dff' into froyo-plus-aosp

* commit 'b5fa4dff':
  Fix bug 2594126 Do not crash when ViewRoot is trying to play a UI
parents 9aa12f85 b5fa4dff
Loading
Loading
Loading
Loading
+26 −20
Original line number Diff line number Diff line
@@ -2580,6 +2580,7 @@ public final class ViewRoot extends Handler implements ViewParent,
    public void playSoundEffect(int effectId) {
        checkThread();

        try {
            final AudioManager audioManager = getAudioManager();

            switch (effectId) {
@@ -2602,6 +2603,11 @@ public final class ViewRoot extends Handler implements ViewParent,
                    throw new IllegalArgumentException("unknown effect id " + effectId +
                            " not defined in " + SoundEffectConstants.class.getCanonicalName());
            }
        } catch (IllegalStateException e) {
            // Exception thrown by getAudioManager() when mView is null
            Log.e(TAG, "FATAL EXCEPTION when attempting to play sound effect: " + e);
            e.printStackTrace();
        }
    }

    /**