summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2016-03-29 15:36:59 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-19 23:15:16 -0700
commit8abca91401ec354403a02137b81caf561787c287 (patch)
tree4e2b5083eb41863c753e699f16016326002bf621
parent33aceac8417557c7f63d2cab1f27a81fefbb9c8b (diff)
downloadandroid_packages_apps_Gallery2-8abca91401ec354403a02137b81caf561787c287.tar.gz
android_packages_apps_Gallery2-8abca91401ec354403a02137b81caf561787c287.tar.bz2
android_packages_apps_Gallery2-8abca91401ec354403a02137b81caf561787c287.zip
Gallery: improve loading performace
Partially revert commit I0f09128f8c948a33b72a5b4933efe7f4fbba2cb2 as it does no good but delays page resume call for around 500ms. Change-Id: I7a754467a9353c623bec73bf6d492ed9ba9f28e5 CRs-Fixed: 984190 985483
-rw-r--r--src/com/android/gallery3d/app/AbstractGalleryActivity.java36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
index 5203d3553..08a3872e0 100644
--- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java
+++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
@@ -38,7 +38,6 @@ import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toolbar;
-import android.os.Handler;
import com.android.gallery3d.R;
import com.android.gallery3d.common.ApiHelper;
@@ -62,7 +61,6 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
private TransitionStore mTransitionStore = new TransitionStore();
private boolean mDisableToggleStatusBar;
private PanoramaViewHelper mPanoramaViewHelper;
- private static final int ONRESUME_DELAY = 50;
private Toolbar mToolbar;
private AlertDialog mAlertDialog = null;
@@ -216,31 +214,15 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
@Override
protected void onResume() {
super.onResume();
- delayedOnResume(ONRESUME_DELAY);
- }
-
- private void delayedOnResume(final int delay){
- final Handler handler = new Handler();
- Runnable delayTask = new Runnable() {
- @Override
- public void run() {
- handler.postDelayed(new Runnable() {
- @Override
- public void run() {
- mGLRootView.lockRenderThread();
- try {
- getStateManager().resume();
- getDataManager().resume();
- } finally {
- mGLRootView.unlockRenderThread();
- }
- mGLRootView.onResume();
- mOrientationManager.resume();
- }}, delay);
- }
- };
- Thread delayThread = new Thread(delayTask);
- delayThread.start();
+ mGLRootView.lockRenderThread();
+ try {
+ getStateManager().resume();
+ getDataManager().resume();
+ } finally {
+ mGLRootView.unlockRenderThread();
+ }
+ mGLRootView.onResume();
+ mOrientationManager.resume();
}
@Override