160 Commits

Author SHA1 Message Date
Tomasz Mikolajewski
007151a90d Reduce memory allocations and improve sorting in DocumentsUI by 8.42%.
Reland after a revert. No changes.

Bug: 27286016
Change-Id: I0988062106faf4086c44d9b344649ef2cb86d3e7
2016-03-18 02:15:10 +00:00
Aga Wronska
b4129d785c Add config flag to hide home directory ("Documents") from the roots list.
Make home root hidden by default.

Change-Id: Ia9f97f3cad7ab102d65e01d6e0dd9bc39ab72f21
Fixed: 27683725
2016-03-17 11:57:29 -07:00
Aga Wronska
f3244e870e Revert "Precompute cursor indexes in DocumentsUI and improve perf by 2.7%."
It ia causing tests failures and exception at the app start.

This reverts commit d35a974b76cb0b3387aff7780d101e3f7de2ebd3.

Change-Id: I2577f723a7e25d4dcc12050791c65a900ac41f7d
2016-03-16 13:49:58 -07:00
Ben Kwa
415c0627b3 Merge "Fix band selection problems." into nyc-dev 2016-03-16 20:06:14 +00:00
Ben Kwa
c29fd8d149 Fix band selection problems.
BUG=27364174
BUG=27645942

Change-Id: Ib14680db708f1ddf1f5dc9dff8b93b655fa3f123
2016-03-16 11:02:48 -07:00
Tomasz Mikolajewski
49ca224623 Reduce memory allocations and improve sorting in DocumentsUI by 8.42%.
Bug: 27286016
Change-Id: Icc84aaaedd396d82f4ca7de63a682deebe1e1b93
2016-03-16 09:59:55 +00:00
Aga Wronska
7e166888ac Suppress tests failing because or permission inconsistency
Bug: 27653930
Change-Id: I92581b8d048af1a207ca8cf56dea40f17f38f42d
2016-03-14 15:10:56 -07:00
Steve McKay
3e63e7de23 Run all downloads through trampoline.
This guarantees the retry/delete support in the downloads
    trampoline can do its thing.
Allow APKs not in downloads to go directly to pakcage
    manager via VIEW intent.
Add test coverage for retry dialog.

Bug: 27539337

Change-Id: I75c5db8915e24a7648c7990136d39ed86d407637
2016-03-11 16:42:51 -08:00
Steve McKay
4064f60831 Merge "Delete downloads activity." into nyc-dev 2016-03-11 00:04:00 +00:00
Steve McKay
2c4c90d246 Merge "Fallback to byte-by-byte copy/move if optimized fails." into nyc-dev 2016-03-10 23:18:51 +00:00
Steve McKay
6ce903d7b7 Delete downloads activity.
Delete "MANAGE_ROOT" activity.
Add intent filter for "BROWSE_DOWNLOADS".
Open by default on Downloads directory.

Bug: 27563427
Change-Id: I1f85dc17a0bc94b439a272847e4ab3bb347ead23
2016-03-10 11:34:03 -08:00
Tomasz Mikolajewski
1008a11233 Fallback to byte-by-byte copy/move if optimized fails.
Sometimes providers may refuse to do a provider-side copy/move
even though the documents had the SUPPORTS_COPY/MOVE flags set.

This is because optimized copy/move may be only supported within
the same root.

Since there is no easy way to check if documents are on the same
roots from DocumentsUI, as well as whether the provider can actually
copy/move efficiently between different roots, we should tolerate the
failure and do a fallback to byte-by-byte operation.

Bug: 27436368
Change-Id: Ia1a0fbdba26c06b2151afc25d8513c01d60d31db
2016-03-10 16:48:29 +09:00
Tomasz Mikolajewski
9ab36aa86e Merge "Improve sorting performance by 2.5 times." into nyc-dev 2016-03-10 00:28:24 +00:00
Steve McKay
f346796b88 Suppress Rename tests that fail consistently...
on APCT.

Change-Id: I81e464855e16573e536828813b592f7ebc5b464f
2016-03-08 13:14:37 -08:00
Steve McKay
cc90976612 Merge "Suppress tests that are consistently failing..." into nyc-dev 2016-03-08 01:38:52 +00:00
Tomasz Mikolajewski
c05d98f64e Improve sorting performance by 2.5 times.
This CL replaces List<String> with String[], which prevents from
calling get() and set() multiple times within a loop, in favor of
System.arraycopy().

Scanning a directory with 10K files went down from 1200ms to 450ms.

