Commit Graph

4333 Commits

Author SHA1 Message Date
Svetoslav Ganov
32ce3c8797 Merge "[DO NOT MERGE] Don't show account access request UI until app launched." into nyc-mr1-dev 2016-09-10 00:36:21 +00:00
Svet Ganov
d63cde7ba4 [DO NOT MERGE] Don't show account access request UI until app launched.
Sync adapters that don't have account access cannot run until
the user explicitly approves in the UI. This is spammy given
the user may not use the app right away. This change doesn't
show the notificaiton until the app has run.

bug:31162498

Change-Id: I1f4f2d2e9426f78763590e8aa542b94d6e93e488
2016-09-09 15:13:07 -07:00
TreeHugger Robot
295f5108f1 Merge "Add filter ordering" into nyc-mr1-dev 2016-09-09 19:59:46 +00:00
Svet Ganov
91d37f43c7 [DO NOT MERGE] While-list apps to access account if already saw it
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). However, if the
sync adapter package already got the account from another
app which means it already saw the account we white-list
the sync adapter app to access the account as it already
saw it - the bird is out of the cage.

bug:31162498

Change-Id: I2b72f3b0d6307561ed68db2f2e9c900b15e8d098
2016-09-08 16:46:46 -07:00
Todd Kennedy
c2e96d45d2 Add filter ordering
Filter ordering allows automatic disambiguation between multiple filters
that matching a pattern. Ordering currently only works for EphemeralResolveInfo
objects.

Bug: 30837021
Change-Id: Ia217218c7c7d159dbd75d7733c45556e690d06d2
2016-09-08 15:34:03 -07:00
TreeHugger Robot
80855e154e Merge "Implement new ephemeral resolver design" into nyc-mr1-dev 2016-08-26 20:28:04 +00:00
Paul Stewart
0e164b199e Document correct context for obtaining WifiManager
Added comments to both WifiManager WIFI_SERVICE.

Bug: 25015174
Change-Id: Ibd1e21d860ef2b7cc432b3da76671d22c02ef7cb
2016-08-26 09:27:04 -07:00
Mark Lu
e16c82d224 docs: fix link in Loader reference page am: 9f52b7a4a8
am: f496b9a981

Change-Id: I7a7ee695fadb2e0774ef84724a4320fc73b45a88
2016-08-26 01:03:56 +00:00
Mark Lu
f496b9a981 docs: fix link in Loader reference page
am: 9f52b7a4a8

Change-Id: I32164f55f9b42dc50f13756c942644350a7d643e
2016-08-26 00:53:53 +00:00
Fyodor Kupolov
7540b79fee Update services info before returning authenticators
am: 814464894c

Change-Id: I3d7eb42ef73ad77cb44c251a493ae967bcc0f651
2016-08-25 00:08:38 +00:00
Fyodor Kupolov
814464894c Update services info before returning authenticators
Added RegisteredServicesCache.updateServices method which allows callers
to request an update to services for which package has been updated.

Added a call to updateServices in getAuthenticatorTypesInternal

Test: Manually tested update flow on test authenticator with an artificial
      delay in broadcast handling
Bug: 30979262
Change-Id: I499b2ee0be53fed01201c56068d929b6d621a78e
2016-08-24 22:47:38 +00:00
Svetoslav Ganov
5cb2973495 Only sync adapters with access can see an account - framework
It was possible for a sync adapter without accounts access to
see the account which it is supposed to sync which can be used to
identify the user. This change ensures that only sync adapters
with account access can run (which results in seeing the account),
otherwise we involve the user to approve access only to this account.

A sync adapter can access an account if one of these is true:
 - it is signed as the authenticator for this account
 - has the GET_ACCOUNTS permission
 - has an auth token for the account
 - it is a preinstalled app (system or privileged)

The main thing we need to figure out is if the extra prompts
for giving access to a sync adapter to the account create too
much friction.

bug:28163381

