Commit Graph

71 Commits

Author SHA1 Message Date
Daniel Nishi
dfed8a2acb Add support for visualizing secondary users.
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
2017-02-21 12:07:23 -08:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08:00
Daniel Nishi
31027dae93 Add a music apps view to the Storage Settings.
When you tap the Music & Audio preference, it takes you a
hybridized applications view. In this view, there also is
a line item which defines the amount of storage used by
audio files on the device. Using the new storage query, we
can add this information very quickly to the view.

Bug: 33199077
Test: Settings robo tests
Change-Id: If51cba0b3de20805543a39049367eb13613081e7
2017-01-25 11:56:02 -08:00
Daniel Nishi
985bb59879 Remove the LOGV guard from the categorization log statement.
Because this activity is not used too frequently, removing the
guard will allow us to collect data w/o being too verbose.

Bug: 32914999
Test: Manual
Change-Id: Iccd2cabe0c77533c0f62eaf202738529b135979c
2017-01-04 16:45:26 -08:00
Fan Zhang
ac81f26e30 Align more prefs for icon space.
Bug: 33775510
Fixes: 33798492
Test: Visual
Test: RunSettingsRoboTests

Change-Id: I9b296e4148be8c1ae537b6418b4f384bbc63a8db
2016-12-21 11:20:24 -08:00
Fan Zhang
8af4c10476 Revert "Align more prefs for icon space."
Bug: 33798492
This reverts commit ded9fc9b07.

Change-Id: I9831858ffda263496617dff29249e243c007fa12
2016-12-21 17:03:00 +00:00
Fan Zhang
ded9fc9b07 Align more prefs for icon space.
- Extend preference_category to support summary text
- Removed work_profile_category, used by account list
- align prefs in storage settings
- Use Preference instead of PrefScreen in xmls
- Use proper footer preference in NightDisplaySettings, BatterySaver,
  DataSaver, AutomaticStorageManage
- Remove WallOfTextPreference

Bug: 33775510
Test: visual
Change-Id: I28156b857ff5acac8746c42384dc03d5997ebd9d
2016-12-20 13:24:31 -08:00
Jeff Sharkey
52aa9fb170 Always show at least 1% when some space used.
Don't let the progress value round down to 0, since that would
be misleading.

Test: builds
Bug: 24017703
Change-Id: I6a0268361645da16af67e12bf7f6823d027dd72c
2016-11-15 15:17:31 -07:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Garfield Tan
dbd039a6de resolve merge conflicts of af840b5 to master
Change-Id: I8a31d08dae71d5cb71ae01c06ead4ebf32f89121
2016-09-29 18:08:25 -07:00
Garfield Tan
493bf348b9 Launch other info in storage in correct user id.
Bug: 31592290
Change-Id: I816668c7ff9d1b443d4b49e17bdcfa39ef335aee
2016-09-29 14:45:50 -07:00
TreeHugger Robot
295f5a03bc Merge "Add visibility metrics to dialogs." 2016-09-20 15:55:41 +00:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -07:00
Daniel Nishi
c0b33f70ed Use a config flag instead of a RO flag for showing Manage Storage.
Bug: 30455784
Test: make SettingsTests; run the instrumentation.
Change-Id: I860192c1c20fcaec2a5cbcdc085ff01dafa7351a
(cherry picked from commit 7f075a3c41)
2016-09-19 20:39:33 +00:00
Daniel Nishi
7f075a3c41 Use a config flag instead of a RO flag for showing Manage Storage.
Bug: 30455784
Test: make SettingsTests; run the instrumentation.
Change-Id: I860192c1c20fcaec2a5cbcdc085ff01dafa7351a
2016-09-16 15:56:47 -07:00
Felipe Leme
3b0a9cb54f Improved storage accounting: am: 7358b7802f am: 49260969b7
am: 1469dde1a0