Bug: 27286016
Change-Id: Id533480934f739905a845cb0e13fe862e361b3db
2016-03-08 09:26:55 +09:00
Steve McKay
18d3e853cc Suppress tests that are consistently failing...
on APCT.

Change-Id: I3a3a718b8211a5188130aa698322934bf62d81d1
2016-03-07 15:36:14 -08:00
Guang Zhu
c5a511ad0c fix DocumentsUI tests makefile
For instrumentation test apks, it should not statically include
Java libraries that are already present in the app module being
instrumented. They only need to be on classpath during compile
time.

Bug: 26689464
Change-Id: I68d4be95e30ae70bbab23d016a87eb085c10cc50
2016-03-06 00:47:59 +00:00
Steve McKay
8db100e4a3 Merge "Don't show title in delete confirmation." into nyc-dev 2016-03-02 19:56:21 +00:00
Steve McKay
b4672ef6df Merge "Always show intern storage." into nyc-dev 2016-03-02 18:49:28 +00:00
Steve McKay
7c4395804e Always show intern storage.
Only show debug root when devel mode is enabled.
Remove all traces of "advanced".

Bug: 27297398

Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
2016-03-02 10:47:59 -08:00
Tomasz Mikolajewski
cf057efaff Fix broken tests due to uninitialized roots.
Change-Id: I014657cab86ffa17290ab8990f0adaa6f6451e15
2016-03-02 14:40:43 +09:00
Tomasz Mikolajewski
1a06789959 Merge "Add scaffolds for performance tests of DocumentsUI" into nyc-dev 2016-03-02 05:35:04 +00:00
Tomasz Mikolajewski
ae6d6b494c Add scaffolds for performance tests of DocumentsUI
Bug: 27370274
Change-Id: I14dea1b85cd84c8bb3c0eee27b2954108bfa4f8b
2016-03-02 13:01:11 +09:00
Steve McKay
ea9ec291ed Fix roots filtering for move operations.
Add test coverage for the Downloads case.
This was a regression to my recent cleanup of RootInfo.
Fixed logic to not exclude basically *everything* when a
    directory is in the set of files to be copied.

Bug: 27303346
Change-Id: I4d5608e0d8d95448b027b20107a11a7a5e46d45e
2016-03-02 01:32:30 +00:00
Steve McKay
c8d4e22a72 Don't show title in delete confirmation.
Also, remove "unhide" from Adapter, since it is unused.
Had to add a custom layout because Alert didn't do a
    good job. LOTS of work for a yes/no!

Bug: 27205772
Change-Id: Ic20d73b54fd142287e07402877ac339300b4bbb7
2016-03-01 12:46:29 -08:00
Tomasz Mikolajewski
88d5592ff2 Merge "Remove revealLauncher and revealApp from tests." into nyc-dev 2016-03-01 01:38:52 +00:00
Aga Wronska
95f44e8f8e Merge "Clear selection mode when changing root" into nyc-dev 2016-02-26 21:32:27 +00:00
Aga Wronska
d559743a0d Clear selection mode when changing root
Bug: 27364691, 27142316
Change-Id: I961f3eef67b51a2de999d34edbacd21e4b51c2a4
2016-02-26 13:26:35 -08:00
Steve McKay
7a3b811122 Delete confirmation and notification improvements.
Bug: 27344527, 27347647, 27136182
Change-Id: Ia33f05b449a0bc30704e116287e18094e30382e0
2016-02-25 15:47:16 -08:00
Aga Wronska
b9eeee1543 Launch the activity with the test root opened for tests
to reduce some flakiness and save time used on opening test root over
and over again.

Bug: 27271765
Change-Id: I6fa191ed8e0c7e8e071e4dd17c62aab5db1e23a5
2016-02-24 16:34:43 -08:00
Tomasz Mikolajewski
2b163bd043 Remove revealLauncher and revealApp from tests.
This speeds executing all tests by 3 minutes (from 12min to 8min).

Bug: 27192623
Change-Id: I96eb9edd802f5817ab466332ac4e1bb9106621bd
2016-02-24 18:52:14 +09:00
Aga Wronska
f4b808345d Merge "Add logic for selecting filename in RenameDocumentFragment - different selection for directory. Prevent test from creating directories in Documents folder." into nyc-dev 2016-02-23 19:04:05 +00:00
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
Tomasz Mikolajewski
0fa97e85e4 Cleanup error handling in jobs.
Change-Id: Icf6a7aad1b84dc92285064810776239e93494e38
2016-02-23 10:36:19 +09: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