440 Commits

Author SHA1 Message Date
Ben Kwa
448dbbbf0e Implement some tests for com.android.documentsui.CopyService.
- Add a unit test for CopyService.
- Make some changes to StubProvider to make it more configurable, for
  testing.

Change-Id: I3d726099feaf6b7a3fdd40bf2449f4ee3e848d77
2015-04-21 15:39:12 -07:00
Daichi Hirono
d00d70a6ce Merge "DocumentsUI: Save source file list into BaseActivity.State." 2015-04-21 03:56:21 +00:00
Geoff Mendal
3ac2032586 Import translations. DO NOT MERGE
Change-Id: If0652f6630dbfb0110c8b13a479cb59c1af22bcc
Auto-generated-cl: translation import
2015-04-20 05:21:16 -07:00
Daichi Hirono
cf0e9ace5e DocumentsUI: Save source file list into BaseActivity.State.
This is needed so that the activity does not lost the list on screen rotation.

BUG=20283251

Change-Id: I8f971bab0a0ce2066fd5fea29b98b355cb948ea6
2015-04-20 20:01:49 +09:00
Jeff Sharkey
4cfb3130a4 Merge "Enable the copy feature." 2015-04-19 04:35:39 +00:00
Geoff Mendal
67a8ad3b65 Import translations. DO NOT MERGE
Change-Id: If7a0cfd12e5ed935ad521bd48eb82dd6cad3084f
Auto-generated-cl: translation import
2015-04-17 20:22:14 -07:00
Ben Kwa
d58d954a15 Enable the copy feature.
Change-Id: Ie0636895f2b2fe6550eb68042295daf76bbbd7fe
2015-04-16 18:17:25 -07:00
Daichi Hirono
fbad74b29c Merge "Stop to take multiline file name in the create directory dialog." 2015-04-17 00:59:51 +00:00
Ben Kwa
f8f80c8034 Merge "Fix cancellation of copy jobs." 2015-04-16 16:45:29 +00:00
Ben Kwa
94ac0d7d30 Fix cancellation of copy jobs.
Add FLAG_CANCEL_CURRENT to the pending intent for cancellation, to
prevent reuse of previously created cancellation intents.  Previously
created intents have non-matching job IDs, which causes the cancellation
intent to be ignored.

BUG=20221969

Change-Id: Ie0afcc6af53a550b44bc4b2f3d48942cdb092a65
2015-04-16 09:43:41 -07:00
Daichi Hirono
ba383eb576 Stop to take multiline file name in the create directory dialog.
BUG=20275734

Change-Id: I1b0847598eb06091193bb63e6ab3a57033798c10
2015-04-16 16:45:33 +09:00
Daichi Hirono
ff9ab66d42 Merge "DocumentsUI: Hide pick button of copy destination picker for read only directory." 2015-04-16 03:34:35 +00:00
Geoff Mendal
b47a7fe7c6 Import translations. DO NOT MERGE
Change-Id: Ia8ffbde888155d62a59ca824069187db7b9895b8
Auto-generated-cl: translation import
2015-04-15 05:16:32 -07:00
Daichi Hirono
c2eaa6e213 DocumentsUI: Hide pick button of copy destination picker for read only directory.
BUG=20238336

Change-Id: Ia2a0ef2889a2153d99c0f305deda151a04483173
2015-04-15 15:20:49 +09:00
Daichi Hirono
52743f3b17 Merge "DocumentsUI: Use system cancel string resources." 2015-04-15 05:44:15 +00:00
Daichi Hirono
e4db58edd4 DocumentsUI: Use system cancel string resources.
BUG=None

Change-Id: I989e28ad4729176d66b1b333f242470129d139fa
2015-04-15 14:33:52 +09:00
Daichi Hirono
1a2fdb496e DocumentsUI: Move intent related constants to BaseActivity.DocumentsIntent.
BUG=None
Change-Id: I81d367d5f8d727a5fa76bc22b2fe871ae441dbcf
2015-04-15 13:43:28 +09:00
Daichi Hirono
c96e494ac7 Merge "DocumentsUI: Filter out downloads root if the source documents include directory." 2015-04-15 04:30:10 +00:00
Daichi Hirono
9be34298be DocumentsUI: Filter out downloads root if the source documents include directory.
This is the short term solution for the downloads root, which does not support
directory creation. For the long term solution, we need to add a flag to Root
model to check if the root support directory creation or not.

