227840 Commits

Author SHA1 Message Date
Ben Kwa
d839149843 Refactor DocumentHolder.
Primary goals of this refactor are to reduce DirectoryFragment bloat,
and to simplify the code (especially the binding code) for the different
layouts.

- Decouple DocumentHolder from DirectoryFragment.
- Move it into its own file.
- Move binding code from DirectoryFragment into DocumentHolder.
- Split DocumentHolder implementation into three separate subclasses,
  for grid items, list items, and dividers.

BUG=24326989

Change-Id: I217bf4e5b8e1b33173b8b0275591a8c5d8e9161c
2015-12-21 15:31:15 -08:00
Ben Kwa
c72a2cb899 Implement bucketed sorting in DocumentsUI.
Change the sort code in the Model to bucket items into two separate
categories (folders and documents) and then sort the two buckets
separately.

Add code to the adapter to insert a visual break in the UI, between
folders and documents.

Change-Id: I759fedcef829aba9ad61554326489a9e62641cc7
2015-12-18 15:04:26 -08:00
Ben Kwa
fcb54d8be7 Wrap up the stable ID refactor.
- Rationalize band selection: make it internally a range selection
  operation, that translates positions to IDs only when updating the
  Selection.
- Clean up TODOs and comments.
- Fix selection adjustment when things are removed from the view.

Change-Id: If917eb9dd18e755c5a0ce83c84409902c4ef3d2e
2015-12-16 14:04:24 -08:00
Ben Kwa
862b9641e3 Re-enable sorting in the DirectoryFragment.
- Move sorting from the back-end (using SortingCursorWrapper) to the the
  front-end (in DocumentsAdapter).  This makes it such that re-sorting
  the directory contents doesn't necessitate a reload.
- Update DirectoryLoaders to just return unsorted results, and rely on
  the UI to sort them.
- Remove the (now-unused) SortingCursorWrapper.
- Update Model tests to test sorting.

BUG=26024369

Change-Id: I871cc0e496267d381ae546e0309125d04649415a
2015-12-16 13:54:01 -08:00
Ben Kwa
db65cd5e48 Fix file deletion after the move to Model IDs.
- Add methods to the DocumentsAdatper to hide and unhide files.  This
  removes that burden from the Model.

- Remove clunky markForDeletion/finalizeDeletion and all related code
  from the Model.  Replace with a straight-up delete method.

- Modify deletion code in the DirectoryFragment.  Deletion now looks
  like:
  - user presses delete
  - DocumentsAdapter hides the deleted files
  - If the user presses cancel, the DocumentsAdapter unhides the files.
  - If the user doesn't cancel, Model.delete is called to delete the
    files.

- Fix deletion-related Model tests.

BUG=26024369

Change-Id: I02e2131c1aff1ebcd0bdb93d374675fd157d7f51
2015-12-14 11:47:27 -08:00
Ben Kwa
743c7c2f0f Transition selection to use Model IDs.
This CL transitions the MultiSelectManager to (mostly) use Model IDs.

- Add the ability to retrieve all model IDs for the current directory,
  from the model.

- Add a map in the DocumentsAdapter that maps from adapter position to
  model ID.

- Make the adapter listen for model updates, and update its internal map
  of positions to model IDs appropriately.

- Use the aforementioned map when binding ViewHolders.

- Get unit tests to compile; get as many tests passing as possible at
  this point.  Tests related to deleting things won't work right now.

Still to do:

- Add code to the adapter to sort and group items.  After this is done,
  SortingCursorWrapper will no longer be needed.

- Add code to the adapter to deal with item addition/removal.  After
  this is done, the pending-deletion code in the model can be removed.

- Rationalize position-based vs model-based selection.  Some code in the
  MSM (in particular, code dealing with range selection) is still
  position-based.  It's becoming clear that it doesn't make sense for
  range selection to be ID-based, since "range" is a concept that only
  makes sense in the context of items that are positioned in the UI.
  Will need to iterate more on the position-based code to make sure it
  makes sense.

BUG=26024369

Change-Id: I767cde2d888c101aaf83b59155b14634a236164b
2015-12-14 11:47:27 -08:00
Ben Kwa
003a999db6 Switch DirectoryFragment code to use model IDs.
A Model ID is a unique, stable identifier referring to a document.
The basic idea is to move away from doing everything using adapter
positions, and instead use model IDs.

This is the first in a line of CLs toward that goal.  It does the
following:

- Introduce the concept of a Model ID, which is unique for each
  document.
- Add a method to retrieve items from the Model using ID rather than
  adapter position.
- Transition code in the DirectoryFragment to talk to the Model using
  Model IDs rather than positions.
- Break the Model class out into a separate file of its own.

BUG=26024369

Change-Id: Ia5171f089d6b8a83855423ec05cf14dbfc7b6ba8
2015-12-14 11:47:27 -08:00
Svetoslav Ganov
edd137b9b9 Merge "Change signature|system permissions to signature|privileged" am: cfed01af4b
am: 3dee9db651

