StorageStatsManager fixed in StorageStatsService#getTotalBytes
So that we should change back to call the API.
Bug: 295358118
Bug: 288103116
Test: verified manually
Change-Id: I3dcc9698403612f961cf0de41925dcbcb43e260b
(cherry picked from commit 2d57d002ae)
Since StorageManager rounded the totalBytes of device storage but
they don't do that rounding for freeBytes.
So in some cases the freeBytes can be greater than totalBytes.
We propose to get totalBytes of device storage directly to calculate
correct privateUsedBytes.
Test: robotest
Bug: 281955532
Change-Id: I4f137c20e7c2f54f4e037d50e81b3176edc1a83a
(cherry picked from commit e52320e755)
SettingsPreferenceFragment#setLoading(boolean loading, boolean animate)
shows loading animation when 'animate' parameter is true.
This change sets 'animate' parameter false to fix this issue.
Bug: 254003456
Test: manual visual
Settings -> Storage -> Free up space -> back
then see if loading animation shows.
Change-Id: Ic804bcf950a9c57297ccefd6e942edea0b792a3b
Open Settings, then open Storage , plug in USB OTG with Disk, select Disk, open Files, play a video, press the back key, hot plug out USB OTG, the IndexOutOfBoundsException will happen
The root cause is when received the onVolumeStateChanged in StorageEventListener in StorageDashboardFragment, the volumeInfo
status is VolumeInfo.STATE_UNMOUNTED or VolumeInfo.STATE_EJECTING, mSelectedStorageEntry set to changedStorageEntry, cause the fail.
This is a fix for CL 225095144 bug.
Bug: 247737688
Test: Manual
Change-Id: I9535c49d65c42a8dfa8ccf4e271ae973d944d4b9
Before this change, USB flash drive is removed from storage spinner
when it's unmounted (by option menu 'Eject'), however, USB flash
drive will show in storage spinner when Storage Settings page is
resumed again.
After this change, USB flash drive will show in storage spinner
even if it's unmounted. It will be removed until it's unplugged
from device.
Bug: 225095144
Test: manual visual
Insert / Eject / Mount / unplug an USB flash drive and
observe UI behavior.
Change-Id: I6b81766216c7850b018997f2de12a19d9d8675be
Storage view is white and cannot show any info while plug in/out u disk because the visibility of list view is gone.
This visibility is set when StorageDashboardFragment.java sets loading using API setLoading.
In error condition setloading was not called due to conditional statement.
After removing the conditional statement, it sets loading through which visibility of the list view is set to VISIBLE.
1. Enter Settings->Storage
2. Plug in U-disk, storage view will start updating
3. During storage view updating, plug out U-disk(before phone recognized and show U-disk)
Fix:
Bug:
Test:
Change-Id: Id7350909b614bbe9264910cab3cdeca616544618
CR-Id:
Feature:
- Get badged icon from target app.
- Add card_preference layout file to align icon & text
with other Preference.
Bug: 192555970
Test: manual visual
Change-Id: Id98d05e8871032ad61627783b8e47bfee1363448
To prevent from the flicker happening, the size info for secondary users
will be cached.
Bug: 220259287
Test: manual test
1) Create secondary user
2) Finish setup flow
3) Install any types of apps and try to change the storage size
4) Navigate to Settings > Storage
5) Observe the storage size and progress bar, they should have animation
when storage size info updated.
Change-Id: Iff706b20446603f08334a0b782dd505ca78bdab2
- Use SharedPreference to cache the size info
- Improve the flicker problem on Documents & other preference
- The jobs are destroied on onPause to prevent the jobs being
restarting when back to Storage page
- Enable progress bar animation for each storage item
Bug: 191117970
Test: manual test
1) The loading spinner will be shown when entering Storage page
at first time.
2) Back to Settings homepage and switch back to Storage page, the
loading spinner shouldn't be shown.
3) Click each preference in the Storage page and switch between these
pages, the size info should be updated if something removed and the
order of preference shouldn't be changed.
Change-Id: I75533742a025dc61116207285a894ee728d0af68
Merged-In: I75533742a025dc61116207285a894ee728d0af68
(cherry picked from commit 77775a66f2)
Uses Intent.FLAG_ACTIVITY_NEW_TASK to start the Activity
and it will shows in different Activity stack.
Then it shows full screen 'Free up space' for different
Activity stack.
Bug: 197703552
Test: manual
Storage -> click 'Free up space'
Change-Id: I8ce16aa23438424d4990171449884755e36cf21d
The EntityHeaderController is a workaround to fix header
shadow, however, the header shadow does not exist and it's
safe to remove the EntityHeaderController.
Bug: 183078080
Test: manual visual
Change-Id: I5197ec62edbe7ab3ff981895ec7ff267caeb9448
To hide sorting animation.
- Storage Settings always loads cache and updates UI, then
loads storage size and updates UI.
Remove the chche design because storage category preferences
will hide during loading, it no meaning to load from cache
and update UI.
- Hides loading circle before storage category preferences
become visible, it prevents flickers.
- Remove Calculating... summary of StorageItemPreference.
- Private storage category preferences and secondary user
preference become visible at
StorageItemPreferenceController#onLoadFinished.
Bug: 188731179
Bug: 185547228
Bug: 188615591
Test: atest com.android.settings.deviceinfo
atest com.android.settings.deviceinfo.storage
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage
manual visual
Change-Id: I3ebef5829ef4f806add07f58fa02520804768be5
This change remove unnecessary UI dpdate of
StorageItemPreferenceController.
- For StorageItemPreferenceController:
Remove UI update at #displayPreference since onLoadFinished will update.
Don't update order at #setVolume since onLoadFinished will update.
- StorageDashboardFragment & StorageCategoryFragment update
StorageItemPreferenceController only when both StorageInfo
and StorageResult are loaded.
Bug: 185547228
Test: atest com.android.settings.deviceinfo
atest com.android.settings.deviceinfo.storage
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage
manual visual
Click each file category to count files size is the same as
displayed in Storage Settings.
manual visual
Change-Id: Id449003827a3e340e7a90f706152100b5568f834
From android S, Storage Settings show files of images/videos/audios
category instead of installed APP of each category. So it's
necessary to change the way to calculate size information.
This change also
- StorageItemPreference shows changing storage size units instead
of fixed GB. It helps UX for categories of only small size files.
- Query media provider for size of Documents and others.
- Query media provider for size of Trash.
Bug: 170918505
Bug: 177892478
Bug: 179871408
Bug: 184379946
Bug: 186077224
Bug: 187128447
Test: atest com.android.settings.deviceinfo
atest com.android.settings.deviceinfo.storage
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage
manual visual
Click each file category to count files size is the same as
displayed in Storage Settings.
Change-Id: I37c7b3a4b5860323cb55581b23a90f583f4af216
In this change, Storage Settings main UI is composed by 3 fragments.
StorageDashboardFragment only shows when there is only personal profile for
current user.
ProfileSelectStorageFragment (controls preferences above profile tab) and
StorageDashboardNoHeaderFragment (controls preferences below profile tab)
only show when current user has installed work profile.
Bug: 174964885
Test: atest com.android.settings.deviceinfo
atest com.android.settings.deviceinfo.storage
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage
Change-Id: I50dea2fbcae39a1488e648f3ca615f54840e19d5
- StorageDashboardFragment and StorageItemPreferenceController works only
for one profile per instance.
- StorageAsyncLoader loads for all users(profiles) and regards each user independent.
- SecondaryUserController will not load personal profile user in work profile tab.
- Cleanup some unused profile related files.
Bug: 174964885
Test: atest com.android.settings.deviceinfo
atest com.android.settings.deviceinfo.storage
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage
Change-Id: I8361c29bc240c519c7261b19522c41439479c1c2
Merged-In: I8361c29bc240c519c7261b19522c41439479c1c2
Since some pages were styling the action bar programmatically before, the
color of collapsing toolbar will be overridden. Removing them will fix
the problem with inconsist color. This change also fixed some pages with
inconsist theme.
Bug: 185444608
Test: visual verified
1) Settings -> Battery / Storage
2) Scrolling the collapsing toolbar and make it collapsed
3) Observe and see if the color of toolbar is different from the one of
status bar
Change-Id: I5e792747ea3f4deb05428ea5afe6a64f29f9da89
Users can click this preference to see public storage files
in external file browsers.
Bug: 170918505
Test: make RunSettingsRoboTests ROBOTEST_FILTER=StorageItemPreferenceControllerTest
manual
Select private storage and public storage and observe UI
Change-Id: If3f0d59b2ebf941d70e81e60c4c2015b80e7cf33
Hide it because there is no framework API to get storage
category stats of public volumes.
Bug: 174964885
Test: manual
Observe storage settings UI of a USB flash drive.
Change-Id: I7272cd18c186793f86548a87b5cb88bb957ff8d5
1. Add new object StorageEntry to encapsulate VolumeInfo and
unsupported DiskInfo and missing VolumeRecord.
2. Replaces StorageSummaryDonutPreference with UsageProgressBarPreference.
3. Add storage select spinner.
4. Add a "Free up storage" preference to replace "Manage storage" button.
Bug: 174964885
Test: atest com.android.settings.deviceinfo.storage
atest com.android.settings.deviceinfo
manual
Insert an USB drive, select the drive in StorageDashboardFragment
and observe UI.
Change-Id: I83877f76869414de4fb2788b6b18fe507aa5cfcf
Merged-In: I83877f76869414de4fb2788b6b18fe507aa5cfcf
- Modify ProfileSelectFragment to support add preference xml in the
top, and tabLayout below the preferences. Base preference layout is
dummy_preference_screen.xml which contains no preference.
ProfileSelectStorageFragment contains StorageSummaryDonutPreference
above the tabLayout.
- Make StorageSummaryDonutPreferenceController self workable without
StorageDashboardFragment dependence.
- Rename inactive_apps.xml to dummy_preference_screen.xml
- Move ShadowPrivateStorageInfo from LowStorageSliceTest
Bug: 141601408
Test: manual
Change-Id: Ide12840dc81bb104f328e230ecda5d35bba01d7a
initLoader will reuse the old loader associated with fragment.
But the fragment is destroyed. Use restartLoader which will
create another loader with new fragment.
Fixes: 143445993
Test: rebuild
Change-Id: I0a8a00ae94122f25d6d860b2512108ecd11d7806
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId
Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function
Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
StorageAsyncLoader is the bottleneck. It needs to loop all installed
apps and count all apps size. Original design was waiting the
asyncLoader went back then hide the loading icon. Change the design
to hide the loading icon before asyncLoader is back.
Fixes: 138964123
Test: manual
Change-Id: I54c2efa7cf61d711145811619512d927adcee210
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
This patch focused on fixing compile errors and some runtime errors.
Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
Replace all SettingsLib/PackageManagerWrapper in Settings,
by PackageManager,
Remove ShadowPackageManagerWrapper.
Bug: 62067063
Test: make RunSettingsRoboTests
Change-Id: I6d1af55c13d80c1907b98b21e0207cc903cd9b1f
use EntityHeaderController.styleActionBar to apply the entity header
effect which will not show shadow under the app bar unless it starts to
scroll.
Bug: 71767969
Test: manual test
Change-Id: Iffd94db956d50b8985cfa5df3886acd3b766fd0c
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936
Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
To getPreferenceControllers. "all" is redundant. Then internally, the
old getPreferenceControllers() is renamed to
createPreferenceControllers() to emphasize the controllers are created
from code (versus the ones created from xml).
Bug: 73668763
Test: robotest
Change-Id: Ifec46aefdc2a418031c8e152028b30bdcd396fc7
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.
Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.
Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
Pre-quota devices can take an absurd time to load. By loading the screen
once the volume sizes load, we can just show "calculating..." for a
really long time instead of a loading screen.
Change-Id: Id8ab0609c2bc19531d530c6bdf6bff89c5bfac96
Fixes: 64150148
Test: Settings Robotest
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