commit | 91c10ea1620ee887b477375d7a804b9e5bffac3f | [log] [tgz] |
---|---|---|
author | Joshua Trask <joshtrask@google.com> | Thu Dec 14 17:42:55 2023 +0000 |
committer | Joshua Trask <joshtrask@google.com> | Fri Dec 15 00:36:23 2023 +0000 |
tree | d6bd631ff3434eda1aa857ccd0df18fb6bbd8aba | |
parent | 91c38786bac73496d8437f83741587120199cbfe [diff] |
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
IntentResolver
provides the implementation for Intent ACTION_CHOOSER
See also: ShareCompat.IntentBuilder