Commit Graph

300 Commits

Author SHA1 Message Date
Jeff Sharkey
77fe8c1e9e Consistent "low storage" behavior.
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
2017-05-30 23:51:06 -06:00
Daniel Nishi
4fcb5f6b7c Merge "Fix an override filter bug." into oc-dev am: 5cc0a122d3
am: 23c2cf1d68

Change-Id: I88545ebb5e3a1b05268b7485c0d7dc4323ff661f
2017-05-30 19:54:19 +00:00
Daniel Nishi
5d0888be75 Fix an override filter bug.
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
2017-05-25 14:23:29 -07:00
Phil Weaver
be39d57762 Merge "Follow O patterns for a11y settings" 2017-05-24 19:37:41 +00:00
Phil Weaver
ed5f0951f8 Follow O patterns for a11y settings
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
2017-05-24 10:35:20 -07:00
Matthew Fritze
2078bc2358 Remove search2 package and put everything into search
Change-Id: Ie8651c79ef023f154cd7120a88a20f3481abce2b
Fixes: 38502743
Test: make RunSettingsRoboTests
2017-05-23 13:57:28 -07:00
Fan Zhang
462d852808 Fix bug where app list says "No app" in multi-window mode
Move updateUi logic from onPause/onResume to onStop/onStart.

Change-Id: Iebe38d201d531058472cd033a0408239d36d32e4
Fix: 36305836
Test: instrumentation test
2017-05-18 14:37:09 -07:00
Maurice Lam
2eb170cd6f Clean up choose lock intent creation
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
2017-05-12 15:35:20 -07:00
Stephen Chen
41aa446c7f Merge "Added WifiSettings Espresso tests." into oc-dev am: 6c0f337d52
am: 95a98f0686

Change-Id: I03d14cabee02252e69ca0c5c0057489446866d4e
2017-05-08 23:45:32 +00:00
Stephen Chen
db332d4aa7 Added WifiSettings Espresso tests.
Added test cases for toggling Wi-Fi state, connected access points, and
saved network preferences.

Bug: 35322629
Bug: 35322690
Bug: 35322875
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/WifiSettingsUiTest.java

Change-Id: Iaba7fb2fa90cf0f37538c4b1ef141cf6b15d7f52
2017-05-08 14:48:01 -07:00
Daniel Nishi
31de4c1766 Merge "Fix a bug where override filter was always on." into oc-dev am: 408fd90102
am: 7d50d9db12

Change-Id: Ie9e9b3978e7a2f52fdd63e203a740068188dc285
2017-05-04 17:38:31 +00:00
Daniel Nishi
bf1f93698e Fix a bug where override filter was always on.
Change-Id: I1df52f13d8e335362d2eec18c968227ed9ecf299
Fixes: 37952170
Test: Settings unit test
2017-05-03 17:31:21 -07:00
Daniel Nishi
c90502627b Merge "Always use GB as the unit in Storage Settings." into oc-dev am: 833927929e
am: f917c0aa24

Change-Id: I632e27fe03241818447998464e1bdbfe96f4c6e5
2017-05-03 18:09:27 +00:00
Daniel Nishi
833927929e Merge "Always use GB as the unit in Storage Settings." into oc-dev 2017-05-03 18:00:19 +00:00
Daniel Nishi
cbeebe1b6c Merge "Filter on volume for category storage view." into oc-dev am: a41a190ac3
am: 854acc9e4b

Change-Id: I21c985df9ee34981b47c080756df5dc442f335b6
2017-05-02 17:09:37 +00:00
Daniel Nishi
a41a190ac3 Merge "Filter on volume for category storage view." into oc-dev 2017-05-02 17:03:36 +00:00
Jaekyun Seok
d427f4fef8 Merge "Do not show static overlays as a theme" into oc-dev am: 170acdb79b
am: 4a6781af1b

Change-Id: I2f4b1f9ab7e7947bb5c95aae7d7400113e4c266b
2017-05-02 01:24:29 +00:00
Daniel Nishi
5aeb6c4fab Filter on volume for category storage view.
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
2017-05-01 15:42:50 -07:00
Jaekyun Seok
ef85d880a5 Do not show static overlays as a theme
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
2017-05-02 06:18:48 +09:00
Daniel Sheng
b74914eff3 Fixed crash when opening Camera Lift suggestion
Bug: 37742959
Test: manual + make RunSettingsRoboTests +
      adb shell am instrument -w com.android.settings.tests.unit
          /android.support.test.runner.AndroidJUnitRunner

Added missing SettingsGateway entry for Camera Lift Trigger settings
fragment.

Change-Id: Iddce7a672b0bb8430e3c7b3c346788fb23970636
2017-05-01 11:07:34 -07:00
Sundeep Ghuman
4b49c11d87 Merge "Force update APs when enabling wifi in WifiSettings." into oc-dev am: 9797a39ad7
am: f292f23c0c

Change-Id: I5490aab1d5b4845f912c6fcefda76587e09366ea
2017-04-26 18:54:10 +00:00
Sundeep Ghuman
9797a39ad7 Merge "Force update APs when enabling wifi in WifiSettings." into oc-dev 2017-04-26 18:32:48 +00:00
Daniel Nishi
0f127e98e5 Merge "Don't crash on opening ejecting USB." into oc-dev am: 32f95292bf
am: 3803bb966d

Change-Id: Ie26202f072f11983f2f1883811585f77db40f84d
2017-04-26 17:05:59 +00:00
Daniel Nishi
32f95292bf Merge "Don't crash on opening ejecting USB." into oc-dev 2017-04-25 22:30:14 +00:00
Daniel Nishi
63a11c56de Always use GB as the unit in Storage Settings.
Bug: 36901322
Test: Settings unit tests