BUG=20186663

Change-Id: I15c4795892f38e3f968776f732a6f2160ae775fc
2015-04-15 13:27:55 +09:00
Tomasz Mikolajewski
3b5adaaca1 Merge "Add an initial version of the copy failure dialog to DocumentsUI." 2015-04-15 04:02:14 +00:00
Daichi Hirono
de021abe40 DocumentsUI: Polish buttons of copy destination dialog.
* Add cancel button to directory picker dialog.
* Turns "select" label to "copy to" label for copy destination picker.

BUG=20170953

Change-Id: I66214804aed75a6fccc716d1a01163c634e73d7f
2015-04-15 12:57:53 +09:00
Tomasz Mikolajewski
61686593fd Add an initial version of the copy failure dialog to DocumentsUI.
Change-Id: Ibdfde661aa5b636570c017d3d00565c193d595a3
2015-04-15 12:39:27 +09:00
Geoff Mendal
e7477d6672 Import translations. DO NOT MERGE
Change-Id: I37c3e2c0945bebbf7dd814bad8aa9de1e2c6bef7
Auto-generated-cl: translation import
2015-04-13 05:21:38 -07:00
Jeff Sharkey
1407d4c777 DocumentsUI roots can have settings.
Roots use a flag to indicate they have settings, and DocumentsUI
offers to launch towards someone who handles a new Settings intent.

Slight rename of browse intent for clarity.

Bug: 19993667
Change-Id: I86302ec1cfac5e435d8bc5701bdb85fb9b0dcbae
2015-04-12 22:02:44 -07:00
Daichi Hirono
fe4d95c3fc Merge "DocumentsUI: Add new private intent action to select copy destination." 2015-04-13 04:53:09 +00:00
Daichi Hirono
bbe2292bc6 DocumentsUI: Add new private intent action to select copy destination.
The CL adds INTENT_ACTION_OPEN_COPY_DESTINATION, and implements the behavior to
respond the intent action.

The directory picker:
 * filter out read only roots
 * return document URI instead of document tree URI
for the intent action.

BUG=b:20146034
Change-Id: I96c565100c3cdaa57cc7abd8cf6d895d148941a7
2015-04-13 13:49:31 +09:00
Tomasz Mikolajewski
97397938c4 Add support for notifying about child changes in StubProvider.
Change-Id: I256856a2bbefa6d831e6b912583eca86eeb03ba7
2015-04-13 13:35:23 +09:00
Tomasz Mikolajewski
d5d5c91dfc Add support for opening files in StubProvider.
Change-Id: Ia3df58850cc3df24dc310b29035a41fb75eadeff
2015-04-13 13:03:23 +09:00
Tomasz Mikolajewski
738154ee84 Add support for removing files and directories in StubProvider.
Along the way it updates clients about changes in used storage.

Change-Id: I02fb1333e1f97f1476b87310a27b75d99fa00854
2015-04-13 11:40:04 +09:00
Tomasz Mikolajewski
40355c2e96 Merge "Simulate running out of space in StubProvider." 2015-04-13 02:37:51 +00:00
Tomasz Mikolajewski
e1a03f8eec Show copy destination when clicking on the copy notification in Documents UI.
Change-Id: I3d955595bc46903c134c0633a6d32663cc2d0c05
2015-04-13 11:35:27 +09:00
Tomasz Mikolajewski
30b669465d Simulate running out of space in StubProvider.
Change-Id: I0a069c07bcf8784aeb5c5993d90d0a6db6e2afb1
2015-04-13 09:37:54 +09:00
Jeff Sharkey
59d577a518 Browse mode for DocumentsUI, removed volume state.
The existing management mode is too specific, and requires that
storage backends add queryChildDocumentsForManage(), etc.  Instead,
to offer more natural browsing support, add a new BROWSE_ROOT intent.

It behaves mostly like MANAGE_ROOT, except that it doesn't mutate
its Uris with setManageMode(), and it shortcuts straight to VIEW on
clicked documents.

It can be launched like this:

$ adb shell am start -a android.provider.action.BROWSE_ROOT
    -d content://com.android.externalstorage.documents/root/8405-1DFB
    -c android.intent.category.DEFAULT

Also rename a MetricsConstants to make it clearer, and don't
auto-mount all emulated volumes.

Fix bugs around parceling of DiskInfo/VolumeInfo.  Method to resolve
the best description for a VolumeInfo, which might need to fall
back to DiskInfo.