* commit '3dee9db6516fd97d7db3641fc81533cc3553fde8':
  Change signature|system permissions to signature|privileged
2015-12-14 10:43:21 -08:00
Michael Wright
55f90c1cf4 Merge "Customize auto-brightness parameters" am: a3931897fd
am: 59ec7199fa

* commit '59ec7199fa2c8f37ae7be320eeb67281de45dd0a':
  Customize auto-brightness parameters
2015-12-14 10:41:19 -08:00
Yohei Yukawa
c18a05faf1 Merge "Rotate IMEs (subtypes) by Meta+Space." 2015-12-14 18:39:19 +00:00
Julia Reynolds
b0c457a18b Merge "resolve merge conflicts of d1aa7ae6d7 to master." 2015-12-14 18:36:08 +00:00
Julia Reynolds
1ed208f800 resolve merge conflicts of d1aa7ae6d7 to master.
Change-Id: I544371082ed38652a47ed2e383a262f46f93e5a9
2015-12-14 13:32:36 -05:00
Steve McKay
3ab0c4c43e Merge "Load Home directory by default." 2015-12-14 18:18:02 +00:00
Steve McKay
b67bfbf975 Load Home directory by default.
Don't update toolbar before first root load.
This was causing Recents > Home flicker due
to Recents being the default root returned from getCurrentRoot.
Revert change causing regression in selection highlight.

Bug: 26093756
Change-Id: I2c555aa38d68e9bf7962b1407f9fc75c800216a6
2015-12-14 18:17:16 +00:00
Svetoslav Ganov
3dee9db651 Merge "Change signature|system permissions to signature|privileged"
am: cfed01af4b

* commit 'cfed01af4bea6ff9025c31fbe3ed973f47529484':
  Change signature|system permissions to signature|privileged
2015-12-14 10:08:07 -08:00
Geoff Mendal
90c9a00d32 Merge "Import translations. DO NOT MERGE" 2015-12-14 17:57:56 +00:00
Michael Wright
59ec7199fa Merge "Customize auto-brightness parameters"
am: a3931897fd

* commit 'a3931897fd4f8196288e37c712ab5490d846cb38':
  Customize auto-brightness parameters
2015-12-14 09:54:02 -08:00
Svetoslav Ganov
cfed01af4b Merge "Change signature|system permissions to signature|privileged" 2015-12-14 17:53:15 +00:00
Michael Wright
a3931897fd Merge "Customize auto-brightness parameters" 2015-12-14 17:38:58 +00:00
Julia Reynolds
d1aa7ae6d7 Merge "Fix volume expand arrow to be displayed correctly"
am: caf1972dee

* commit 'caf1972dee1a63dcab130f9af1d066d6af9c38c2':
  Fix volume expand arrow to be displayed correctly
2015-12-14 09:13:56 -08:00
Zoran Jovanovic
6fc42f549a Customize auto-brightness parameters
Auto-brightness parameters are device dependent so they should be
configurable.

The common issue with original values manifests as the screen being
perceived as too bright in dark rooms with minimum brightness and
also laginess on backlight change.

Change-Id: I2b040608bca73a3397c65c24d3b28a1514499ae6
2015-12-14 18:13:25 +01:00
Brad Ebinger
355f11034d Null pointer fix for StateMachine
Checks if StateMachine is null before calling callbacks.

Bug-Id: 26176787
Change-Id: I7ee92326e99e18a3b7045ccf098b52acfaff9a15
2015-12-14 09:02:38 -08:00
Geoff Mendal
f9f297a6f3 Import translations. DO NOT MERGE
Change-Id: Ie3ac7df99ed18d2f67d886a6b53a13deb86d9f71
Auto-generated-cl: translation import
2015-12-14 17:54:50 +01:00
Julia Reynolds
caf1972dee Merge "Fix volume expand arrow to be displayed correctly" 2015-12-14 16:39:49 +00:00
Winson Chung
0a3d3884c4 Merge "Revert "Saving the stack state when you rotate."" 2015-12-14 16:35:02 +00:00
Winson Chung
8c38fd32ba Revert "Saving the stack state when you rotate."
This reverts commit bf0be0a8030b91c7e75c23230c1f89a1536aa7eb.

Change-Id: I40b852889980473aea02828b5b0fe29c21951638
2015-12-14 16:34:31 +00:00
Winson Chung
d44e1904cd Merge "Revert "Removing historical tasks when packages are uninstalled."" 2015-12-14 16:34:29 +00:00
Winson Chung
2c1cac12c7 Revert "Removing historical tasks when packages are uninstalled."
This reverts commit 5d1413e7c391fdb1325c6833399c10a8448354dc.

Change-Id: I6ca79949b4c92a5825554b91f4350685fa605c8f
2015-12-14 16:34:12 +00:00
Winson Chung
e881553866 Revert "Fixing build."
This reverts commit ae0803182a467ada59613fcbaf21b8a3537f8c2b.

