Treat all inactive profiles equally

Now that we've handled all the "profile-specific" special cases in
ag/25599173, remaining references to a generic "inactive profile"
can be adapted to apply to *all* inactive profiles, since in the
future we may have more than one.

These changes are as prototyped in ag/25335069 and described in
go/chooser-ntab-refactoring. This CL covers the original "snapshot
20" through "snapshot 25." See below for a "by-snapshot" breakdown of
the incremental changes composed in this CL.

Snapshot 1:
Establish `forEachPage()` and `forEachInactivePage()` helpers that
we'll use to implement per-page operations throughout the changes
included in this CL. Convert a first operation, the Resolver-specific
`clearCheckedItemsInInactiveProfiles()`.

Snapshot 2:
Generalize the `shouldShowEmptyStateScreenInAnyInactiveAdapter()`
implementation (so it in fact considers "any" inactive adapter).

Snapshot 3:
Generalize `refreshPackagesInAllTabs()` to handle any number of tabs.

Snapshot 4:
Generalize `rebuildInactiveTab()` -> `rebuildInactiveTabs()`. This
relies on some imagination about how the legacy intention might apply
to multiple tabs, but it's at least equivalent in the legacy two-tab
case. Note this implementation may appear to differ from the legacy
code by returning true instead of false when there are no inactive
tabs, but it's a vacuous distinction because the legacy caller
effectively checked for a tabbed presentation as a precondition for
calling this method. Returning true by default is more appropriate if
we relax that precondition, so we wouldn't end up waiting in an
"incomplete" status on behalf of a tab that doesn't exist.

Snapshot 5:
Remove the API to access some single "inactive tab" -- there may be
more than one in the future.

Snapshot 6:
Generalize `clearInactiveProfileCache()`.

Bug: 310211468
Test: `ResolverActivityTest` & IntentResolver activity tests.
Change-Id: Ifcba88bb3d678364a55771a9801f3626dfbfd25a
5 files changed
tree: d6bd631ff3434eda1aa857ccd0df18fb6bbd8aba
  1. aconfig/
  2. java/
  3. tests/
  4. Android.bp
  5. AndroidManifest-app.xml
  6. AndroidManifest-lib.xml
  7. OWNERS
  8. PREUPLOAD.cfg
  9. proguard.flags
  10. README.md
  11. TEST_MAPPING
README.md

IntentResolver

About

IntentResolver provides the implementation for Intent ACTION_CHOOSER

See also: ShareCompat.IntentBuilder