126 Commits

Author SHA1 Message Date
Aga Wronska
568b3b366c Add logic for selecting filename in RenameDocumentFragment - different selection for directory.
Prevent test from creating directories in Documents folder.

Change-Id: Ib656f8d69cba27b201b5fe67bcb11fa1dec04953
2016-02-23 10:57:09 -08:00
Steve McKay
cddd034ca7 Merge "Move directory and roots support to own ui bots." into nyc-dev 2016-02-22 20:01:48 +00:00
Steve McKay
b9a20d10c9 Move directory and roots support to own ui bots.
Also...sorry, snowball, don't automatically open folders
    that are created in Files app. Only do this in DocumentsActivity.

Change-Id: I271655fd3566496eced4aaa7a44d5110233150a0
2016-02-22 11:50:34 -08:00
Steve McKay
008e948c3e Undo generalization isDownloads > supportsChildren.
Move root comparison logic into RootInfo.
Move shared string comparison code to Shared.

Change-Id: I3267b496a165ad3cae773783db0e79df2eb118e8
2016-02-18 15:59:52 -08:00
Steve McKay
9a0fc1f680 Merge "Improvements to Copy/Move flow." into nyc-dev 2016-02-17 23:40:58 +00:00
Steve McKay
a6bbeab1d3 Improvements to Copy/Move flow.
- Always open drawer for copy/move operations.
- Set title to match operation.
- Update button to say "move" for move operations.
- Other minor fixes.

Also fix "Home" tests broken by ag/867110

Bug: 26506479
Change-Id: I3ccb4ddc72be0a21b91744bcb610c1ca490ac30c
2016-02-17 15:39:58 -08:00
Steve McKay
30551a257c Guard against NPE in equals checks.
Update State test to cover different conditions separately.
Update DirectoryInfo test to best practices.
Update RootInfo to follow DirectoryInfo equals pattern.
Also, allow null cursors from Model...since they happen...I seen it mahself.

Bug: 27118725
Change-Id: Id0a0be053b91c887a745bfca5416e64f0edba995
2016-02-17 12:35:51 -08:00
Aga Wronska
c4524a97c4 Merge "Fix Rename Document tests" into nyc-dev 2016-02-13 00:57:24 +00:00
Aga Wronska
5784996fdc Fix Rename Document tests
Bug:27109148
Change-Id: I489b2bd25f92ebc2b9b84d9cefe1f785a89c89ff
2016-02-12 16:53:52 -08:00
Ben Kwa
83df50f997 Allow multiple range selections using the shift key.
- Introduce an API on MultiSelectManager for starting/ending range
  selections.