Change-Id: I2cb0e03aab3c79bde080ea3b73a1ad31c72d5cfa
2016-09-13 21:35:33 +00:00
Felipe Leme
7358b7802f Improved storage accounting:
- Removed duplicated entry for DIRECTORY_MOVIES.
- Added DIRECTORY_DOWNLOADS to Other.
- Added unaccounted data to Other.
- Changed Other description so it mention non-visible items.

Often sub-directories of /data are populated with data that Settings
doesn't have control of (for example, on /data/ramdump), so they're more
suitable to be displayed in the "Other" section.

BUG: 31091863
Fixes: 30952263

Change-Id: Ibf54f9dd96456575109e2e281f3780da84f70d92
2016-09-13 10:49:34 -07:00
Felipe Leme
b152113898 Only display System section for current user. am: ce37ef51aa am: 0547440ad7
am: 3d9cb084e9

Change-Id: I5b210e644b2fcdeaa7611a373ab2dbed5db89cd2
2016-08-31 01:19:28 +00:00
Felipe Leme
ce37ef51aa Only display System section for current user.
Otherwise it will be displayed twice on work profiles.

Change-Id: Ic7d21a57f72b9f4a254d574adce90afd7cd27b90
Test: manual verification
Fixes: 31108318
2016-08-30 12:00:27 -07:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Daniel Nishi
bf8f896879 Update the deletion helper intent string.
Bug: 28675265
Change-Id: Ic56e1617d0cf66e347c3a9b31592de4737b19bb3
2016-06-21 16:06:12 -07:00
Daniel Nishi
aad643caf2 Remove the Deletion Helper and Automatic Storage Management jobs.
The automatic storage management settings have been left in place
and updated to use the intent to get into the deletion helper.

Bug: 28965462
Change-Id: I736c8e741b519eceb89075b74d42b38c3aa5d0f4
2016-06-21 10:00:52 -07:00
Daniel Nishi
0074855229 Show storage manager settings using a system property.
This removes a Settings-only configuration on whether or not the
storage manager is enabled and replaced it with a system property.

