From 5479dacd8c99a6d7df26aa58747417b16c46183e Mon Sep 17 00:00:00 2001 From: Anthony Alridge Date: Fri, 12 May 2023 13:11:46 +0000 Subject: [PATCH] Open intent with animation for mini-resolver Uses an animation when the min-resolver opens an intent (push down and fade out the mini-resolver, then sliding in the new activity). Note that this does not work if the new activity is opened in a new task, due to being unable to override the system animations for task transitions. Bug: 271818896 Test: Manual, see bug for before and after video Test: atest IntentForwarderActivityTest Change-Id: If64da935621f49e5c5013dd791b85f48c0cfd861 --- .../android/internal/app/IntentForwarderActivity.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/app/IntentForwarderActivity.java b/core/java/com/android/internal/app/IntentForwarderActivity.java index 44d517ad0c325..009d65a83151a 100644 --- a/core/java/com/android/internal/app/IntentForwarderActivity.java +++ b/core/java/com/android/internal/app/IntentForwarderActivity.java @@ -29,6 +29,7 @@ import static com.android.internal.app.ResolverActivity.EXTRA_SELECTED_PROFILE; import android.annotation.Nullable; import android.annotation.TestApi; import android.app.Activity; +import android.app.ActivityOptions; import android.app.ActivityThread; import android.app.AppGlobals; import android.app.admin.DevicePolicyManager; @@ -220,7 +221,15 @@ public class IntentForwarderActivity extends Activity { findViewById(R.id.use_same_profile_browser).setOnClickListener(v -> finish()); findViewById(R.id.button_open).setOnClickListener(v -> { - startActivityAsCaller(launchIntent, targetUserId); + startActivityAsCaller( + launchIntent, + ActivityOptions.makeCustomAnimation( + getApplicationContext(), + R.anim.activity_open_enter, + R.anim.push_down_out) + .toBundle(), + /* ignoreTargetSecurity= */ false, + targetUserId); finish(); }); }