83 Commits

Author SHA1 Message Date
Jeff Sharkey
a53fb42f31 am 775bdbdb: am dc8d7048: Merge changes I7277880e,Ia5584bd6 into klp-dev
* commit '775bdbdb11ad790f45ee66e8fdf8dca3fcba969a':
  Provide calling package to ContentProviders.
  Separate root and document management.
2013-09-06 09:53:04 -07:00
Jeff Sharkey
775bdbdb11 am dc8d7048: Merge changes I7277880e,Ia5584bd6 into klp-dev
* commit 'dc8d704899716e97e59af8b6fe5f549e0229eda6':
  Provide calling package to ContentProviders.
  Separate root and document management.
2013-09-06 09:29:05 -07:00
Jeff Sharkey
a61dc8e03e Separate root and document management.
Two hidden intents for managing roots and documents, used to support
Downloads UI.  Touching an item tries launching as MANAGE_DOCUMENT
first before falling back to VIEW.  Provide MIME type for roots.

Bug: 10446265, 10531347, 10599641
Change-Id: Ia5584bd6ce3e5a9b0048e8caf1447e3053664413
2013-09-06 08:08:18 -07:00
Baligh Uddin
e2a84af53e Merge "Import translations. DO NOT MERGE" 2013-09-05 23:28:36 +00:00
Baligh Uddin
ca5d413eb9 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-05 23:28:26 +00:00
Jeff Sharkey
372750aa6f am c7b2112f: am 5d7acbd8: Merge "Filter roots based on supported MIME types." into klp-dev
* commit 'c7b2112f1ba34013fafba69cd64e9b7aabc41fa6':
  Filter roots based on supported MIME types.
2013-09-05 14:26:27 -07:00
Jeff Sharkey
c7b2112f1b am 5d7acbd8: Merge "Filter roots based on supported MIME types." into klp-dev
* commit '5d7acbd8bedbccfd64d9d790d0b3c2492acdc219':
  Filter roots based on supported MIME types.
2013-09-05 14:23:56 -07:00
Jeff Sharkey
5d7acbd8be Merge "Filter roots based on supported MIME types." into klp-dev 2013-09-05 21:19:39 +00:00
Jeff Sharkey
923396b772 Filter roots based on supported MIME types.
Using flags to indicate supported types isn't very extensible, so
use newline-separated MIME types instead.

Bug: 10514613
Change-Id: I45641fc20b423b2a0bb2df7457c274f42aa6861a
2013-09-05 13:58:04 -07:00
Baligh Uddin
52b30b3cba Import translations. DO NOT MERGE
Change-Id: I12c220afde642a096543c01fa2e07741e75051e0
Auto-generated-cl: translation import
2013-09-05 09:11:19 -07:00
Baligh Uddin
1eb0aa4b73 Import translations. DO NOT MERGE
Change-Id: I24ceb7ffe39244cb12c97067c3292b460b4a2c8f
Auto-generated-cl: translation import
2013-09-05 09:10:12 -07:00
Jeff Sharkey
3e7e5a3953 am d60228f5: am 7f95595f: Merge "Asset drop, icons for common MIME types." into klp-dev
* commit 'd60228f51168719cf00d57b43a91cc2fbf4828e8':
  Asset drop, icons for common MIME types.
2013-09-04 20:09:23 -07:00
Jeff Sharkey
762ad1f95a am 2a44d27b: am b145ac12: Merge "Fix document management permission enforcement." into klp-dev
* commit '2a44d27b1d90239e3a71386f55632ed8017b1cc6':
  Fix document management permission enforcement.
2013-09-04 20:09:19 -07:00
Jeff Sharkey
d60228f511 am 7f95595f: Merge "Asset drop, icons for common MIME types." into klp-dev
* commit '7f95595fe7c08e62e0468d1c718cdf6ebed974b0':
  Asset drop, icons for common MIME types.
2013-09-04 20:07:06 -07:00
Jeff Sharkey
2a44d27b1d am b145ac12: Merge "Fix document management permission enforcement." into klp-dev
* commit 'b145ac127ac25abd30597f798612b539107f8368':
  Fix document management permission enforcement.
