OSDN Git Service

Re-init storage size on resume.
authorDaniel Nishi <dhnishi@google.com>
Tue, 15 Aug 2017 22:29:45 +0000 (15:29 -0700)
committerDaniel Nishi <dhnishi@google.com>
Tue, 15 Aug 2017 22:32:09 +0000 (15:32 -0700)
commit1533c85ade2d71176dd8b8024d2059f593b4cb39
tree4cc658e06e1d32a9784ada64196082ebfd4a1ac7
parent858ea46a3a7c5e052db9dc1e66b7c0cc58f0f325
Re-init storage size on resume.

In Storage settings, we used to cache the sizes of the volume that we
were observing. This meant that we cached the free and total sizes. If a
large amount of data is cleared in another app and we resume the
Settings app, however, it will result in a large change in free space.

Because we calculate the categorization breakdown again on resume, this
causes most of the categories to reflect the current size.
Unfortunately, the free size is stale. This means that the amount of
data deleted gets attributed to system, instead of to nothing at all.

By restarting the loader to fetch the free/total size of the volume, we
can avoid this issue.

Change-Id: I07b244f02230d28a58fcb70d8d9cd595f2a0f68f
Fixes: 64135242
Test: Manual
src/com/android/settings/deviceinfo/StorageDashboardFragment.java