diff options
| author | Ben Lin <linben@google.com> | 2021-01-07 16:34:33 -0800 |
|---|---|---|
| committer | Ben Lin <linben@google.com> | 2021-02-04 00:31:19 +0000 |
| commit | 52e7ab8b6fbf25c7ae2daa32676076de8359580e (patch) | |
| tree | 42ff668ba3744aff2edbc8f82d46645eafe5cc0b /core/java | |
| parent | 5e05f48109b647df4867c48d08988538c0ee6fe6 (diff) | |
Pass ActivityOptions to HeavyWeightSwitcherAcivity.
We already pass a bunch of things to it, including an IntentSender, so
pass along the ActivityOptions to respect the original options if there
was any.
Bug: 174318905
Test: atest
android.app.cts.ActivityManagerProcessStateTest#testCantSaveStateLaunchAndSwitch
Change-Id: I792eb2a021cddf8b92fe405feb8f3b9b5ce37b03
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java b/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java index 015238788191..c2ee6461e5e1 100644 --- a/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java +++ b/core/java/com/android/internal/app/HeavyWeightSwitcherActivity.java @@ -53,8 +53,10 @@ public class HeavyWeightSwitcherActivity extends Activity { public static final String KEY_CUR_TASK = "cur_task"; /** Package of newly requested heavy-weight app. */ public static final String KEY_NEW_APP = "new_app"; + public static final String KEY_ACTIVITY_OPTIONS = "activity_options"; IntentSender mStartIntent; + Bundle mActivityOptions; boolean mHasResult; String mCurApp; int mCurTask; @@ -65,8 +67,9 @@ public class HeavyWeightSwitcherActivity extends Activity { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); - + mStartIntent = (IntentSender)getIntent().getParcelableExtra(KEY_INTENT); + mActivityOptions = getIntent().getBundleExtra(KEY_ACTIVITY_OPTIONS); mHasResult = getIntent().getBooleanExtra(KEY_HAS_RESULT, false); mCurApp = getIntent().getStringExtra(KEY_CUR_APP); mCurTask = getIntent().getIntExtra(KEY_CUR_TASK, 0); @@ -148,9 +151,9 @@ public class HeavyWeightSwitcherActivity extends Activity { if (mHasResult) { startIntentSenderForResult(mStartIntent, -1, null, Intent.FLAG_ACTIVITY_FORWARD_RESULT, - Intent.FLAG_ACTIVITY_FORWARD_RESULT, 0); + Intent.FLAG_ACTIVITY_FORWARD_RESULT, 0, mActivityOptions); } else { - startIntentSenderForResult(mStartIntent, -1, null, 0, 0, 0); + startIntentSenderForResult(mStartIntent, -1, null, 0, 0, 0, mActivityOptions); } } catch (IntentSender.SendIntentException ex) { Log.w("HeavyWeightSwitcherActivity", "Failure starting", ex); |
