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

Commit bceca006 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Override behavior for overview temporarily

The overview on certain devices won't be able to calculate the
screenshot clip size correctly. This should be fixed.

Temporarily override the behavior to unblock the frameworks change.

Bug: 329378309
Test: NexusLauncherImageTests
Change-Id: Iff01ba913ebebfd9bbd3d84155759c7db67e1329
parent a2073989
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.service.contentcapture.ActivityEvent;
@@ -1003,6 +1004,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    // Whether the Activity allows state sharing in untrusted embedding
    private final boolean mAllowUntrustedEmbeddingStateSharing;

    // TODO(b/329378309): Remove this once the overview handles the configuration correctly.
    private static final boolean OVERRIDE_OVERVIEW_CONFIGURATION =
            SystemProperties.getBoolean("persist.wm.debug.override_overview_configuration", true);

    // Records whether client has overridden the WindowAnimation_(Open/Close)(Enter/Exit)Animation.
    private CustomAppTransition mCustomOpenTransition;
    private CustomAppTransition mCustomCloseTransition;
@@ -8605,7 +8610,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (rotation == ROTATION_UNDEFINED && !isFixedRotationTransforming()) {
            rotation = mDisplayContent.getRotation();
        }
        if (!mWmService.mFlags.mInsetsDecoupledConfiguration
        final int activityType = inOutConfig.windowConfiguration.getActivityType();
        if (OVERRIDE_OVERVIEW_CONFIGURATION
                && (activityType == ACTIVITY_TYPE_HOME || activityType == ACTIVITY_TYPE_RECENTS)) {
            // Do not early return and provide the override. This should be removed shortly as we
            // don't override 1P components.
        } else if (!mWmService.mFlags.mInsetsDecoupledConfiguration
                || info.isChangeEnabled(INSETS_DECOUPLED_CONFIGURATION_ENFORCED)
                || getCompatDisplayInsets() != null
                || isFloating(parentWindowingMode) || fullBounds == null