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

Commit 748bcb04 authored by lumark's avatar lumark Committed by Automerger Merge Worker
Browse files

[RESTRICT AUTOMERGE] Restrict app transition maximum duration am: 36bcc773 am: dcc38988

Change-Id: Ied1793dbc8d7b58170e22729aa351c582c894ffa
parents e3f2048f dcc38988
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ public class AppTransition implements Dump {
    private static final int MAX_CLIP_REVEAL_TRANSITION_DURATION = 420;
    private static final int THUMBNAIL_APP_TRANSITION_DURATION = 336;
    private static final long APP_TRANSITION_TIMEOUT_MS = 5000;
    static final int MAX_APP_TRANSITION_DURATION = 3 * 1000; // 3 secs.

    private final Context mContext;
    private final WindowManagerService mService;
+11 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
import static android.view.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
import static com.android.server.LockGuard.INDEX_WINDOW;
import static com.android.server.LockGuard.installLock;
import static com.android.server.wm.AppTransition.MAX_APP_TRANSITION_DURATION;
import static com.android.server.wm.AppTransition.TRANSIT_UNSET;
import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_END;
import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_START;
@@ -2413,7 +2414,16 @@ public class WindowManagerService extends IWindowManager.Stub
                    displayConfig.orientation, frame, displayFrame, insets, surfaceInsets,
                    stableInsets, isVoiceInteraction, freeform, atoken.getTask().mTaskId);
            if (a != null) {
                if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + atoken);
                if (a != null) {
                    // Setup the maximum app transition duration to prevent malicious app may set a long
                    // animation duration or infinite repeat counts for the app transition through
                    // ActivityOption#makeCustomAnimation or WindowManager#overridePendingTransition.
                    a.restrictDuration(MAX_APP_TRANSITION_DURATION);
                }
                if (DEBUG_ANIM) {
                    logWithStack(TAG, "Loaded animation " + a + " for " + atoken
                            + ", duration: " + ((a != null) ? a.getDuration() : 0));
                }
                final int containingWidth = frame.width();
                final int containingHeight = frame.height();
                atoken.mAppAnimator.setAnimation(a, containingWidth, containingHeight, width,