Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc0032a3 authored by lumark's avatar lumark
Browse files

Generalized AppWindowThumbnail as WindowContainerThumbnail

Also modified some miscellaneous code logics related animation.

Bug: 142617871
Bug: 131661052
Test: Refactoring, existing tests pass.
Change-Id: Ia06d500bc6b6bf247d840d14cc81d2358af2d400
parent 39a3c604
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@ package com.android.server.wm;
option java_multiple_files = true;

/**
 * Represents a {@link com.android.server.wm.AppWindowThumbnail} object.
 * Represents a {@link com.android.server.wm.WindowContainerThumbnailProto} object.
 */
message AppWindowThumbnailProto {
message WindowContainerThumbnailProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    optional int32 width = 1;
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import "frameworks/base/core/proto/android/app/statusbarmanager.proto";
import "frameworks/base/core/proto/android/content/activityinfo.proto";
import "frameworks/base/core/proto/android/content/configuration.proto";
import "frameworks/base/core/proto/android/graphics/rect.proto";
import "frameworks/base/core/proto/android/server/appwindowthumbnail.proto";
import "frameworks/base/core/proto/android/server/windowcontainerthumbnail.proto";
import "frameworks/base/core/proto/android/server/surfaceanimator.proto";
import "frameworks/base/core/proto/android/view/displaycutout.proto";
import "frameworks/base/core/proto/android/view/displayinfo.proto";
@@ -232,7 +232,7 @@ message AppWindowTokenProto {
    optional bool last_surface_showing = 3;
    optional bool is_waiting_for_transition_start = 4;
    optional bool is_animating = 5;
    optional AppWindowThumbnailProto thumbnail = 6;
    optional WindowContainerThumbnailProto thumbnail = 6;
    optional bool fills_parent = 7;
    optional bool app_stopped = 8;
    optional bool hidden_requested = 9;
+6 −6
Original line number Diff line number Diff line
@@ -301,12 +301,6 @@
      "group": "WM_DEBUG_REMOTE_ANIMATIONS",
      "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
    },
    "-1483752006": {
      "message": "  THUMBNAIL %s: CREATE",
      "level": "INFO",
      "group": "WM_SHOW_TRANSACTIONS",
      "at": "com\/android\/server\/wm\/AppWindowThumbnail.java"
    },
    "-1471946192": {
      "message": "Marking app token %s with replacing child windows.",
      "level": "DEBUG",
@@ -1303,6 +1297,12 @@
      "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
      "at": "com\/android\/server\/wm\/AppTransition.java"
    },
    "531242746": {
      "message": "  THUMBNAIL %s: CREATE",
      "level": "INFO",
      "group": "WM_SHOW_TRANSACTIONS",
      "at": "com\/android\/server\/wm\/WindowContainerThumbnail.java"
    },
    "539077569": {
      "message": "Clear freezing of %s force=%b",
      "level": "VERBOSE",
+5 −5
Original line number Diff line number Diff line
@@ -5814,7 +5814,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    mWmService.mTaskSnapshotController.createTaskSnapshot(
                            task, 1 /* scaleFraction */);
            if (snapshot != null) {
                mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, t, this,
                mThumbnail = new WindowContainerThumbnail(mWmService.mSurfaceFactory, t, this,
                        snapshot.getGraphicBuffer(), true /* relative */);
            }
        }
@@ -5923,8 +5923,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return;
        }
        clearThumbnail();
        mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory, getPendingTransaction(),
                this, thumbnailHeader);
        mThumbnail = new WindowContainerThumbnail(mWmService.mSurfaceFactory,
                getPendingTransaction(), this, thumbnailHeader);
        mThumbnail.startAnimation(getPendingTransaction(), loadThumbnailAnimation(thumbnailHeader));
    }

@@ -5952,7 +5952,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (thumbnail == null) {
            return;
        }
        mThumbnail = new AppWindowThumbnail(mWmService.mSurfaceFactory,
        mThumbnail = new WindowContainerThumbnail(mWmService.mSurfaceFactory,
                getPendingTransaction(), this, thumbnail);
        final Animation animation =
                getDisplayContent().mAppTransition.createCrossProfileAppsThumbnailAnimationLocked(
@@ -6100,7 +6100,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    @VisibleForTesting
    AppWindowThumbnail getThumbnail() {
    WindowContainerThumbnail getThumbnail() {
        return mThumbnail;
    }

+3 −1
Original line number Diff line number Diff line
@@ -1922,11 +1922,13 @@ public class AppTransition implements Dump {
        if (taskId < 0) {
            return null;
        }
        ArrayList<Task> tasks = new ArrayList<>();
        final ArrayList<Task> tasks = new ArrayList<>();
        mDisplayContent.forAllTasks(task -> {
            if (task.mTaskId == taskId) {
                tasks.add(task);
                return true;
            }
            return false;
        });
        return tasks.size() == 1 ? tasks.get(0) : null;
    }
Loading