OSDN Git Service

DO NOT MERGE Fix jank when intent resolver/chooser windows animate in
authorAdam Powell <adamp@google.com>
Mon, 19 Oct 2015 23:25:08 +0000 (16:25 -0700)
committerAdam Powell <adamp@google.com>
Mon, 19 Oct 2015 23:56:20 +0000 (16:56 -0700)
An old optimization in ViewRoot prevents updating a window surface
while a window animation is playing. SystemUI and other small system
components that blend these animations disable this for a smoother
experience. Disable it in ResolverActivity as well.

Bug 24989381

Change-Id: Iac7d1c7b1101ed8d2bc4c3557277a773ce871beb

core/java/com/android/internal/app/ResolverActivity.java

index ba0912a..4ba678c 100644 (file)
@@ -26,6 +26,7 @@ import android.os.AsyncTask;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Slog;
+import android.view.View.OnAttachStateChangeListener;
 import android.widget.AbsListView;
 import com.android.internal.R;
 import com.android.internal.content.PackageMonitor;
@@ -331,6 +332,18 @@ public class ResolverActivity extends Activity {
         if (isVoiceInteraction()) {
             onSetupVoiceInteraction();
         }
+
+        getWindow().getDecorView().addOnAttachStateChangeListener(
+                new OnAttachStateChangeListener() {
+            @Override
+            public void onViewAttachedToWindow(View v) {
+                v.getViewRootImpl().setDrawDuringWindowsAnimating(true);
+            }
+
+            @Override
+            public void onViewDetachedFromWindow(View v) {
+            }
+        });
     }
 
     /**