Merge "Restrict app transition maximum duration" into rvc-dev am: f43e6bc49d
Change-Id: Ie74c2bc79718b7788b7b615b161d4c6c8d1d2cde
This commit is contained in:
@@ -172,6 +172,7 @@ public class AppTransition implements Dump {
|
|||||||
private static final int MAX_CLIP_REVEAL_TRANSITION_DURATION = 420;
|
private static final int MAX_CLIP_REVEAL_TRANSITION_DURATION = 420;
|
||||||
private static final int THUMBNAIL_APP_TRANSITION_DURATION = 336;
|
private static final int THUMBNAIL_APP_TRANSITION_DURATION = 336;
|
||||||
private static final long APP_TRANSITION_TIMEOUT_MS = 5000;
|
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 Context mContext;
|
||||||
private final WindowManagerService mService;
|
private final WindowManagerService mService;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import static android.os.UserHandle.USER_NULL;
|
|||||||
import static android.view.SurfaceControl.Transaction;
|
import static android.view.SurfaceControl.Transaction;
|
||||||
|
|
||||||
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
|
||||||
|
import static com.android.server.wm.AppTransition.MAX_APP_TRANSITION_DURATION;
|
||||||
import static com.android.server.wm.IdentifierProto.HASH_CODE;
|
import static com.android.server.wm.IdentifierProto.HASH_CODE;
|
||||||
import static com.android.server.wm.IdentifierProto.TITLE;
|
import static com.android.server.wm.IdentifierProto.TITLE;
|
||||||
import static com.android.server.wm.IdentifierProto.USER_ID;
|
import static com.android.server.wm.IdentifierProto.USER_ID;
|
||||||
@@ -2172,7 +2173,16 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
|||||||
displayConfig.uiMode, displayConfig.orientation, frame, displayFrame, insets,
|
displayConfig.uiMode, displayConfig.orientation, frame, displayFrame, insets,
|
||||||
surfaceInsets, stableInsets, isVoiceInteraction, inFreeformWindowingMode(), this);
|
surfaceInsets, stableInsets, isVoiceInteraction, inFreeformWindowingMode(), this);
|
||||||
if (a != null) {
|
if (a != null) {
|
||||||
if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + this);
|
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 " + this
|
||||||
|
+ ", duration: " + ((a != null) ? a.getDuration() : 0));
|
||||||
|
}
|
||||||
final int containingWidth = frame.width();
|
final int containingWidth = frame.width();
|
||||||
final int containingHeight = frame.height();
|
final int containingHeight = frame.height();
|
||||||
a.initialize(containingWidth, containingHeight, width, height);
|
a.initialize(containingWidth, containingHeight, width, height);
|
||||||
|
|||||||
Reference in New Issue
Block a user