am fc12b5be: 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 'fc12b5be2ee49ba2392274d413bd5d759c03c346' into kraken * commit 'fc12b5be2ee49ba2392274d413bd5d759c03c346': Fix bug 2594126 Do not crash when ViewRoot is trying to play a UI
This commit is contained in:
@@ -2582,6 +2582,7 @@ public final class ViewRoot extends Handler implements ViewParent,
|
|||||||
public void playSoundEffect(int effectId) {
|
public void playSoundEffect(int effectId) {
|
||||||
checkThread();
|
checkThread();
|
||||||
|
|
||||||
|
try {
|
||||||
final AudioManager audioManager = getAudioManager();
|
final AudioManager audioManager = getAudioManager();
|
||||||
|
|
||||||
switch (effectId) {
|
switch (effectId) {
|
||||||
@@ -2604,6 +2605,11 @@ public final class ViewRoot extends Handler implements ViewParent,
|
|||||||
throw new IllegalArgumentException("unknown effect id " + effectId +
|
throw new IllegalArgumentException("unknown effect id " + effectId +
|
||||||
" not defined in " + SoundEffectConstants.class.getCanonicalName());
|
" 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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user