2013-09-04 20:07:04 -07:00
Jeff Sharkey
7f95595fe7 Merge "Asset drop, icons for common MIME types." into klp-dev 2013-09-05 03:04:18 +00:00
Jeff Sharkey
b145ac127a Merge "Fix document management permission enforcement." into klp-dev 2013-09-05 03:04:09 +00:00
Jeff Sharkey
0b14db3cf5 Asset drop, icons for common MIME types.
Bring in latest assets from UX. Map common MIME types to specific
icons.

Bug: 10510022
Change-Id: I01ea8749ca5515a04efcbc15eb0c8cbb43e5e7ad
2013-09-04 18:46:56 -07:00
Jeff Sharkey
e37ea6123d Fix document management permission enforcement.
Allow both explicit holders of the MANAGE_DOCUMENTS permission and
those holding Uri grants to perform management tasks.

Extend grants for newly created documents when caller doesn't have
permission.  Revoke grants when deleting documents.

Test now writes actual content into picked file.  Workaround updated
flags for Drive app.

Bug: 10623211
Change-Id: Ia8e90b33e0fac8294b2cacb96d083c43fdf75aab
2013-09-04 18:43:34 -07:00
Baligh Uddin
df8fe74455 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-04 04:43:51 +00:00
Baligh Uddin
be4e1e4247 Merge "Import translations. DO NOT MERGE" 2013-09-04 04:43:51 +00:00
Jeff Sharkey
063a7462a6 am 8dd4bee2: am 5b3f4aa8: Merge "Show loading, error, and info messages as footers." into klp-dev
* commit '8dd4bee2405aa6d1868130c3cc02f68d627987f7':
  Show loading, error, and info messages as footers.
2013-09-03 21:39:17 -07:00
Jeff Sharkey
597e7e0f21 am fe0a0873: am 100558ec: Merge "Updated documents UX around action bar." into klp-dev
* commit 'fe0a0873f9a321d2602950378cb1ad117836784a':
  Updated documents UX around action bar.
2013-09-03 21:39:14 -07:00
Jeff Sharkey
8dd4bee240 am 5b3f4aa8: Merge "Show loading, error, and info messages as footers." into klp-dev
* commit '5b3f4aa84fe3f97075f4ed0763c9ee8a3dd2065d':
  Show loading, error, and info messages as footers.
2013-09-03 21:36:12 -07:00
Jeff Sharkey
fe0a0873f9 am 100558ec: Merge "Updated documents UX around action bar." into klp-dev
* commit '100558ec646f729fd59ad7cec161febb8d09dac3':
  Updated documents UX around action bar.
2013-09-03 21:36:09 -07:00
Jeff Sharkey
954be02326 Show loading, error, and info messages as footers.
A provider can include extras in their Cursors to indicate that
loading is ongoing, or include an error or informational message,
which are now shown in footer views.

Fix registration to always get change notifications.

Test provider that verifies common provider behavior of holding
a reference to "cloud" resources that are released by GC when the
remote Cursor is closed.  Also used to validate Recents behavior
for slow providers.

Bug: 10599268
Change-Id: I331c31058dbb80261e7d279b851197c65ac87e32
2013-09-03 17:02:47 -07:00
Jeff Sharkey
ded77187ef Updated documents UX around action bar.
Change action bar to match current design; drawer is always available
and navigation dropdown is used to interact with current traversal
path in hierarchy.  On first launch, show recents with drawer
expanded.  On subsequent launches, resume from last location with
drawer closed.  If last location root isn't applicable, then behave
like initial launch.  Move sort order into action bar submenu.

Delete documents using contract.  Use unstable provider when
inflating DocumentInfo from Uri.

