Move two params to ResolverActivity.onCreate()
Namely, this is the data that subclasses previously configured by
calling up to `ResolverActivity.setSafeForwardingMode()` and
`ResolverActivity.setAdditionalTargets()`.
Both parameters are constant within a session (even though we still
don't have a great place to hold them as `final`) -- and both can
affect the behavior of `ResolverActivity.onCreate()`, so it's
important that we have the data prepared for that call (and,
especially in the case of "additional targets" it's not necessarily
clear what would happen if we made additional changes afterward).
Chooser was already setting these at the right time, but this makes
the dependency explicit and prevents accidental misuse.
This is a pure refactoring that trivially has no side effects in the
IntentResolver codebase. The API change in ResolverActivity would
break other subclasses (if they were depending on the IntentResolver
fork instead of the framework version), but that's not relevant right
now, and besides, the only client that would seem to be broken is
CarResolverActivity, which currently uses these APIs incorrectly.
Test: IntentResolverUnitTests, CtsSharesheetDeviceTest
Bug: 286249609
Change-Id: I7309a4fb33244cfac20c8dffc81e738a91381904
2 files changed