Change-Id: Ie083bb681b5a2aed81ca5f6a062193a175fad77e
2016-08-23 21:43:27 +00:00
Todd Kennedy
ef8d8ea24a No need to check package name
Change-Id: I8c403ca2bc38f2c7191b6e9a709286ac7e450ac4
Fixes: 30958291
(cherry picked from commit afb5269ad6)
2016-08-23 17:09:52 +00:00
Todd Kennedy
fea1b776e9 Implement new ephemeral resolver design
In the new design, the ephemeral installer can be returned from
queryIntentActivities which means any intent resolution could potentially
return the installer. Additionally, the new design calls for a platform
defined broadcast receiver that receives the status from the ephemeral
installer. This receiver then starts the final intent -- either to launch
the ephemeral application or to launch the fallback.

For more detail, see go/ephemeral-design

Bug: 30805203
Bug: 30273584
Change-Id: I6644bbb4f180d2d22c63af04b9857577516344a9
(cherry picked from commit 8e2d9d1d90)
2016-08-22 16:09:13 -07:00
Todd Kennedy
afb5269ad6 No need to check package name
Change-Id: I8c403ca2bc38f2c7191b6e9a709286ac7e450ac4
Fixes: 30958291
2016-08-22 15:47:22 -07:00
Mark Lu
9f52b7a4a8 docs: fix link in Loader reference page
Bug: 29764129
Change-Id: I5ca881bb30adbbaf65ba37b1cf63903a4fc5600e
2016-08-12 15:48:05 -07:00
Mark Lu
9bc63b9bf0 docs: add info to SharedPreferences.Editor.putString
am: fb48521f41

Change-Id: I948c8091a70180e29a601d6cba40d7fb0cf2d76a
2016-08-08 22:49:08 +00:00
Mark Lu
fb48521f41 docs: add info to SharedPreferences.Editor.putString
The information explains what happens when null is passed
as value parameter

Bug: 24696308
Change-Id: I362c2b1885e882312d1b4b2ff829f8f9f3546301
2016-08-02 12:10:48 -07:00
Makoto Onuki
02f338e23d LauncherApps should also throw when user is locked
otherwise it'd be racy.

Bug 30406401

Change-Id: I953eb6ae58e029d254d9fdbd5d05a0090b8d2391
2016-08-01 18:15:47 -07:00
Makoto Onuki
2ec16b08ac Revert "LauncherApps should also throw when user is locked"
This reverts commit bc4ad85d29.

Will retry when the updated launcher is in.

Change-Id: I428dc93132615480df70aeca7977089af008c041
2016-08-01 17:20:59 +00:00
Makoto Onuki
bc4ad85d29 LauncherApps should also throw when user is locked
otherwise it'd be racy.

Bug 30406401

Change-Id: Id6b0295933c5639fa23c56d737a7f0199cbd7497
2016-07-29 09:40:40 -07:00
Makoto Onuki
9c850012ca Prevent shortcut access when user is locked
Also add some test utility methods that'll be used by CTS.

Bug 30406401

Change-Id: I9396acebbdb3cbe64f6e85877ee62a2131cd6e61
2016-07-27 12:01:46 -07:00
Makoto Onuki
fe9c9669a4 Update ShortcutManager javadoc
Bug 30359231

Change-Id: I01f1987416fa1ac3f0669afa1f15f88ff2dd1631
2016-07-25 17:56:09 -07:00
Makoto Onuki
0eed441c0c Follow-up to multiple intents support
- More unit tests
 - LauncherApps.startShortcut() now supports sourceBounds
 (again)
- Updated the javadoc.

Bug 30218829

Change-Id: Iae208ffd4911d149246ccfd0c4380544c2aafffc
2016-07-21 11:33:37 -07:00
Makoto Onuki
440a1ea8e2 Support multiple intents in ShortcutInfo
Also fix b/30230996.

TODO: Support the sourceBounds argument to LauncherApps.
startShortcut().

Bug 30218829
Bug 30230996

