The device management info page should show information about the
current user's policies, not the primary user's.
Bug: 32692748
Test: m RunSettingsRoboTests
Change-Id: I5d8afa7fae1c0f3a4da78b085365882827e6721b
(cherry picked from commit b836da263d)
DO disclosures referring to actions that the admin did not actually
take are hidden in the UI, but still show up in the search index. This
CL takes the following steps toward fixing this:
* Pass the list of PreferenceControllers to the search indexer
* Make the first two PrefrenceControllers set isAvailable() correctly
There are more disclosures to update, but the difficult work is done
as all others will follow the same pattern.
Bug: 32692748
Test: m RunSettingsRoboTests
Change-Id: I7d3e248b80abe72b79fce7afa11f28a822de6986
Don't use the PM flag to reach across users.
If retrieving labels, etc., use MATCH_ANY_USER, since
several Settings screens show work profile apps as well.
Bug: 31000380
Test: Manual test of affected screens
Change-Id: Ib6f981ae8443f640276d395c37247c8c0b610894
This CL extracts the code that counts the number of installed apps
for a set of users from ManageApplications to a helper class,
InstalledAppCounter. The new helper is designed to be unit-testable
(PackageManager dependencies are injected via a new PackageManagerWrapper
abstraction) and customizable (the set of users for which to count is
specified by subclasses).
The CL adds a unit test for the InstalledAppCounter as well.
Test: make RunSettingsRoboTests
Bug: 32692748
Change-Id: Ie7fbd40d9dd998b27f1f9de227b6a187b5c9d315
Since it grabs a lock that can be slow on the main thread, don't use
ApplicationsState in any of the summaries, instead load the information
directly from the PM.
Change-Id: Ibefe867810d2a9926177a8de4e23a7faea4b1c3b
Fixes: 28435146