If app is device or profile app, we disable the background check
toggle. This cl also create an util method for this check and
remove duplicate code
Bug: 64665807
Test: RunSettingsRoboTests
Change-Id: Id8336eadaac8832327bc3653aaa7dfbacde352ac
In my testing, this reduces the runtime of the Robolectric Settings test
suite on my Z840 workstation from 440 seconds to 402 seconds on average.
By avoiding having a method-level Robolectric shadow import, we avoid
going down a code path which needs to add more shadows later in the
Robolectric execution.
Bug: 64808827
Test: Settings robotests still pass
Change-Id: I7b40d73b30306ae3f9759281afbd7f7266579e24
This cl make it could have multiple actions for each anomaly type.
This includes:
1. Add field "targetSdkVersion", "bgRestrictionEnabled" in Anomaly
2. Add new action which includes "force stop" and "background check"
3. Add "sdkVersion" and "bgRestrictionEnabled" method in BatteryUtils
4. Update BackgroundCheckAction to check sdkVersion first
5. Update serveral tests and add new test
Bug: 63037765
Test: RunSettingsRoboTests
Change-Id: Iea7a131ee57d501f7737ae4a3ba672d948d05cd8
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.
Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
We need to refresh batterystatsHelper in onResume, so we need to
call restartLoader instead of initLoader
Bug: 62237848
Test: RunSettingsRoboTests
Change-Id: I6f7e1b57b945c92d34587ca24db192600e7f797f
OEMs can now force grey out the "disable" button for important apps on
device.
Change-Id: Ic075a07ad12592bd60238c7b1c9ab84932c8db3c
Fix: 38250742
Test: make RunSettingsRoboTests
- Migrated ArgumentMatcher subclasses to lambdas
- Replaced any() with nullable() where tests were failing
Test: cd tests/robotests && mma
Bug: 38456058
Change-Id: Ice8c39b435c45b87f82dbbd9860e68f235314cf8
Before this cl, user could go to "Battery usage" page only if
related app has battery usage. This cl breaks this rule so we
could open "Battery usage" without battery data.
Bug: 38497822
Test: RunSettingsRoboTests
Change-Id: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
InstalledAppDetails uses AsyncTask to update foreground mBatteryStatsHelper
in background thread, which is dangerous. This cl make
InstalledAppDetails use BatteryStatsLoader to update batteryStatsHelper
and only assign it once in UI thread.
Bug: 38497555
Test: RunSettingsRoboTests
Change-Id: I3078b60a2dae36995ae5f925b4d49e36e79bddfd
When we are done uninstalling app updates, invalidate the options menu
so that it will be rebuilt and the correct available menu items will be
shown.
Change-Id: I485fe9ff129ac0b2d75094c3b899bf6553e54c74
Fix: 36407258
Test: make RunSettingsRoboTests
InstalledAppDetails tries to refreshUi whenever something about a
package changes. It does not need to refresh when the changing package
is different from what's being displayed.
Change-Id: Ib45289c39ee402cf8974bf52c881f44d225b8be5
Fix: 37424866
Test: make RunSettingsRoboTests
Talk back will read "Used for 3m" as "Used for 3 meters", but
it will read "Used for 3h 3m" correctly.
This cl add specific Ttsspan if the time only contains "minute"
Bug: 36379530
Test: Run SettingsRoboTests
Change-Id: I033575938cce24221980dddd9d66be4e18804541
On the app info page, instant apps show only the supported links
dialog rather than Open by default which opens in a secondary page
where the user can control things that aren't relevant to instant
apps.
Test: make RunSettingsRoboTests
Bug: 36497697
Change-Id: If4eba7c11c5490cbda1ef617002121fe108c4085
This cl add logs to get more data for app usage time.
Also refactor BatteryUtils to singleton pattern because we need
to extract package name from uid.
Bug: 36909166
Test: RunSettingsRoboTests
Change-Id: I6ede354035c46e46cb856b7cf57bd1b7ccbd6d4f
The settings crashes when opening battery usage detail page from
installed app page. Main reason is that it trying to open obsolete
page. This cl directs it to open AdvancedPowerUsageDetail instead.
Following cl will make InstalledAppDetail show calibrated percentage,
which is trakced in b/36816681
Bug: 36792973
Test: RunSettingsRoboTests
Change-Id: Ie63e64e543ed3b28974ffdda8b42c97e7749a0f7
(cherry picked from commit fac713318c)
Adds a confirmation dialog for the user when tapping clear app.
From this dialog the user can either cancel, or confirm they
want to clear the app.
Test: make RunSettingsRoboTests
Bug: 36536695
Change-Id: Idffcf5ef318578ae2e075ea2cbb35323d41acade
In the app details, the first letter of the storage type was
capitalized, causing an odd string of "X used in Internal storage."
Change-Id: Ibcac54259403f6d0f39df8fa2d3af10304a46057
Merged-In: I2b4f23ea1799dc1730fdab596e4a87a0cb673c68
Fixes: 36001265
Test: Settings robotest
Bug: 35098444
Test: make RunSettingsRoboTests
This implements the following changes to the app details screen:
-Suppresses the "Uninstall" and "Force Stop" buttons
-Adds "Install app" and "Clear app" buttons
-Adds a mechanism for showing a link to the store's app details
page that can be different from the default for installed apps.
Change-Id: Icea83f7d1fde62d4101cb0c8a6d03849f6c56bca
This cl adds AdvancedPowerUsageDetail to show the usage details page.
The AdvancedPowerUsageDetail contains all the needed ui components:
1. App Header
2. Two buttons
3. Usage breakdown preference category
4. Power management preference category
This cl also adds preference controller for two buttons but the
detail implementation will be added in the following cl.
Following cl will also remove previous detail page.
Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: I17f95d1288762094671c0f148fa73367e51f175e
- when there is only 1 user installed the app, also check if it is
installed by the current user or by other user to determine whether or
not to show the uninstall for all button.
Change-Id: I1eecb13a7748c92159cb0626e2b6fe1ed6987d15
Fix: 34760157
Test: make RunSettingsRoboTests
- in Settings->Apps & notifications->Apps->[select app], update the
header summary to installation status, and move the version text to
the bottom of the page.
- updatd preference title from Apps to App info
- update preference title from Notifications to App notifications
Bug: 34977561
Test: make RunSettingsRoboTests
Change-Id: I97e9b81c739fb99eaca2cf45fb11f208ad6cd9ca