diff options
author | mqi <mqi@codeaurora.org> | 2015-05-18 14:29:02 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-01-18 20:49:06 -0800 |
commit | b2c812c1c01589f0bf70896065ef48342c85a45a (patch) | |
tree | 1383887d43ad40e6b93fb81e5b186988d626f758 /src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java | |
parent | 119c6106bd1ea71c64f47fc323e953a12890f53b (diff) | |
download | android_packages_apps_Gallery2-b2c812c1c01589f0bf70896065ef48342c85a45a.tar.gz android_packages_apps_Gallery2-b2c812c1c01589f0bf70896065ef48342c85a45a.tar.bz2 android_packages_apps_Gallery2-b2c812c1c01589f0bf70896065ef48342c85a45a.zip |
Gallery2: Avoid showing error dialog multiple times
When framework sent error message frequently gallery will show error
dialog multiple times which will cause lmk.
Add condition to check if error dialog is already showing, avoid
showing it again.
Change-Id: I901b93c820bd760b52796432870d148f93a091c3
CRs-Fixed: 835360
Diffstat (limited to 'src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java')
-rw-r--r-- | src/org/codeaurora/gallery3d/video/CodeauroraVideoView.java | 5 |
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; } |