Fix several bugs related to storage accounting. Since getDataBytes()
already includes cached data, we need to subtract it to avoid blaming
apps for it.
We also need to blame app code on someone, so we blame it on the
current user. StorageStatsManager was fixed awhile back to only
return the app code size on the requested storage volume, so we can
remove the system app checks.
Subtract "appBytes" from external storage accounting, since it's
already been blamed elsewhere against specific apps.
Pass along storage results from all users on the device, and subtract
them all when estimating size of "system" data. To avoid embarrassing
estimation bugs, make sure that "system" data is at least 1GB.
Bug: 38008706
Test: cts-tradefed run commandAndExit cts-dev -m CtsJobSchedulerTestCases -t android.jobscheduler.cts.StorageConstraintTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Change-Id: Ide1e6d0690e5ad4e751c87891f63ba1036434619
The override filter for storage to ensure that we filter by UUID and
user id was designed as an override filter. This worked as long as there
never was any other filters which could be used out of Storage Settings.
It turns out the instant apps filter applies here.
As a result, I've moved these filters into being "composite filters"
which are composed with the primary filter instead of overriding the
primary filter.
Fixes: 35245772
Test: Settings Robotests... but as for the composing part it is
b/34768986
Change-Id: I6f5acb909568ab02e81187c09fdda9533d635781
Move the summary for the toggled features to a footer.
Make the settings appear as a preference.
Bug: 36780887
Test: Start settings and observe the new UI looks a lot
like the mocks referenced in the bug. Also added unit
test to verify that summary text shows up.
Change-Id: I1d002b194991d0901ecb27198ba5de73bd23a5a9
Move updateUi logic from onPause/onResume to onStop/onStart.
Change-Id: Iebe38d201d531058472cd033a0408239d36d32e4
Fix: 36305836
Test: instrumentation test
Consolidated the many variants of ChooseLock*.createIntent, so that
it will take the same set of arguments.
Also modified SetupChooseLock*.createIntent to modifyIntentForSetup,
which will take the intent created by ChooseLock* and modify it for
use with setup.
Test: cd tests/robotests && mma
Change-Id: I5ff033f459c33ec9980872a536b3996d89f2bbbb
The other storage view used a compound filter with a UUID filter and the
normal filter. The category filters were omitting the compound UUID
filter. This adds it.
Test: Settings unit test
Change-Id: Ic0118abf58dabbf430a81e1fbcefb7acfdef472c
Fixes: 37780836
Static overlays aren't changeable by a user. So we shouldn't list them
as a theme.
This CL fixed b/36812704 as well to run unit tests.
Test: building succeeded and tested on sailfish.
make RunSettingsRoboTests
adb shell am instrument -w -e class \
com.android.settings.display.ThemePreferenceControllerTest \
com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
Bug: 37480890
Bug: 36812704
Change-Id: I8c13b6956083095dceaab3da6642bef1647d6a30
This reverts commit b2bdc8f17b
and fixes a broken Espresso test case.
Reason for revert: Rolling forward after fix in ag/2133493, to fix b/37324736
Bug: b/37324736
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java
Change-Id: I9cdf8cb1043af5d527eccbd9cc56d3b02419d7ac
If a user tells a device to forget a storage volume and then
goes back to the PrivateVolumeForget activity from their Recents, it
attempts to re-initialize itself with a volume that it forgot.
And this makes Settings crash.
By gracefully killing the activity when we try to open
PrivateVolumeForget for a forgotten volume, we avoid this crash.
Change-Id: Ib4e881c10f0c872ce6b268b16a573960230ef99b
Fixes: 34856304
Test: Settings unit test
This crash occurs because, even if you finish an Activity during
onCreate, the other lifecycle methods occur. In this case,
onActivityCreated assumes that onCreate ran properly.
By exiting early from onActivityCreated, we can ensure the activity
is finished properly.
Change-Id: Ia354341bf82d295c7dd042668fb11d588ddfebc0
Fixes: 37334861
Test: Instrumentation test
Bug: 35356645
Test: Verify for both config_nightDisplayAvailable true and false,
adb shell am instrument -e class
com.android.settings.display.NightDisplayTest -w
com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
Change-Id: I7de3eddf62428d75bef621d3387fa33a76205fe7
It may crash if opened during the uninstall of an app. By catching
the exception which may occur, we can just skip the uninstalled app
and avoid crashing.
Change-Id: I1b96b0697f4041be356260d6c675593affc1cb69
Merged-In: If556db7b5a299ba53a29baefbbe9709ba6d12190
Fixes: 36793223
Fixes: 36793372
Test: Settings unit test
It may crash if opened during the uninstall of an app. By catching
the exception which may occur, we can just skip the uninstalled app
and avoid crashing.
Change-Id: If556db7b5a299ba53a29baefbbe9709ba6d12190
Fixes: 36793223
Fixes: 36793372
Test: Settings unit test
The recent upgrade to Mockito 2.7.13 has caused some problems
for grok (and new javac toolchain). The changed files used
wildcard imports to import the same methods from both Matchers
and Mockito.
This was not a problem previously because in the previous
version of Mockito the Mockito class extended the Matchers class
and so even though two methods with the same name were imported
they were not treated as a conflict because they were treated as
being the same method. In 2.7.13 the Mockito class no longer
extends the Matchers class instead they both extend the
ArgumentMatchers class and so for some reason javac no longer
treats them as the same method.
This was not detected by presubmit builds because jack is
still treating the methods as being the same.
Bug: 32912773
Test: m -j32 ANDROID_FORCE_JACK_ENABLED=disabled FrameworksWifiTests
Change-Id: I8c2b1dd39d2d653fe0fba19ed6421b7de25bb82f