Bug: 10330219, 10510851
Change-Id: I6e94637d70ebca156a6c5d50272e878156d0dd62
2013-09-03 14:17:10 -07:00
Baligh Uddin
ac9be317fe Import translations. DO NOT MERGE
Change-Id: I28c0f0f828b6f3d4e4627c1732929b6ee73056d0
Auto-generated-cl: translation import
2013-09-03 10:08:25 -07:00
Baligh Uddin
8213e34b14 Import translations. DO NOT MERGE
Change-Id: I17ec3c595dbf7291f781fa73ce5772d2a647ae91
Auto-generated-cl: translation import
2013-09-03 10:07:16 -07:00
Jeff Sharkey
7e6d74494a am f56ae2b9: am 118cb035: Merge "Filter roots based on incoming request." into klp-dev
* commit 'f56ae2b903a24a891cf349025c97c05134e88e59':
  Filter roots based on incoming request.
2013-09-02 20:58:57 -07:00
Jeff Sharkey
b5bf56ed0a am 92c7406b: am 7c925042: Merge "New recents behavior to match spec." into klp-dev
* commit '92c7406b853f751d45a48306f9bc1899954382eb':
  New recents behavior to match spec.
2013-09-02 20:55:26 -07:00
Jeff Sharkey
f5c2071809 am 32bfd2a3: am c22acf6f: Merge "Instance state, fix sharing, Durable objects." into klp-dev
* commit '32bfd2a398c2b5115a50d867c1ed8ae13ab33760':
  Instance state, fix sharing, Durable objects.
2013-09-02 20:55:19 -07:00
Jeff Sharkey
d0b6460021 am e1dfca29: am db06adec: Merge "Use Cursors directly when binding documents." into klp-dev
* commit 'e1dfca2989ea87b9ac6864b2bd697f59d1c0ab2a':
  Use Cursors directly when binding documents.
2013-09-02 20:55:16 -07:00
Jeff Sharkey
f56ae2b903 am 118cb035: Merge "Filter roots based on incoming request." into klp-dev
* commit '118cb0353f6dabce1a1d6b550f7fc9eb78c7de87':
  Filter roots based on incoming request.
2013-09-02 20:55:12 -07:00
Jeff Sharkey
92c7406b85 am 7c925042: Merge "New recents behavior to match spec." into klp-dev
* commit '7c925042061bf4b80cf80a7e6d94995c62eca7e1':
  New recents behavior to match spec.
2013-09-02 20:51:44 -07:00
Jeff Sharkey
32bfd2a398 am c22acf6f: Merge "Instance state, fix sharing, Durable objects." into klp-dev
* commit 'c22acf6f1fc001ad0f1c23c5261f371d63e4106e':
  Instance state, fix sharing, Durable objects.
2013-09-02 20:51:40 -07:00
Jeff Sharkey
e1dfca2989 am db06adec: Merge "Use Cursors directly when binding documents." into klp-dev
* commit 'db06adec0d25f57d0fff8788b0081f92f6e5383c':
  Use Cursors directly when binding documents.
2013-09-02 20:51:37 -07:00
Jeff Sharkey
118cb0353f Merge "Filter roots based on incoming request." into klp-dev 2013-09-03 03:50:56 +00:00
Jeff Sharkey
7c92504206 Merge "New recents behavior to match spec." into klp-dev 2013-09-03 03:50:27 +00:00
Jeff Sharkey
c22acf6f1f Merge "Instance state, fix sharing, Durable objects." into klp-dev 2013-09-03 03:50:10 +00:00
Jeff Sharkey
db06adec0d Merge "Use Cursors directly when binding documents." into klp-dev 2013-09-03 03:50:00 +00:00
Jeff Sharkey
348ad6866b Filter roots based on incoming request.
When incoming request is for local-only content, or for ACTION_CREATE,
only include roots advertise those features.

Filters roots based on the allowed MIME types and the supported types
advertised by each root.  This supports displaying Images and Audio
roots only when requesting those content types.  Applies the same
filter when deciding which roots to query for recents.

Fixes advanced filtering instead of limiting to just devices. Update
sorting so that Recent always appears first. Add testing support for
LOCAL_ONLY.