- Navigation with the shift key pressed extends the current range
  selection (or starts a new one, if one isn't in progress).

- Navigation without the shift key pressed will end the current range
  selection.

BUG=27124371

Change-Id: Ieddf3ee816812bf5210463536fe63179ef1809ad
(cherry picked from commit 09792ef1506f4cbd944e16651508be435d92c5be)
2016-02-11 21:01:04 +00:00
Ben Kwa
2036dad877 Introduce ChromeOS-style keyboard navigation.
- Turn the DirectoryFragment (DF) and the RootsFragment (RF) into
  top-level views, and allow switching between them via the tab key.

- Disallow arrow-key navigation from switching the user between the
  DF and RF.

- When nothing is explicitly focused, make navigation keys focus the
  DF.  This makes it so that if a user opens DocumentsUI and just starts
  pressing arrow keys, they'll navigate in the directory listing.

- When restoring focus on the DF and RF, remember the last thing that
  was focused, and restore focus on that thing.

BUG=25195767
BUG=25121367

Change-Id: I00e20cbdbe9edfe269fb356440a93ef5d67c5298
(cherry picked from commit 1c9f9222e56482682461013b703590c5c9471018)
2016-02-11 14:16:04 +00:00
Steve McKay
e852d93e1d Preserve selection across device rotation.
Also, update Selection model to use a discrete provisional selection,
   rather than a superset "total" selection

Bug: 27075323
Change-Id: I855e6b66010b3cdd599cc0a9f0046a7efadca5fe
2016-02-09 18:52:45 -08:00
Tomasz Mikolajewski
65d9a51afa Fix flakiness of testFilesList_LiveUpdate.
Change-Id: I87618d5640e2e17de3188554d561abc5f3a3152a
(cherry picked from commit 1008c2d4878abde1890560ef48eec229a4253445)
2016-02-10 02:11:37 +00:00
Steve McKay
40d5d9d827 Merge "Don't apply fancy back logic when drawer is not present." into nyc-dev 2016-02-10 02:00:38 +00:00
Aga Wronska
3b5a29cb5d Merge "Go to root from child directory when root tapped. Bug: 27060001" into nyc-dev 2016-02-09 23:58:42 +00:00
Steve McKay
9146ac608c Don't apply fancy back logic when drawer is not present.
Add test coverage. Booya!

Bug: 27078649
Change-Id: Id2ce53009ee212b3af8d143091859d30e2bc76b1
2016-02-09 14:47:50 -08:00
Tomasz Mikolajewski
df3abce378 Remove temporary test fixes.
The tests should fail, as the features are broken.

Change-Id: Ib760ba5469164b8ca0d08c57f24273268ae2436f
(cherry picked from commit 94eca73fec7aa1857f5847df355877d523d0c8a6)
2016-02-09 09:14:49 +00:00
Tomasz Mikolajewski
c7b832202a Migrate all tests to ActivityTest.
ActivityInstrumentationTestCase2 takes care of starting and closing
the activity, which prevents flakyness.

Change-Id: I2d3908f6605a67a3c2d11e18a9c4799443828df9
(cherry picked from commit e366886c7d91b62fe1478a057fc4c0a104d12b02)
2016-02-09 01:42:50 +00:00
Aga Wronska
e436f94f0e Go to root from child directory when root tapped.
Bug: 27060001

Change-Id: Iabe1f9f2c986904a4d827e74cf29b3de55e74f90
(cherry picked from commit 5652d175fedc87c796de3cfd354a9de961450690)
2016-02-08 23:38:07 +00:00
Steve McKay
f8d898590b Honor javadocs, call super first in DocumentsProvider.call handling.
Change-Id: Ic7d8d629c4c7df39ce3e2524670169752bab899b
2016-02-04 10:05:52 -08:00
Tomasz Mikolajewski
24586893ba Migrate *ActivityUiTest to use ActivityInstrumentationTestCase2.
Change-Id: I24f2846c551e0123ad87b3db8a1f5c7dbf628c0c
2016-02-04 15:06:35 +09:00
Tomasz Mikolajewski
1c0b2326b8 Fix flaky testLoadsHomebyDefault.
The test was resuming a previously opened activity, so naturally the
redirect to Home didn't happen.

This CL fixes the issue by closing the activity in TearDown().

Change-Id: I43e78a83c2b53c52745bc7eef515a8f759559e46
2016-02-04 11:50:45 +09:00
Tomasz Mikolajewski
ccda74f5ec Merge "Fix flaky testFilesList_LiveUpdate()." 2016-02-03 02:08:15 +00:00
Aga Wronska
7592987761 Merge "Add tests for action bar's search icon behavior - Icon hidden when root doesn't support search - Icon visible whan root supports search" 2016-02-02 23:46:12 +00:00
Ben Kwa
3182a92a16 Merge "Refactor key handling and selection." 2016-02-02 21:36:39 +00:00
Ben Kwa
6792489dc4 Refactor key handling and selection.
- Pull key handling code out of the MultiSelectManager.

- Tighten up the semantics around range selection:
  - Create an API on MultiSelectManager for handling multi-select.
  - Make the range selection more opinionated (e.g. more state checks),
    to simplify the design and code.

BUG=25195767

Change-Id: I4bbe446ed3059150499db3d28e581b2e68405266
2016-02-02 10:34:19 -08:00
Tomasz Mikolajewski
b005e14e46 Fix flaky testFilesList_LiveUpdate().
Change-Id: I76fe7977c47f7b225ec42d64484942ce059b91fd
2016-02-02 19:26:09 +09:00
Aga Wronska
cfba4f6809 Add tests for action bar's search icon behavior
- Icon hidden when root doesn't support search
    - Icon visible whan root supports search

Bug: 26903635
Change-Id: I7a73d44e83c87be7d25abe55477fa54572833e32
2016-02-01 17:16:44 -08:00
Aga Wronska
0950df196f Add tests for rename documents feature
- Add helper class for the Ui tests. It creates basic test environment.
      It is intermediate layer between UiBot/DocumentsProviderHelper and UiTest classes.
    - Refactor SearchView tests
    - Add renaming support in the test DocumentsProvider
    - Add renaming tests

Bug=26799799

Change-Id: I2849913a1addabff0087bb06b80f36de7cb144f3
2016-02-01 10:36:02 -08:00
Tomasz Mikolajewski
748ea8cc78 Show a warning notification and a dialog in case of conversion when copying.
Change-Id: I451b0944069deb5f0b49b54c514e7761be449e3d
2016-01-28 13:12:55 +09:00
Tomasz Mikolajewski
b8436af1b8 Wire multi-parents support for moving to DocumentsUI.
Bug: 26481380

Change-Id: Ief7db8f8abeca94e47832995fd0e2a6f31bfbc93
2016-01-27 10:40:04 +09:00
Steve McKay
2ed9f813b0 Enabled content validation in file ops tests.
Authority isn't set by default. Wrapped in RootCursorWrapper.

Bug: 26687509
Change-Id: Ie99dbd799914f03bf7beac540b64df67c1e637a6
2016-01-25 19:01:38 -08:00
Steve McKay
d0086a4960 Fix broken SearchViewUiTest.
Change-Id: I0df509ff6307f9aeb32d9fbfaaf68de59507e3f7
2016-01-22 16:23:32 -08:00
Aga Wronska
31f97bc4ee Merge "Add support for renaming documents" 2016-01-22 23:26:35 +00:00
Aga Wronska
3b327ef9f9 Add support for renaming documents
- Add rename dialog
- Add rename menu option
- Enable rename menu option only when renaming supported
- Rename files and directories
- Present error message if renaming fails

Bug: 20493815
Change-Id: Ic7386d14e3876655fb19245b9a90b4c67a4febb4
2016-01-22 13:36:40 -08:00
Tomasz Mikolajewski
87156dc8ae Do not allow to move virtual files using conversion.
Change-Id: Ia792bc766272645f7bf8a2683c22895b03df3a1f
2016-01-22 13:50:13 +09:00
Ben Kwa
29852339f1 Merge "Fix band selection problems." 2016-01-22 02:09:07 +00:00
Ben Kwa
22f479dad3 Fix band selection problems.
- Remove whitespace from the GridModel, which isn't set up to deal with
  it.

- Use absolute column bounds whenever translating the band rectangle
  into column indices.  This necessitates additional binary searching,
  but is necessary when columns aren't fully populated, which happens
  with the new grid layout.

BUG=26512327

Change-Id: I5016d5de8f00c366f575f0722739007ac1612923
2016-01-21 18:08:00 -08:00
Steve McKay
17fefe5b1a Merge "Move delete support into FileOperationService." 2016-01-21 21:38:41 +00:00
Ben Kwa
760199ea72 Merge "Rework selection handling for items in the DirectoryFragment." 2016-01-21 21:28:46 +00:00
Ben Kwa
0436a75721 Rework selection handling for items in the DirectoryFragment.
- Remove the gesture detector from the MultiSelectManager, and
  consolidate gesture detection and event dispatch logic in
  DirectoryFragment.GestureListener.

- Route single-tap events through the DocumentHolder, so that it can
  apply view-specific logic, like making a tap on the item's icon
  select rather than activate.

- Consolidate event handling logic in the ItemEventListener.

- Add new unit tests for DocumentHandler.

BUG=24326546

Change-Id: Id15cdd11b13e4c063c1baff95aa8ee09c190d6c3
2016-01-21 12:18:01 -08:00
Steve McKay
3564543e1e Move delete support into FileOperationService.
Refactor Jobs to work with files from multiple providers.
Don't shut down threadpool until service#onDestroy is called.

Bug: 26696797, 26462789, 26567205, 25162803, 26714663
Change-Id: Id43e8e3dc2294cd07dcd6a3477b19efb298c260f
2016-01-21 12:16:04 -08:00
Steve McKay
cdcf99bc08 Merge "Support for concurrent file operations." 2016-01-20 20:05:02 +00:00
Steve McKay
ecbf3c504c Support for concurrent file operations.
Swith to using a regular service.
Perform file ops on thread pool.
Separate Job tests from service test.
Check in service test that wake lock is released and service shut down.
Increase copy buffer size to 32k (suggested by mtomasz).
Rework Copy testing to use an out-of-process provider (which has caused a content validation problem).
Move copy testing logic into base test and share it with Move testing.

Change-Id: I2f97d6c9f23c205b0f39ca6ba93bec119d63c80b
2016-01-20 11:45:47 -08:00
Aga Wronska
f6a31d319f Refactor SearchManager:
- Move SearchManager out of BaseActivity.
- Refactor usage of onCurrentDirectoryChanged(int anim).
- Cancel search when directory changes.
- Enable testing for cancelling search when directory changes.
- Avoid recreating action bar when only the content of the directory is
  changed.

BUG=26495573

Change-Id: I1400090fcb529ad3905018d1640fdb7416542989
2016-01-19 13:29:09 -08:00
Aga Wronska
619f3be0fa Add Search View UI tests
Change-Id: I67726e7764ec147c5987cbf737f763c3146f5766
2016-01-15 09:49:36 -08:00
Ben Kwa
d20d01061c Merge "Increase the stability of sorting in the Model." 2016-01-09 01:05:06 +00:00
Ben Kwa
e2564f9f19 Increase the stability of sorting in the Model.
This is necessary to prevent UI thrash (items continually shuffling
around) when the underlying Provider doesn't return its contents in a
stable order from one load event to another (DownloadStorageProvider is
an example).

BUG=26417297

Change-Id: Ie99e56b610f5d01d5318be07c0379b506c828735
2016-01-08 16:59:20 -08:00
Ben Kwa
433df5c865 Merge "Fix home key behaviour when there are no subdirs in cwd." 2016-01-08 20:58:24 +00:00
Ben Kwa
2ad8214916 Merge "Fix shift-selection." 2016-01-08 20:57:40 +00:00