summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-01-19 16:04:55 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-01-19 16:04:55 -0800
commit56592dc0c89dc6f4c1bbf48b213d9dda136c306b (patch)
tree9e54ab6a426a13eb57659b0bc9c85e504556dd76
parenta00bb425869d12fa89ec4c6d91c7bc05c9401334 (diff)
parentb2c812c1c01589f0bf70896065ef48342c85a45a (diff)
downloadandroid_packages_apps_Gallery2-56592dc0c89dc6f4c1bbf48b213d9dda136c306b.tar.gz
android_packages_apps_Gallery2-56592dc0c89dc6f4c1bbf48b213d9dda136c306b.tar.bz2
android_packages_apps_Gallery2-56592dc0c89dc6f4c1bbf48b213d9dda136c306b.zip
Merge "Gallery2: Avoid showing error dialog multiple times"
-rw-r--r--src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
index 3365441e8..f8c70505f 100644
--- a/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
+++ b/src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java
@@ -95,6 +95,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
private boolean mHasGotMetaData = false;
private boolean mOnResumed;
private boolean mIsShowDialog = false;
+ private boolean mErrorDialogShowing = false;
private final Handler mHandler = new Handler() {
public void handleMessage(final Message msg) {
@@ -277,7 +278,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
* if we're attached to a window. When we're going away and no
* longer have a window, don't bother showing the user an error.
*/
- if (getWindowToken() != null) {
+ if (getWindowToken() != null && mErrorDialogShowing == false) {
final Resources r = mContext.getResources();
int messageId;
@@ -294,6 +295,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
/* If we get here, there is no onError listener, so
* at least inform them that the video is over.
*/
+ mErrorDialogShowing = false;
if (mOnCompletionListener != null) {
mOnCompletionListener.onCompletion(mMediaPlayer);
}
@@ -301,6 +303,7 @@ public class CodeauroraVideoView extends SurfaceView implements MediaPlayerContr
})
.setCancelable(false)
.show();
+ mErrorDialogShowing = true;
}
return true;
}