diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-05-15 14:53:30 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-05-16 10:55:21 -0700 |
commit | 55eb556a4b9b028a6a0cbe28400ae0582eb4ae04 (patch) | |
tree | e7a79a35e1586ed6f0dde0f65cb720b54e77e50c /quickstep | |
parent | d9a1337b40fcb1041bba48cd59d7f358f5b7895f (diff) | |
download | android_packages_apps_Trebuchet-55eb556a4b9b028a6a0cbe28400ae0582eb4ae04.tar.gz android_packages_apps_Trebuchet-55eb556a4b9b028a6a0cbe28400ae0582eb4ae04.tar.bz2 android_packages_apps_Trebuchet-55eb556a4b9b028a6a0cbe28400ae0582eb4ae04.zip |
Dumping the excoded view hierarchy instead of the default activity dump
> Encoded hierarchy is smaller is size and has a lot more information about the views
Bug: 79861035
Change-Id: I84316b1b0031282b0579f3aaac22d8d8f00d8bcb
Diffstat (limited to 'quickstep')
-rw-r--r-- | quickstep/libs/sysui_shared.jar | bin | 128240 -> 128738 bytes | |||
-rw-r--r-- | quickstep/src/com/android/launcher3/uioverrides/UiFactory.java | 34 |
2 files changed, 34 insertions, 0 deletions
diff --git a/quickstep/libs/sysui_shared.jar b/quickstep/libs/sysui_shared.jar Binary files differindex 95bb8bbed..5e25fd8bf 100644 --- a/quickstep/libs/sysui_shared.jar +++ b/quickstep/libs/sysui_shared.jar diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java index 06099b9fa..e6030d126 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java @@ -24,7 +24,9 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.allapps.DiscoveryBounce.HOME_BOUNCE_SEEN; import static com.android.launcher3.allapps.DiscoveryBounce.SHELF_BOUNCE_SEEN; +import android.app.Activity; import android.content.Context; +import android.util.Base64; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; @@ -32,13 +34,19 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; import com.android.launcher3.LauncherStateManager.StateHandler; +import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.util.TouchController; import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.RecentsModel; import com.android.quickstep.views.RecentsView; +import com.android.systemui.shared.system.ActivityCompat; import com.android.systemui.shared.system.WindowManagerWrapper; +import java.io.ByteArrayOutputStream; +import java.io.PrintWriter; +import java.util.zip.Deflater; + public class UiFactory { public static TouchController[] createTouchControllers(Launcher launcher) { @@ -167,6 +175,32 @@ public class UiFactory { } } + public static boolean dumpActivity(Activity activity, PrintWriter writer) { + if (!Utilities.IS_DEBUG_DEVICE) { + return false; + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + if (!(new ActivityCompat(activity).encodeViewHierarchy(out))) { + return false; + } + + Deflater deflater = new Deflater(); + deflater.setInput(out.toByteArray()); + deflater.finish(); + + out.reset(); + byte[] buffer = new byte[1024]; + while (!deflater.finished()) { + int count = deflater.deflate(buffer); // returns the generated code... index + out.write(buffer, 0, count); + } + + writer.println("--encoded-view-dump-v0--"); + writer.println(Base64.encodeToString( + out.toByteArray(), Base64.NO_WRAP | Base64.NO_PADDING)); + return true; + } + private static class LauncherTaskViewController extends TaskViewTouchController<Launcher> { public LauncherTaskViewController(Launcher activity) { |