Change-Id: I08c711db6a271522942a01d1adf3e8e5223010f7
2017-04-25 15:23:49 -07:00
Sundeep Ghuman
87bf49a436 Force update APs when enabling wifi in WifiSettings.
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
2017-04-25 15:12:00 -07:00
Daniel Nishi
4a150e75fd Merge "Gracefully handle null volumes after forgetting." into oc-dev am: d6d6185167
am: 8f68658aef

Change-Id: I1033e51c837c9ed51e424435e8b49cac7eca51dc
2017-04-20 18:54:28 +00:00
Daniel Nishi
d6d6185167 Merge "Gracefully handle null volumes after forgetting." into oc-dev 2017-04-20 17:05:29 +00:00
Fan Zhang
8adcd2f441 Merge "Add test to verify regulatory info launches properly" into oc-dev am: 4766183336
am: 2bb10c9e57

Change-Id: I9d58c7ee1154c640e570627477e97ffaeb68777f
2017-04-19 01:54:40 +00:00
Daniel Nishi
6b37d6341f Gracefully handle null volumes after forgetting.
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
2017-04-18 14:59:20 -07:00
Fan Zhang
06ee0e932f Add test to verify regulatory info launches properly
Test: runtest --path tests/unit/src/com/android/settings/RegulatoryInfoDisplayActivityTest.java
Change-Id: I531a05bde858790819ac11c8ffcea2f6d1942ec2
Fix: 34370866
2017-04-18 12:53:24 -07:00
Daniel Nishi
edafa44c7e Don't crash on opening ejecting USB.
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
2017-04-18 12:19:36 -07:00
Jeff Sharkey
5d9ccedc59 Merge "Follow storage API polishing." into oc-dev am: e398a84199
am: 4ecbc32b48

Change-Id: Ie47474e46fa6ebfffdddad04ab8c99b332c4f8cc
2017-04-17 23:58:17 +00:00
Fan Zhang
b0c2ca7c07 Merge "Use standard preference layout for wallpaper picker" into oc-dev am: 8e1d588cdf
am: d96ce57713

Change-Id: I50bb90a53c74960465c73aafc8ae5ee0e8021b50
2017-04-17 22:33:08 +00:00
Christine Franks
8e1202b54e Merge "Add test for Settings#ACTION_NIGHT_DISPLAY_SETTINGS" into oc-dev am: c2d56691fe
am: f0320dd7aa

Change-Id: I7f4624486a8299c7e36b3eb97167795a2f5da380
2017-04-17 22:32:01 +00:00
Jeff Sharkey
e398a84199 Merge "Follow storage API polishing." into oc-dev 2017-04-17 22:26:44 +00:00
TreeHugger Robot
8e1d588cdf Merge "Use standard preference layout for wallpaper picker" into oc-dev 2017-04-17 21:10:31 +00:00
Jeff Sharkey
b80f1ddaf0 Follow storage API polishing.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 37325923, 35812899, 35806020
Change-Id: I4965b7391018354157f0683a643a14c5e9cd338d
2017-04-17 14:29:15 -06:00
Fan Zhang
1a4fea2b72 Use standard preference layout for wallpaper picker
Change-Id: I7c76a9af5e64af4ac8641227289a94ab00f923f2
Fix: 37351626
Test: visual
2017-04-17 12:23:52 -07:00
Christine Franks
c2d56691fe Merge "Add test for Settings#ACTION_NIGHT_DISPLAY_SETTINGS" into oc-dev 2017-04-17 18:30:27 +00:00
Christine Franks
66d59f8d38 Add test for Settings#ACTION_NIGHT_DISPLAY_SETTINGS
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
2017-04-17 09:47:26 -07:00
Daniel Nishi
95261b9239 Fix storage settings crash.
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
2017-04-13 13:21:26 -07:00
Daniel Nishi
89bec9c941 Fix storage settings crash.
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
2017-04-10 16:06:16 -07:00
Daniel Nishi
f588f7678d Add a movies & tv apps category to storage settings.
Change-Id: I055e93d2a151195b90a5fd64f4fddebbbcffef59
Merged-In: Idfabe83739272b19cbef4b13a82339170f8f97b3
Fixes: 36223441
Test: Settings Robotest
2017-04-06 13:36:12 -07:00
TreeHugger Robot
ab13d8990f Merge "Change test type from InstrumentationTest to AndroidJUnitTest" 2017-04-01 04:49:19 +00:00
Daniel Nishi
c2157ab443 Add a movies & tv apps category to storage settings.
Change-Id: Idfabe83739272b19cbef4b13a82339170f8f97b3
Fixes: 36223441
Test: Settings Robotest
2017-03-28 17:18:15 -07:00
Dan Shi
0322efaac4 Change test type from InstrumentationTest to AndroidJUnitTest
Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
Change-Id: Ib403ce00ed33de3a39534f84da2a679f244e7a1c
2017-03-22 23:33:31 -07:00
Dan Shi
41d96207e8 Add test config to SettingsUnitTests
Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
Change-Id: Ie9fdc4717a71cb0f472b004b704acf3c4f770267
2017-03-22 12:07:08 -07:00
Paul Duffin
6b58b5c9f7 Remove ambiguous wildcard import of org.mockito.Matchers.*
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
2017-03-17 13:10:03 +00:00
TreeHugger Robot
7c22d1f181 Merge "packages/apps/Settings: Add APCT tests to the device-tests suite." 2017-03-16 18:06:24 +00:00