Skip to content

Commit

Permalink
Properly handle quick switch between Home button and Gallery app
Browse files Browse the repository at this point in the history
This change fixes the following bug:

1. Playing a movie (especially Full HD) by Gallery.
2. Press the Home button.
3. Press the Gallery shortcut on Launcher.
4. Very quickly repeat #2 and #3 several times.

Result: "Sorry, this video cannot be played" alert is shown.

Change-Id: Idf9d222ca1e0bb90bfe06f6dc807dfbc71b6415b
Signed-off-by: Yuriy Zabroda <yuriy.zabroda@ti.com>
  • Loading branch information
Yuriy Zabroda authored and Yuriy Zabroda committed Jul 11, 2012
1 parent 13a3a87 commit 390e02b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/java/android/view/SurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ private void updateWindow(boolean force, boolean redrawNeeded) {

mSurface.transferFrom(mNewSurface);

if (visible) {
if (visible && mSurface.isValid()) {
if (!mSurfaceCreated && (surfaceChanged || visibleChanged)) {
mSurfaceCreated = true;
mIsCreating = true;
Expand Down

0 comments on commit 390e02b

Please sign in to comment.