Change-Id: Ieb797e73adfdbfc359ca413f49d56211ae6c70db
2015-12-14 16:34:00 +00:00
Winson Chung
ae0803182a Fixing build.
Change-Id: I4bc5dcc5026179fe2021fb39c20319fbb8f4c5cb
2015-12-14 11:19:38 -05:00
Andreas Gampe
51aeb69dd3 Merge "Frameworks/base: Fix Notification code" 2015-12-14 16:15:38 +00:00
Winson Chung
84515129ed Merge "Removing historical tasks when packages are uninstalled." 2015-12-14 15:40:41 +00:00
Winson Chung
02ba0fd81b Merge "Saving the stack state when you rotate." 2015-12-14 15:40:29 +00:00
Jason Monk
ded2b10520 Merge "Support dnd condition in Settings" 2015-12-14 15:39:55 +00:00
Winson Chung
5d1413e7c3 Removing historical tasks when packages are uninstalled.
Change-Id: I9eb1307264fab8dcace732af2290ca419fcc548a
2015-12-14 10:39:05 -05:00
Winson Chung
bf0be0a803 Saving the stack state when you rotate.
- Saving the focus and stack scroll, along with
  the history visibility on configuration change.

Change-Id: I159d2f0f6c58dac46cb3b16ee4d9e17c426ffb35
2015-12-14 10:39:01 -05:00
Winson Chung
2b9ef6548b Fix: Affiliated tasks not showing when history is enabled.
- Because these tasks may not have valid
  last-active times (they can be launched in the
  background), the historical state should reflect
  the task that they are affiliated with.

Bug: 26043228
Change-Id: I04db9effc371783a80bea80bd0a45b666269ead1
2015-12-14 15:15:57 +00:00
Alexander Toresson
5bb6dcef3f Fix volume expand arrow to be displayed correctly
Sometimes, the volume control expand arrow would be displayed
incorrectly. When different apps use different volume controls and
force different orientations, the position of the arrow (expand button)
will not be updated correctly. When this happens the arrow cannot be
pressed and the volume settings cannot be expanded.

The underlying reason is that onLayoutChange only compares the old
dimensions of a view with the new dimensions, which doesn't take into
account that the last time onLayoutChange was run it may have been run
for a different view (a different volume control), in which case the
dimensions of the new view may not have changed, but the arrow needs to
be repositioned anyway as it needs to be positioned in relation to
another view.

Fix this problem by storing the last stream (volume control) that the
arrow was positioned in relation to, and checking if we're positioning
in relation to the same stream the next time the position of the arrow
is updated.

Change-Id: Id23e7605d50857292e09c1909b3e27f01bdf5e22
2015-12-14 16:11:31 +01:00
Gustav Sennton
88b3b57341 Merge "Add functionality for changing WebView provider." 2015-12-14 14:33:56 +00:00
Geoff Mendal
7b4f85582a Merge "Import translations. DO NOT MERGE" 2015-12-14 13:56:08 +00:00
Geoff Mendal
2e746893a2 Merge "Import translations. DO NOT MERGE" 2015-12-14 13:55:28 +00:00
Geoff Mendal
b78ee352df Import translations. DO NOT MERGE
Change-Id: I3e31c8e699bedb04b82b364311d9a504527cca98
Auto-generated-cl: translation import
2015-12-14 05:55:22 -08:00
Geoff Mendal
7c359fb2ca Import translations. DO NOT MERGE
Change-Id: I5dca6baedea38294b9e84939627ac50d4cb8e6a5
Auto-generated-cl: translation import
2015-12-14 05:54:39 -08:00
Geoff Mendal
0514864947 Import translations. DO NOT MERGE
Change-Id: I1b007d3e22aef09f2a1162478a2ed9b148f67cfb
Auto-generated-cl: translation import
2015-12-14 05:27:57 -08:00
Nicolas Geoffray
93444eb74f Merge "Special case system_server to not create the JIT code cache." 2015-12-14 13:04:06 +00:00
Daichi Hirono
ea9b1daefb Merge "Add document type to MtpDatabase." 2015-12-14 05:56:23 +00:00
Felipe Leme
2d76c84cf4 Merge "Fixed ActivityChooser logic for the initial case." 2015-12-14 03:34:10 +00:00
Terry (Woncheol) Heo
f420eb1106 Merge "CEC: Prevent NPE on HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED change" 2015-12-14 02:40:03 +00:00
Jason Monk
a9927325ed Support dnd condition in Settings
- Add way to open QS detail panels directly
 - Add internal broadcast that can launch apps when dnd mode changes

Change-Id: If2b6350dc31623f3bf2f64c7eb141cff5d3d4e89
2015-12-13 16:22:37 -05:00
Ian Pedowitz
dead9e2911 Merge "DO NOT MERGE Remove more extras during notification lightening." into mnc-dr1.5-dev am: cf07154e71 am: 911dfe8861
am: 19937f924e  -s ours

* commit '19937f924e65d004855d26b4f6e356bc7a0168fa':
  DO NOT MERGE Remove more extras during notification lightening.
2015-12-13 13:16:40 -08:00