Bug: 10597317, 10526535
Change-Id: Ic5ccf475c4fe93fd52b29388d369d7f6915c0c42
2013-09-02 17:43:14 -07:00
Jeff Sharkey
a2a772035f am 8c58b792: am cd6d7dee: Merge "Refactoring of DocumentsContract." into klp-dev
* commit '8c58b79243748eeb98b650c8e660a742ad876452':
  Refactoring of DocumentsContract.
2013-09-02 17:14:37 -07:00
Jeff Sharkey
8c58b79243 am cd6d7dee: Merge "Refactoring of DocumentsContract." into klp-dev
* commit 'cd6d7deec8742e257a670db8e027f628afdf337e':
  Refactoring of DocumentsContract.
2013-09-02 17:09:15 -07:00
Jeff Sharkey
cd6d7deec8 Merge "Refactoring of DocumentsContract." into klp-dev 2013-09-03 00:07:17 +00:00
Jeff Sharkey
251097b378 New recents behavior to match spec.
Updated behavior queries each documents root for recently modified
documents.  It uses a new variant of DirectoryLoader which limits the
maximum number of parallel queries to relieve memory pressure.  When
first started, it waits up to 500ms for everyone to finish, then
publishes whatever results are ready, and then refreshes results as
each straggler finishes.

New RootCursorWrapper that always blends in authority and rootId
columns, which are used for binding root details from blended cursors.

Bug: 10593596, 10329994
Change-Id: Icc0d4a2f1b6166edc72f78a4c88f444eeba6f2f0
2013-09-02 15:33:57 -07:00
Jeff Sharkey
b51331116e Instance state, fix sharing, Durable objects.
Remember instance state across configuration changes, and enable
rotation.  This remembers current modes and in-progress traversals.

Always finish action modes after launching an action.  Fix sharing
by always putting Uris in extras, and always wrap in a chooser.  Find
common MIME types when sharing multiple documents.  Fix downloads
launching by following directory MIME type change.

Introduce "Durable" which is like Parcelable, but can be used for
both byte[] storage and Parcel transport.  Make both DocumentInfo
and DocumentStack durable.

Disable recents until new behavior is implemented.

Bug: 10460236, 10446265, 10533674, 10456344, 10456702
Change-Id: I4eaf2b0b4cde611c69a1e7b5f1586f6b02019b27
2013-09-01 18:59:38 -07:00
Jeff Sharkey
5dfb345df7 Use Cursors directly when binding documents.
Instead of creating a DocumentInfo for every list item, bind the
adapter against Cursor directly.

Create new SortingCursorWrapper which performs sorting at query time
and keeps a O(1) mapping from sorted to unsorted positions in the
underlying Cursor.

Suppress extra loader passes that had been kicked off.  Use unstable
provider when querying to guard against broken providers.

Bug: 10567506, 10510851
Change-Id: I535814da6b17c38de04a1175e0afcc78c6b966ce
2013-08-31 21:33:56 -07:00
Jeff Sharkey
ae9b51bfa3 Refactoring of DocumentsContract.
Combines related columns and constants onto the same class so they
are easier to discover.  Move back to surfacing roots with columns
so they are consistent with documents.

Advanced roots are represented with a flag instead of distinct
types.  Flags to indicate supporting of well-known media types,
instead of arbitrary an MIME filter.  Reintroduce well-formed rootId
to support recents.

Always use the expanded version of "documents" in constants, methods,
and argument names.

Refactor DocumentProvider method names to clearly distinguish if
a single item or multiple could be returned, and of which type.  Add
documentation to clearly define which methods have already been
overridden.

Bug: 10567506, 10567557
Change-Id: I981f26ab82f2b520a19aa1ce66f659de50d7fac0
2013-08-31 16:58:28 -07:00
Jeff Sharkey
98486543cc am 6607275b: am 9fd81a90: Merge "Stronger DocumentsProvider contract." into klp-dev
* commit '6607275b3a99b28f4176f8f8cc87f46c5ed051db':
  Stronger DocumentsProvider contract.
2013-08-28 21:35:17 -07:00