Add back "removed" volume state so we send broadcast when a volume
is destroyed, matching the expected public API behavior.

Bug: 19993667
Change-Id: I13aff32c5e11dfc63da44aee9e93a27f4690a43f
2015-04-12 16:03:50 -07:00
Geoff Mendal
fff84a87e1 Import translations. DO NOT MERGE
Change-Id: I4be4f944cd8c87529e04aa4c8e19198020c1b262
Auto-generated-cl: translation import
2015-04-10 23:01:52 -07:00
Ben Kwa
23f5ca6dc8 Merge "Enable directory copying." 2015-04-10 17:33:44 +00:00
Ben Kwa
726cf70fd4 Enable directory copying.
- Enable directory picking for copying.
- Implement recursive copying inside the CopyService.
  - Pretty up the notification (use an indeterminate notification while
    calculating copy size)
  - Do two recursive walks: one to determine the size of the copy job,
    and then another to actually copy the files.
- Switch to using ContentProviderClient instances, for better error
  detection and handling
- Disable copying from the Recents view.

Change-Id: Ieb38cca80edf84a487547b68f0d6b328fc4d7701
2015-04-10 10:28:22 -07:00
Ben Kwa
6e08dbc366 Merge "Prototype the destination picking." 2015-04-08 19:05:26 +00:00
Ben Kwa
ef3f2620b3 Prototype the destination picking.
- Add an intent to open a destination picker, and refactor
DocumentsActivity accordingly.
- Modify CopyService to take a destination for the copy, and to use URIs
and PFDs instead of Files and Streams, for better error handling &
cleanup.

Change-Id: I69dc43823a703674dc29d2215e2df23b33ad7882
2015-04-08 11:55:18 -07:00
Tomasz Mikolajewski
3a1b164f65 Merge "Use default theme for StandaloneActivity (DocumentsUI)." 2015-04-08 13:33:13 +00:00
Tomasz Mikolajewski
a4583a4d2d Merge "Add StubProvider::isChildDocument()." 2015-04-08 13:28:56 +00:00
Geoff Mendal
3ebbdd03ea Import translations. DO NOT MERGE
Change-Id: I0f9b0b3036a149b304b874fbaa2d95cf56e4e816
Auto-generated-cl: translation import
2015-04-08 05:35:59 -07:00
Tomasz Mikolajewski
86213c9486 Use default theme for StandaloneActivity (DocumentsUI).
Change-Id: I41841702e0b68123cb73ff1203ca6e6fe5eae320
2015-04-08 20:35:33 +09:00
Tomasz Mikolajewski
78699be5ff Add StubProvider::isChildDocument().
Change-Id: Ib17df4307c1f658c42468f86e1f66d4469eefe58
2015-04-08 19:38:55 +09:00
Tomasz Mikolajewski
0fc8beb2df Add an initial version for a StubProvider for DocumentsUI.
It will be used for testing as well as for development.

Change-Id: I1556836e1070d9e4483d2574bba40aa2fdfde229
2015-04-08 13:14:52 +09:00
Tomasz Mikolajewski
8090ffe633 Fix broken tests in DocumentsUI.
Change-Id: Ia41eda4d9f500882ca7eb62b13a4bca60978bc33
2015-04-08 09:54:43 +09:00
Geoff Mendal
91a2eaf5ee Import translations. DO NOT MERGE
Change-Id: I34445592f741f1566ae5493a8f591391ca65d435
Auto-generated-cl: translation import
2015-04-06 05:17:12 -07:00
Geoff Mendal
13875be0fe Import translations. DO NOT MERGE
Change-Id: I13a822578c3b71e3176704891486783770337b97
Auto-generated-cl: translation import
2015-04-03 22:35:22 -07:00
Ben Kwa
c8adb235b9 Merge "Enable directory selection. Add an IntentService to copy files." 2015-04-03 21:06:30 +00:00
Ben Kwa
d99109fca8 Enable directory selection. Add an IntentService to copy files.
Change-Id: I0bec0224aa1b52766664c23f77d60affec702111
2015-04-03 13:49:24 -07:00
Geoff Mendal
0b1f41230a Import translations. DO NOT MERGE
Change-Id: I02c4b9d0fcb21c0224590503fa8720805db3d2fa
Auto-generated-cl: translation import
2015-04-01 02:49:53 -07:00