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 bug resulted from the fact that turning off loading while loading is
turned off causes the loading finishing animation to flicker. By only
turning it off when it is on, we ensure it works.
Change-Id: Ia31bf3e9aa90726e39b6bc7189d175c38fb51e5a
Fixes: 38045492
Test: Manual
We were using a different calculation in the top level view compared to
within the Storage settings. Technically, both are correct (one of them
is aware that we're considering cache as free, one does not). This patch
aligns us on the cache as free strategy.
Change-Id: I9ac26683a4d2a30b77a1da534aa2ddd3d4da6657
Fixes: 37175551
Test: Settings robotest
As per storage discussions, the best way to calculate storage for the
System is to just take all known data and subtract it from the used
bytes. There is more to the system than just the /system partition and,
even if we ignore the partitions and use the underlying block device
method of calculating it, we run into the problem of it not adding up to
the actual device size.
Change-Id: I6e1f775ea3f3b8b2cc78d734623934651e2fb7b4
Fixes: 37166310
Test: Robotests
There were two issues that stopped the options menu from
showing properly. First, the SettingsPreferenceFragment did
not call its super class, causing the Lifecycle methods to
never be called. Second, the options menu was not being
invalidated which also stopped the Lifecycle methods from
being called.
Change-Id: I29f2fc105c7ecae7adaccb2e4643e48646398d8d
Fixes: 37255835
Test: Robotest
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
This icon is loaded in the background to avoid doing IO on
the main thread. Once we know there are more users and also
have the icon loaded, we add the category to the view.
Fixes: 36252572
Test: Robotest
Change-Id: Ib50287bb7ed323f22fbe407b56be1bf2fe98f121
Currently, users can use an SD card or USB drive and adopt it as
internal storage using existing flows. They can manage this drive
perfectly fine using the old storage screen, which is still around.
One functionality that was lost was the ability to migrate data from
the adopted drive back to the private internal storage. This appeared
in a dropdown in the old storage settings.
By duplicating the code to create just that specific menu item and its
click behavior, we can restore this functionality to the new storage
view.
Change-Id: Id0e01c560e7249acccfe86c5da44466dd58fe5d4
Merged-In: I4b8c06912d2c0b2c5be5bce8b217d45accf34d4b
Fixes: 35926028
Test: Settings Robotest
This re-adds the progress bar and unifies the
StorageItemPreference and its alternate.
Change-Id: Iefc12b4b554306c706c83be232175dd2b84227b7
Fixes: 36223433
Test: Settings robotest
Now, it is a master switch preference which can toggle the
automatic management on/off. This also removes the old
UI in the storage summary at the top.
Bug: 33199077
Test: SettingsRoboTests
Change-Id: I709fd2ca0687f760a5d97ad6bebe477b427b0464
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.
Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
This adds new preferences for each profile (such as the work
profile) and defines a new view for viewing the storage
breakdown for the individual profile. The functionality closely
mimics the presentation on the main view, but without the system-wide
breakdown and without any additional users/profiles.
Bug: 34715777
Test: Settings Robotests
Change-Id: I19d449b648c6566331fd02e45c2e45f8c74ea7e7
This functionality adds the secondary users to the screen, but
currently does not populate the information for them. Once the
external stats query works, I will add a loader which will
populate this information.
This also does not cover work profiles. Support for that is
forthcoming.
Bug: 34715777, 34225103
Test: Settings Robotest
Change-Id: Ib9b692b214f5ce5d303dfd64516381443d4acebd
Replaced the "Manage Storage" footer preference
with a regular preference because the footer type
is not meant to be a touch target. This should fix
the bug with not being able to click on specific
parts of the preference.
Test: run settings espresso tests
Bug: 34349518
Change-Id: I36ada2a6a537a68d9fcbe7e10773896225ecc6b2
This replaces the calculation of the apps category
and add in a calculation for the games category using
the faster GID calculation. This should result in app
sizes loading roughly 10 times after.
Bug: 34204877
Test: Settings unit & robo tests
Change-Id: I78044a8d50f695f8c0a7e04183030232a9719260
Use the centralized registry to look up category key instead.
Bug: 32936784
Test: make RunSettingsRoboTests -j40
Change-Id: I0b8c72d70f93e4b5c58871ac90de41f69ad15653
If the user entered the StorageDashboardFragment from search,
it would crash due to a precondition check added to the Storage
Manager. Because no volume id was set in the bundle for it to
check, it hits an assert that the volume id is not null causing
Settings to crash.
This sets a sensible default instead of null.
Bug: 34633464
Test: Manual. Entering through search does not crash now.
Change-Id: Ia6cd82929a0813eefcdad279436b9c2fe30b0146
This changes it to now have a donut graph and reflects the new UI.
Finalized redlines are still pending, so there will be a follow
up patch to get everything aligned as per the mocks.
Bug: 33199077
Test: Settings Robo Tests
Change-Id: Ic12a77bd9be335af14f80886d1ecc24c82940e9b
This uses the same storage query implementation as the previous
iteration of the Storage Settings. In b/32206268, a new API for
querying this information will be added for querying this info.
Once the new API has landed, a future patch will swap out the
impl, but this should work for today.
Bug: 33199077
Test: Settings Robo Tests
Change-Id: I58763e8ee38aabbea533bc614268288e854ff8d4
This currently imitates the previous implementation behavior.
The new mocks have a new intermediate view for some of these
behaviors, but this view isn't ready yet.
This patch should bring parity for the click functionality
for the storage line item preferences.
Bug: 33199077
Test: Settings Robo Tests
Change-Id: I4f654d30add92e4eec721c36b2801f9af9824e78
It previously was set to use the PrivateVolumeSettings. By
swapping it with the new view, we can retain the existing
behavior for external storage (PublicVolumeSettings).
This also restores the summary text to the main Settings
screen.
Bug: 34197071, 34195303
Test: Verified locally that StorageDashboardFragment is started
instead of the PrivateVolumeSettings.
Change-Id: I5de0ea8de799d758272a1406856ae7de9b6fcc8e
This patch begins setting up the structure for the screen.
The functionality for populating the data in the preferences
is coming in a later patch.
Bug: 33199077
Test: Settings Robo Tests
Change-Id: I9ebad9d3896501e31ac715704ca986eceb36877d
- Added a activity-alias pointing to displaySettings as top level
setting item.
- Refactored all preference logic in DisplaySettings into
PreferenceControllers. During fragment onAttach it installs all
controllers, and during onResume it updates preference state. Each
controller listens to its own preference change event.
Bug: 31800242
Test: RunSettingsRoboTests
Change-Id: Ibc9bf200c5acce7c4ae9292340822afee27a3a28
- Make a SummaryConsumer interface. Things that needs latest summary
should implement this interface (DashboardAdapter for homepage,
DashboardFragment for subsettings). This also decouples SummaryLoader
from relying on SettingsDrawerActivity.
- Make DashboardFeatureProvider more generic to load DashboardCategory
by key.
Bug: 31781480
Test: RunSettingsRoboTests
Change-Id: I9c65456fb433a74c352498251e0ccf65da0be1f0
Merged refreshAllPreferences into DashboardFragment. This hopefully
makes it more modular to manage preference display logic in each
dashboardFragment, and makes it more efficient to monitor category
changes.
Now subclasses needs to implement 2 methods:
- displayResourceTiles(): for 'static' preferences from xml
- getDashboardTiles(): returns a list of dashboard tiles and superclass
will wire it up to preference screen.
If getDashboardTiles() return null (aka no dashboardCategory available),
the fragment will not attempt to monitor category change. The edge case
is that if a package starts to provide a tile for this category, we will
not be notified. I have not seen this case coming up. If we indeed need
to handle this case, the category listener needs to have a way to
monitor specific category rather than globally.
Bug: 31781480
Test: make RunSettingsRoboTests -j40
Change-Id: Ia9f9541b95816214df0d0bb27e3e41078c36c5ca