Bug: 29336081
Change-Id: I2328c213f5f11f89bf0fe61e77d3062459036fc3
2016-06-15 11:01:58 -07:00
Felipe Leme
ff162a3c23 Display total storage for Internal shared storage.
Prior to this change, Settings was using
volume.getPath().getTotalBytes() to calculate the total, which includes
the user-accessible storage, but not the internal partitions. As such,
the total displayed was often missing many GBs (for example, in a 32GB
device, it could display "12.09GB of 25.01GB used".

This change fix this problem by using the total size and creating a
"System" section containing the "missing" storage.

BUG: 24128505

Change-Id: Ic35cd7c8406eff16ac1d97c4b4c233ecde64a6e1

** Cherrypicked from master - DO NOT MERGE **
2016-06-08 14:49:32 +00:00
Daniel Nishi
728eebe3c0 Hide the Deletion Helper entry points from Settings.
Remove the menu item which enters the Deletion Helper fragment.
The deletion helper can still be accessed if storage management is
enabled in the storage management settings.

Bug: 28967987
Change-Id: Iff4730998edbab5889b2b8e23b6ad260ae0c0359
2016-05-26 11:14:07 -07:00
Daniel Nishi
ba03d2ff21 Update the storage manager settings to match the mocks.
Bug: 28560570
Change-Id: I0f218da1d23b687e38c52b5a927f7b84645958c7
2016-05-23 13:27:30 -07:00
Daniel Nishi
0216e9dc2e Add an upsell dialog to activate the storage manager.
After a manual clear, the user will be prompted to turn
on the storage manager, if it is turned off. The prompt
will only show up after certain defined delay times and
stop showing up entirely if denied enough times.

Currently, the dialog does not actually turn on the storage
manager because the storage manager is not yet landed.

Bug: 28801159

Change-Id: I3c221786d08a7102b3b5357416ab12692d1894cf
2016-05-18 09:25:38 -07:00
Daniel Nishi
116a55cdab Add the automatic storage manager settings.
This provides a toggle for changing if the storage manager
is turned on or off and how many days of data to retain.

It is currently not hooked up to anything currently and only acts as
the view, pending b/28600825.

Bug: 28560570
Change-Id: Iaa2d819f26addab4dc02ced80e9ba79e0fcf0980
2016-05-17 09:32:12 -07:00
Felipe Leme
23c69bb59f Merge "Fixed calls to update() when configuration changed." into nyc-dev
am: f4f2211b13

* commit 'f4f2211b1364422abec41e056af77c03247c3f4e':
  Fixed calls to update() when configuration changed.

Change-Id: Ia35d89560fe2dd51d1c0dc8da3d1209c2cb03622
2016-05-13 17:44:41 +00:00
Felipe Leme
6ebd561960 Fixed calls to update() when configuration changed.
update() is an expensive operation and should only be called
once under normal circumstances (it still needs to be called due to external changes). In particular, it should not be called again on orientation changes.

The first approach to solve the orientation change caused the volume title to not be shown when the screen changed on multi window environments; the fix for title issue caused the update to be called again on configuration changes.

This change properly fixes both issues by removing the onAttach() / onDetach() methods and using a clearer variable (mNeedsUpdate) to avoid future regressions.

BUG: 24508289
BUG: 27989238
Change-Id: I140f5a541cda293f1c476d3b80a5bc8918e18b08
2016-05-12 14:43:35 -07:00
Daniel Nishi
b84304d4e6 Add a deletion helper view for clearing space.
This view provides an interface which allows users to clear out
apps and other data which they may no longer need to alleviate
storage pressure. This implementation gives the bits to uninstall
apps which have not been used within the last 60 days from the
system.

A future patch will add in the ability to extend the deletion helper
view to have additional clearing types.

Change-Id: I65cba54ca247d52227e67e2fa9b84fe63fb8ab34
(cherry picked from commit a671272bf6)
2016-04-21 10:20:58 -07:00
Jason Monk
f3446f98d5 Fix storage title clearing in multi-window
By accurately tracking detached state.

Change-Id: If9d60000f7737c834afde680d15a2af21f7e3165
Fixes: 27989238
2016-04-20 13:05:45 -04:00
Suprabh Shukla
3f4ac54c77 Clearing cache for managed profile apps
Added code to loop over all the child profiles and delete application
cache files for them, when clearing cache from Settings->Storage

Bug: b/25338468
Change-Id: I87dba56218402be44b71a009e93b2e93f48a574c
2016-04-12 16:47:08 -07:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Ben Kwa
0c851297b4 Rename ACTION_BROWSE_DOCUMENT_ROOT -> ACTION_BROWSE
BUG=23137963

Change-Id: I32e995b4421de4c90faa4e80a095c7df2f7aee25
2015-11-18 09:41:38 -08:00
Felipe Leme
dc4dbbdb49 Set key when Explore preference is created, otherwise tapping it will cause a NPE.
BUG: 25597961

Change-Id: I1e2fc8caa961e1054472b46cbeb6aad407a1f91a
2015-11-09 15:52:32 -08:00
Felipe Leme
157ec2f09a Change workflow so update() is not called when the device changes orientation.
BUG: 24508289

Change-Id: I7929aac953741a19f5bc4ffbbb9929a9a2f6104e
2015-11-04 14:27:04 -08:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Jeff Sharkey
edf038205e am a334d530: am b38493cc: am b0f9e9d4: am 82fee7bd: am b4158f0e: Merge "Only offer migration between private volumes." into mnc-dev
* commit 'a334d53025fbbf187f5aad5abf61091f9c994e01':
  Only offer migration between private volumes.
2015-08-14 21:12:58 +00:00
Jeff Sharkey
6f52ed3332 Only offer migration between private volumes.
Without this change, there is a confusing option to migrate a public
SD card volume to internal storage, which will always fail if the
user picks it, since it's not supported under the hood.

Bug: 22966671
Change-Id: Id7cad07eea6583aace398a6d64383bf7d884ae9e
2015-08-14 09:46:03 -07:00
Jeff Sharkey
c9a811619b am 31566703: am 600cfe2f: am a61c803e: am 7f3026c3: am bb9d6b90: Merge "Refresh after clearing, tweak warn threshold." into mnc-dev
* commit '3156670323c2c909a05215c464181db44abbe991':
  Refresh after clearing, tweak warn threshold.
2015-07-30 19:59:20 +00:00
Jeff Sharkey
f99b424f3b Refresh after clearing, tweak warn threshold.
Refresh UI after clearing cache.  Hide user header on single-user
devices to match UX spec.  Refine adopted storage warning threshold
based on experiments with various devices.

For example, a typical internal storage device runs the benchmark
in about 600ms.  Very fast SD cards take about 1700ms, moderate speed
SD cards take about 3800ms, and slow SD cards take about 6800ms.

Bug: 22345902, 22487370
Change-Id: I6066f3b78dbb32277ae94b79e325500724f83c7e
2015-07-30 11:51:47 -07:00
Jason Monk
02da7d3b11 am 64570b2b: am 06e549fa: am eb37daff: am b6cb215c: am cd075edf: Merge "Fix Help menu for PrivateVolumeSettings" into mnc-dev
* commit '64570b2b70afecad5936f6a39c09023ff6c1a625':
  Fix Help menu for PrivateVolumeSettings
2015-07-15 16:04:57 +00:00
Jason Monk
f05248f88f Fix Help menu for PrivateVolumeSettings
Call super.onCreateOptionsMenu so that the auto help stuff can
work properly.

Bug: 22202745
Change-Id: Iee6b4a81574c7e981290465a78641f3c5b06c143
2015-07-14 15:00:22 -04:00
Zoltan Szatmary-Ban
25b3876b19 am ba79dc4d: am 0998e03a: am e4e52064: am c968c407: am 098c296d: Merge "Do not throw exception when MeasurementDetails.mediaSize is empty" into mnc-dev
* commit 'ba79dc4d32e6fb909732b04b9cec562aa4a762da':
  Do not throw exception when MeasurementDetails.mediaSize is empty
2015-07-14 16:42:04 +00:00
Zoltan Szatmary-Ban
098c296df2 Merge "Do not throw exception when MeasurementDetails.mediaSize is empty" into mnc-dev 2015-07-13 13:09:54 +00:00
Zoltan Szatmary-Ban
706e7014d8 Do not throw exception when MeasurementDetails.mediaSize is empty
It is legitimate for StorageMeasurement.measureExactStorage to return without any user keys
added to the returned MeasurementDetails, when the following is true:

mVolume == null || !mVolume.isMountedReadable()

Bug: 22394495
Change-Id: Ie40bd468a487208d98dc56aae41fdad7098f41a5
2015-07-13 12:37:31 +01:00
Zoltan Szatmary-Ban
b211a5d2b9 am e14e92a2: am 4dc5b67c: am b8254212: am 325ba385: am 4bbe3d1f: Update all shown preferences in Settings > Storage
* commit 'e14e92a2ceac5827e35aa62ba6a82d3f87300d50':
  Update all shown preferences in Settings > Storage
2015-07-09 16:07:29 +00:00
Zoltan Szatmary-Ban
4bbe3d1fb6 Update all shown preferences in Settings > Storage
This is achieved by iterating through the pool of StorageItemPreferences up
to the index of the last shown one, instead of iterating through the
preferences of the screen which may miss preferences inside other top-level
preference groups.

Bug: 22353561
Change-Id: I2293a7949a5becfb506d6b7965f8db2f11845756
2015-07-09 15:37:26 +01:00
Zoltan Szatmary-Ban
df57fa52ab resolved conflicts for merge of 8eade69d to master
Change-Id: Id2a2269b506c2ffa06dcfd3a02b32eced5e7632b
2015-07-08 16:05:49 +01:00