Change-Id: Ibb6c59d5b7c0a320c21d09436d016d0eac94644f
2016-07-20 14:46:48 -07:00
Makoto Onuki
ceadb1a86a Merge "Stop adding FLAG_ACTIVITY_RESET_TASK_IF_NEEDED when..." into nyc-mr1-dev 2016-07-19 23:57:32 +00:00
Makoto Onuki
347a6bd820 Stop adding FLAG_ACTIVITY_RESET_TASK_IF_NEEDED when...
starting a shortcut.

- Also add API surface to support launching multiple intents

- Also add SM.isRateLimitingActive() which was supposed to be
added but was not due to a bad rebase.

Bug 30218829

Change-Id: I82d60ec0df1e2b889538705f9f8870ee727dd55d
2016-07-19 11:17:12 -07:00
Nicolas Prévot
e723ed8b51 Merge "Don't append userIds for the current user's clipData uris." into nyc-mr1-dev 2016-07-19 16:06:44 +00:00
TreeHugger Robot
c3829f528e Merge "Deprecate Resources constructor and updateConfiguration() method" into nyc-mr1-dev 2016-07-16 02:33:55 +00:00
Adam Lesinski
aa19d5e49e Deprecate Resources constructor and updateConfiguration() method
These methods were never meant to be public. Instead, developers
can use Context#createConfigurationContext().

Bug:30088019
Bug:29999297
Change-Id: I2b864136163deda0af99fa3bfe9ef4ee1077341a
2016-07-15 18:01:48 -07:00
Makoto Onuki
cf99263662 Merge "Cache the default launcher." into nyc-mr1-dev 2016-07-15 22:22:34 +00:00
Makoto Onuki
a97256b793 Fix the allowed icon type error message
Bug 30162778

Change-Id: I925c563c1924c6525fe17afc44626d62864ba7e1
2016-07-15 13:23:54 -07:00
Makoto Onuki
1030520822 Cache the default launcher.
Originally we always checked with PM for the default launcher,
which would take ~2ms.

Now we cache the result, and clears the cache when (any) preferred
activities change.

Bug 30126557

Change-Id: Iceef288cd372c8bb9b119aa493e5173d894f2302
2016-07-15 12:57:03 -07:00
Makoto Onuki
83fa7a8255 Merge "Handle locale change and pacakge change in different way" into nyc-mr1-dev 2016-07-15 00:39:06 +00:00
Nicolas Prevot
58926243e0 Don't append userIds for the current user's clipData uris.
If the primary user has a managed profile:
When setting the clipboard in the primary user:
The uris of the primary user's clipboard must not have an
embedded userId.

BUG:28572936

Change-Id: I1eb505c4518cc16a6513b950f6c2b1232a22426d
2016-07-14 18:43:02 +00:00
Adam Lesinski
ce9cf64eb3 Merge \"Don\'t hold on to AssetManager instances\" into nyc-dev
am: f8e99e72e7

Change-Id: I71b7499c6399ecbf1d8e8d93bf410aabbb2a1044
2016-07-14 01:50:52 +00:00
Makoto Onuki
4e6cef49ef Handle locale change and pacakge change in different way
- Stop using a custom callback from AM to detect locale changes
and use the LOCALE_CHANGED broadcast instead.

- This would open up a chance where a publisher app fetches
its won manifest shortcuts after a locale change but
ShortcutManager hasn't updated string resources.

- So instead, at every entry point from ShortcutManager, check
if the locale has changed, and if so, update all resources
(and reset throttling).

- Do the same for package change events too.  At every entry point
from ShortcutManager, check if the caller package has been updated,
or any target activities have been disabled.  If so, rescan the
caller package.

- We do *not* do the same check at the LauncherApps entry points,
because the launcher should use the callback to listen to
shortcut changes.

- Also stopped using PackageMonitor for now because we want to
set a higher priority and changing PackageMonitor at this point
seems too much for DR.

