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

Skip to content
Commit c6eaf1ca authored by Azhara Assanova's avatar Azhara Assanova
Browse files

Add ComponentCaller APIs for Activity's new intents

With activities potentially receiving multiple intents at the same time,
it is important to match intents to their callers correctly. Hence, this
change overloads existing onNewIntent with a ComponentCaller -
onNewIntent(Intent, ComponentCaller).

To supplement the new overload, this CL adds these Activity APIs:
- getCurrentCaller() - only works within onNewIntent(), should be used
  by those that don't override the new overload of onNewIntent.

- setIntent(Intent, ComponentCaller) - to keep the new intent caller for
  future use.

- getCaller() - to retrieve the caller associated with the intent from
  getIntent().

Finally, this change adds an Instrumentation API:
callActivityOnNewIntent(Activity, Intent, ComponentCaller).

Bug: 293467489
Test: atest CtsAndroidAppTestCases:android.app.cts.ShareIdentityTest
Test: atest CtsAndroidAppTestCases:android.app.cts.ComponentCallerTest
Test: atest CtsAppTestCases:android.app.cts.InstrumentationTest
Change-Id: I6e2457171e910fa3d05430f62db8d735ce324f5a
parent 99b8ecb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment