OSDN Git Service

Cache storage values for fast loading.
authorDaniel Nishi <dhnishi@google.com>
Thu, 10 Aug 2017 21:09:19 +0000 (14:09 -0700)
committerDaniel Nishi <dhnishi@google.com>
Tue, 5 Sep 2017 21:46:14 +0000 (14:46 -0700)
commitfb302de0d649eae3d86aa842680d69125239502f
tree03444fda0a64d6d1cd7e581ed52059a58e0e100a
parentd57edb708fcd1e50af1f6833b717bf0bbb53334f
Cache storage values for fast loading.

If the user moves away from the storage fragment and returns, this
allows us to use cached data from the previous calculation. If the data
is > 1 minute old, we consider it stale. Otherwise, we can bypass the
loading screen.

Fixes: 37923463
Test: Settings Robotest

Change-Id: I7650d4d742852f8d447878c077b9190bc0a0bb22
src/com/android/settings/deviceinfo/StorageDashboardFragment.java
src/com/android/settings/deviceinfo/storage/CachedStorageValuesHelper.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/deviceinfo/StorageDashboardFragmentTest.java
tests/robotests/src/com/android/settings/deviceinfo/storage/CachedStorageValuesHelperTest.java [new file with mode: 0644]