Commit Graph

41 Commits

Author SHA1 Message Date
Daniel Nishi
1ee13fd386 Update the automatic storage management preferences.
This updates this page to match the newer mocks. The changes
include:

* Changing the toggle from a switch to a switch bar.
* Removing the Deletion Helper flow from the screen.
* Unit testing the previously untested functionality.

Change-Id: I35eb1e065c9acfbf32a64d659d35e18034025472
Fixes: 36486021
Test: Robotest
2017-04-03 13:05:08 -07:00
Daniel Nishi
abd92e0519 Update the Manage Storage preference.
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
2017-03-08 10:18:43 -08:00
Daniel Nishi
99228286a4 Remove Downloads backup options.
Bug: 32338407
Test: Manual -- Downloads was added before we really started adding
tests.

Change-Id: Ifd8b3dcd42e7c5c4017bdbc7e6aedcab653f216d
2017-02-07 16:57:04 -08: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
Daniel Nishi
a2e0824b26 resolve merge conflicts of a4e3842 to master
Change-Id: Ia52171f3cfa0bcb73c6a4d23122ef8ad9025e807
2016-09-28 13:20:27 -07:00
Daniel Nishi
116b95666f Add a warning message to the ASM toggle.
This trigger fires if ASM is not enabled by default for
the device and the toggle is only visible if the ASM visible
flag is enabled.

Bug: 30455784
Change-Id: Id6adf8a75dbd4290f042d743689a75f496efb0c9
2016-09-27 17:46:52 -07:00
Fan Zhang
5b9762bc09 Use MetricsFeatureProvider in storage manager fragment.
Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: I65743b87fdf6f010e40ca705e33e18642e0bfca3
2016-09-22 10:26:10 -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
Jorge Gil
6f44493338 Add switch to enable downloads backup.
Bug: 30503075
Change-Id: I011d88d16ab8677b63b73e059f0edf823cc82389
2016-08-08 21:11:27 -07:00
Daniel Nishi
4a184d4360 Add a dropdown for changing the days of retained downloads.
Bug: 30304998
Change-Id: I3113d58313a4badff55f79988abd7612d3bb4da5
2016-07-22 14:02:52 -07:00
Daniel Nishi
f21465e14f Add a help item for the Help & Feedback for the Storage Manager.
Bug: 29793176
Change-Id: Ic4104525961e7f173212df54f19857a06c0fac05
2016-07-19 15:47:10 -07:00
Daniel Nishi
2aa423dda6 Log when the storage manager is toggled on and off.
Bug: 30095915
Change-Id: I9fe16f842f2c2944582ec231803aa957573abead
2016-07-12 13:59:22 -07:00
Daniel Nishi
1b9afaff2b Add text to the Manage Settings page to show freed storage.
Bug: 29643106
Change-Id: Id05dc70e36a690e27cab67fecf921257ed7baf15
2016-06-29 14:48:50 -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
776c9eca39 Use Settings.Secure for days to retain.
Previously, we used Shared Preferences, which worked when the
storage manager was localized to Settings. Now that it is in
its own separate APK, we need to use a separate setting to configure
it.

Bug: 28965462
Change-Id: I073859ef1a764679bbc63d3c0cd96af82306212e
2016-06-13 10:47:23 -07:00
Daniel Nishi
80c204420b Add an automatic storage management job service.
This service runs once a day when plugged in when the device has
under 15% free space remaining. If the FeatureFactory has a
storage management job, it runs the job to begin to free up space
on the device.

This is a temporary landing place and will be refactored very
quickly out of Settings.

Bug: 28600825

Change-Id: Id2ebb42a333b3b4e3daef4e50cf985fe055b85c7
2016-05-31 16:50:48 +00:00
Daniel Nishi
668c297603 Merge "Update the summary strings in the Deletion Helper to match the latest mocks." into nyc-mr1-dev 2016-05-25 20:02:25 +00:00
Daniel Nishi
84d944b0bc Update the summary strings in the Deletion Helper to match the latest mocks.
Bug: 28917902
Change-Id: I35af7483f2a97dffc230093a90f0b7d87a4532c1
2016-05-25 11:11:03 -07:00
Daniel Nishi
ed39bf639b Hook up the automatic storage manager settings with the flag.
This allows the settings menu to actually toggle the feature on
and off.

Bug: 28905328
Change-Id: I132c0930970b70a0f88b8fc21e85b6829aaef8c8
2016-05-25 10:03:17 -07:00
Daniel Nishi
1370f7ed20 Change Downloads to show individual files in the Deletion Helper.
The first implementation simply had every file in the Downloads folder
be under a single checkbox. This iteration makes Downloads an
expandable dropdown preference listing every single file individually
for selection to be deleted.

Bug: 28621781
Change-Id: I5169caf718cee4c0fa7f0248bc4c443984766005
2016-05-24 14:26:38 -07:00
Daniel Nishi
97ac5c773d Merge "Update the storage manager settings to match the mocks." into nyc-mr1-dev 2016-05-24 21:18:39 +00:00
Daniel Nishi
c05c8617bc Merge "Fix a crash where the deletion helper crashes when app sizes load." into nyc-mr1-dev 2016-05-24 15:36:22 +00: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
5af567eca7 Materialize the button bar in the Deletion Helper.
Older Android style buttons were used for the bottom button bar.
By changing them to use the buttonBarBottomStyle, they are updated
to flat buttons. The bottom button bar for settings preference
fragments now more closely tracks the Material Design spec as seen
here in [0].

