summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui
diff options
context:
space:
mode:
authorKedi Xu <kedix@codeaurora.org>2016-09-02 08:48:26 +0800
committerKedi Xu <kedix@codeaurora.org>2016-09-02 08:48:26 +0800
commit0351ddfd60c6f16d5c3e548c6fa8c7e78ce22f33 (patch)
treee8ab6f90f9be822fea919741d6ddeb6fb9ab1dce /src/com/android/gallery3d/ui
parent50ebf4bb05538434e5676fb4f8ffc58fdc1d853f (diff)
downloadandroid_packages_apps_Gallery2-0351ddfd60c6f16d5c3e548c6fa8c7e78ce22f33.tar.gz
android_packages_apps_Gallery2-0351ddfd60c6f16d5c3e548c6fa8c7e78ce22f33.tar.bz2
android_packages_apps_Gallery2-0351ddfd60c6f16d5c3e548c6fa8c7e78ce22f33.zip
SnapdragonGallery: Fix anr in PotoPage
When lock and unlock the screen in PotoPage, Gallery will anr because of dead lock. Change-Id: I3bdda0d69d7dcd7ee2317a9bdd5c2c4ad14b1034 CRs-Fixed: 1059897
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/ui/GLRoot.java2
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/ui/GLRootView.java58
-rwxr-xr-x[-rw-r--r--]src/com/android/gallery3d/ui/PhotoView.java4
3 files changed, 0 insertions, 64 deletions
diff --git a/src/com/android/gallery3d/ui/GLRoot.java b/src/com/android/gallery3d/ui/GLRoot.java
index caa36c334..50ba2e4d2 100644..100755
--- a/src/com/android/gallery3d/ui/GLRoot.java
+++ b/src/com/android/gallery3d/ui/GLRoot.java
@@ -45,8 +45,6 @@ public interface GLRoot {
public int getDisplayRotation();
public int getCompensation();
public Matrix getCompensationMatrix();
- public void freeze();
- public void unfreeze();
public void setLightsOutMode(boolean enabled);
public Context getContext();
diff --git a/src/com/android/gallery3d/ui/GLRootView.java b/src/com/android/gallery3d/ui/GLRootView.java
index 5d9621b6d..579fd05d0 100644..100755
--- a/src/com/android/gallery3d/ui/GLRootView.java
+++ b/src/com/android/gallery3d/ui/GLRootView.java
@@ -105,9 +105,6 @@ public class GLRootView extends GLSurfaceView
private final IdleRunner mIdleRunner = new IdleRunner();
private final ReentrantLock mRenderLock = new ReentrantLock();
- private final Condition mFreezeCondition =
- mRenderLock.newCondition();
- private boolean mFreeze;
private long mLastDrawFinishTime;
private boolean mInDownState = false;
@@ -352,10 +349,6 @@ public class GLRootView extends GLSurfaceView
}
mRenderLock.lock();
- while (mFreeze) {
- mFreezeCondition.awaitUninterruptibly();
- }
-
try {
onDrawFrameLocked(gl);
} finally {
@@ -542,7 +535,6 @@ public class GLRootView extends GLSurfaceView
@Override
public void onPause() {
- unfreeze();
super.onPause();
if (DEBUG_PROFILE) {
Log.d(TAG, "Stop profiling");
@@ -572,20 +564,6 @@ public class GLRootView extends GLSurfaceView
return mCompensationMatrix;
}
- @Override
- public void freeze() {
- mRenderLock.lock();
- mFreeze = true;
- mRenderLock.unlock();
- }
-
- @Override
- public void unfreeze() {
- mRenderLock.lock();
- mFreeze = false;
- mFreezeCondition.signalAll();
- mRenderLock.unlock();
- }
@Override
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@@ -602,40 +580,4 @@ public class GLRootView extends GLSurfaceView
setSystemUiVisibility(flags);
}
- // We need to unfreeze in the following methods and in onPause().
- // These methods will wait on GLThread. If we have freezed the GLRootView,
- // the GLThread will wait on main thread to call unfreeze and cause dead
- // lock.
- @Override
- public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
- unfreeze();
- super.surfaceChanged(holder, format, w, h);
- }
-
- @Override
- public void surfaceCreated(SurfaceHolder holder) {
- unfreeze();
- super.surfaceCreated(holder);
- }
-
- @Override
- public void surfaceDestroyed(SurfaceHolder holder) {
- unfreeze();
- super.surfaceDestroyed(holder);
- }
-
- @Override
- protected void onDetachedFromWindow() {
- unfreeze();
- super.onDetachedFromWindow();
- }
-
- @Override
- protected void finalize() throws Throwable {
- try {
- unfreeze();
- } finally {
- super.finalize();
- }
- }
}
diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java
index 42888f33d..7ee799c03 100644..100755
--- a/src/com/android/gallery3d/ui/PhotoView.java
+++ b/src/com/android/gallery3d/ui/PhotoView.java
@@ -128,7 +128,6 @@ public class PhotoView extends GLView {
public void onFullScreenChanged(boolean full);
public void onActionBarAllowed(boolean allowed);
public void onActionBarWanted();
- public void onCurrentImageUpdated();
public void onDeleteImage(Path path, int offset);
public void onUndoDeleteImage();
public void onCommitDeleteImage();
@@ -469,9 +468,6 @@ public class PhotoView extends GLView {
}
public void notifyImageChange(int index) {
- if (index == 0) {
- mListener.onCurrentImageUpdated();
- }
mPictures.get(index).reload();
setPictureSize(index);
invalidate();