Bug 29895275
Bug 30123329

Change-Id: Ib4a2f626a936c7328e2cc032324f5c3d1c3b9122
2016-07-13 17:37:06 -07:00
Adam Lesinski
e60064ab3c Don't hold on to AssetManager instances
If we enter multi-window mode or load WebView
assets into a Resources object, then the underlying
AssetManager instance may change.

crbug.com/627586

Bug:30118654

Change-Id: I837637bdad5370809db7f060d7d8536b536cad9e
2016-07-14 00:22:12 +00:00
Makoto Onuki
f34c308dfd Revert "Revert "Revert "Handle package broadcasts before apps do"""
This reverts commit 886ba78dfb.

With the tests updated.

Change-Id: I162e6ca23c667f90feddc1e9f42b554a416295cf
2016-07-13 10:40:31 -07:00
Makoto Onuki
886ba78dfb Revert "Revert "Handle package broadcasts before apps do""
This reverts commit efbbe7ea9d.

Change-Id: I3dbb080db5121307f533a7d411f4f5d47225500e
2016-07-13 17:08:26 +00:00
Makoto Onuki
efbbe7ea9d Revert "Handle package broadcasts before apps do"
And fix b/29939691 (don't try to load locked users) in a different way

Bug 29939691
Bug 29895275

Change-Id: Ib55f9c5d5547c54daa4e05c1e50bf4bbceaf1991
2016-07-12 14:47:20 -07:00
Makoto Onuki
83f6d2da37 Throw ActivityNotFoundException when failed to launch shortcut
Originally the code used IIntentSender, but I had to switch to calling
startActivitiesInPackage() directly, because sendIntentSender() does
not support returning errors.

Bug 30035853

Change-Id: I5d7669c96a2f1805373c71aebf45b97ac1d01ff6
2016-07-11 14:37:18 -07:00
Makoto Onuki
ae13eee9c6 Merge "Handle package broadcasts before apps do" into nyc-mr1-dev 2016-07-11 21:29:59 +00:00
Jeff Sharkey
9dbc259b4f Merge "Revert "Treat everyone the same."" into nyc-mr1-dev 2016-07-11 21:23:31 +00:00
Makoto Onuki
a2241834a5 Handle package broadcasts before apps do
- Have PM to call the shortcut manager directly before sending a
pacakge broadcast.

- The shortcut manager will enqueue a task to handle a package
broadcast, which will be executed on Handler.

- At the entry points of all external facing methods, block until
all pending tasks are finished.

Bug 29895275

Change-Id: Ib29fa3c9c8d9b9e0ca5c8f1e9da2a390324960a4
2016-07-11 11:28:10 -07:00
Jeff Sharkey
f9c41aeeb5 Revert "Treat everyone the same."
This reverts commit 7678aeddd9.

Bug: 30051184, 29746499
Change-Id: Ibd8bc2771d67c4db61c82dcc8a569eb8adfef8de
2016-07-11 16:22:29 +00:00
Makoto Onuki
4a91096a4c ShortcutManager javadoc
Bug 29515722

Change-Id: If4805a7f28a2ee602094fca06eb1ff30f258dc1e
2016-07-11 09:08:49 -07:00
TreeHugger Robot
6ac6ceb28b Merge "Add values to ApplicationInfoFlags" into nyc-mr1-dev 2016-07-07 23:15:26 +00:00
Todd Kennedy
5a32c6c290 Add values to ApplicationInfoFlags
Need to add MATCH_DISABLED_UNTIL_USED_COMPONENTS [and the deprecated
GET_DISABLED_UNTIL_USED_COMPONENTS] since those are used when building
the ApplicationInfo object.

Bug: 29824931
Change-Id: I09b24427222fed082f0946717826d2e0db857c7a
2016-07-07 14:29:06 -07:00
Makoto Onuki
07e234c9d7 Merge "Hide more shortcut APIs" into nyc-mr1-dev 2016-07-07 20:52:23 +00:00