The other Settings views which use the button bar buttons are the
Redaction settings and WiFi network picker in some contexts. These
should be unaffected as they are based on the SettingsActivity,
rather than the SettingsFragment, and inflate a different view.

[0] https://material-design.storage.googleapis.com/publish/material_v_8/material_ext_publish/0B7WCemMG6e0VaDdZWXpLXzNicjg/components_buttons_usage6.png

Bug: 28845586
Change-Id: I9ea55aa2fe1e76f8f952880675501cbb0f76719d
2016-05-20 16:34:59 -07:00
Daniel Nishi
1320de307c Fix a crash where the deletion helper crashes when app sizes load.
This was caused by a change I made to the extraInfo on the app.
The extra info used to be a long which was the last usage time.
I changed it to a UsageStatsState and missed this usage of it.
The attempted cast to long caused a crash.

Bug: 28885317
Change-Id: Ie0d6bcea5d0afccd2762acd19d628c742c7e3db9
2016-05-20 14:11:27 -07:00
Daniel Nishi
ab5a648ddb Merge "Add a collapsible checkbox preference for deletion helper." into nyc-mr1-dev 2016-05-19 21:19:02 +00:00
Daniel Nishi
e6d02b6c5e Merge "Update the deletion helper feature factory for photos and videos." into nyc-mr1-dev 2016-05-19 18:26:43 +00:00
Daniel Nishi
a779cd2b16 Add a collapsible checkbox preference for deletion helper.
This adds a custom preference group which has both a checkbox
and collapse/expand behavior. This is intended to be used in
the deletion helper for apps deletion and downloads folder
deletion.

This patch implements the apps deletion integration.

Bug: 28769691
Change-Id: I9fb28a1baa4067841742b5dbeaf2083728c16144
2016-05-19 10:12:59 -07:00
Daniel Nishi
0772471119 Merge "Don't show app in deletion helper if it was installed recently." into nyc-mr1-dev 2016-05-19 17:09:17 +00:00
Daniel Nishi
76cd0118e9 Update the deletion helper feature factory for photos and videos.
Bug: 28554187

Change-Id: I7fcc34af87ec17e9396f390d851fd31df1dc951a
2016-05-19 10:05:59 -07:00
Daniel Nishi
c408e9c011 Don't show app in deletion helper if it was installed recently.
This solves several problems. The first is that if a user installs
a large app which triggers the deletion helper, the deletion helper
may clear out the recently installed large app to free up space.

The second is that it appears that the usage stats may not be
synced from device to device currently using Backup and Restore.
By considering the installation to be a use for deletion helper
filtering, this should avoid the problem for 60 days (and if the
user hasn't used the app at that point, it should be fair game
to clear).

Bug: 28800057
Change-Id: Idb8545aa45a42e45dc673dc5c179c0197204edfd
2016-05-18 09:56:43 -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
Daniel Nishi
46c32b9e32 Add an alert dialog before clearing data in deletion helper.
The dialog states how much space will be freed by the deletion
and prompts the user to either cancel or continue with the
deletion.

BUG: 28762412
Change-Id: I8db2a8f928c82ebaa2cf5fea030b6b6f4730eb3e
2016-05-16 15:36:28 -07:00
Daniel Nishi
2ef20fb36d Add downloads to the deletion helper.
This adds a deletion service to delete files in the Downloads
folder. All of the files there are collected and offered to the
user to delete.

Bug: 28621781
Change-Id: I94431f9abc3a0afa2d07dbab763312c09e830aef
2016-05-13 13:35:37 -07:00
Daniel Nishi
2186893b8f Entries in the Deletion Helper should be default unchecked.
Bug: 28669483
Change-Id: I88395db46ffb42b757468936bcdf555bb90c0e75
2016-05-11 15:41:44 -07:00
Daniel Nishi
38889de699 Create an overlay to add a photo and video deletion helper service.
This overlay defines a checkbox preference in the deletion helper for
facilitating the deletion of photos and videos. The service which
provides deletion clearing can be overridden and used to create a
custom photo and video deletion helper.

Bug: 28554187
Bug: 28560856

Change-Id: Id5d9671a307aaac0d1331f055b8f2ab7aa67977c
2016-05-10 10:48:59 -07:00
Daniel Nishi
30eaf00f3c Fix a bug where negative file sizes were being used.
Negative file sizes for packages occurs when the file size is either
unknown or if an error occurred during size calculation. As a result,
we can skip them for total freeable space calculations.

Bug: 28465884
Change-Id: I340d725a66a228fd94993781c5e8ef732a60a7b3
2016-05-03 17:21:51 -07:00
Daniel Nishi
c73fb891bc Fix a Deletion Helper crash when it fails to get an app list.
Bug 28424827
Change-Id: I5c3c426d557fb1647a3909bf88fbb7d24329dc57
2016-04-27 20:29:07 +00: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