Commit Graph

4928 Commits

Author SHA1 Message Date
TreeHugger Robot
5471cfc750 Merge "Add doc to Configuration.setTo() method" 2017-01-17 19:21:26 +00:00
TreeHugger Robot
91f5cbf3a0 Merge "Add OFFSET and LENGTH args for paged queries." 2017-01-17 19:14:52 +00:00
Kang Li
0bf67a29d9 Merge "Adds annotations to Intent, and enables ChooserActivity to rank apps according to annotations." 2017-01-16 21:36:09 +00:00
Narayan Kamath
f5bda2874f Merge "PackageParser: Disable package cache on "eng" builds." 2017-01-16 13:28:49 +00:00
Bartosz Fabianowski
9e0642287e Merge "Add install reason" 2017-01-14 12:58:20 +00:00
Kang Li
9fa2a2cd46 Adds annotations to Intent, and enables ChooserActivity to rank apps
according to annotations.

Test: Unit tests and manul tests. More unit tests to be added.
Change-Id: I3cbfd0cc10007290585fa3e7e3c92e1731f1f7b8
2017-01-13 17:40:44 -08:00
Zak Cohen
9013325c3a Merge changes from topic 'vrmode'
* changes:
  Set ui mode in UiModeManagerService to vrheadset when VR mode is enabled.
  Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
2017-01-13 23:15:00 +00:00
Chet Haase
d30149eeae Add doc to Configuration.setTo() method
Bug: 11187275
Test: doc fix only, no test
Change-Id: I121aa2e986dacbb794a26fdfba84f4f7b34bea86
2017-01-13 12:55:16 -08:00
Narayan Kamath
21a2838e34 PackageParser: Disable package cache on "eng" builds.
- Catch a wider variety of exceptions from the package parse
  stage. Ignore and delete the cache entry if we catch *any*
  exceptions from deserializing the parse result.

- Rename the system property pm.boot and not ro.boot, since the
  former needs less effort to change back and forth.

- Finally, add a heuristic to wipe caches on non-numbered
  userdebug builds when changes to the system partition are detected.

Also re-enable the cache by reverting commit
20274d15d8.

Test: Manual
Change-Id: I7b5b71ac60d8c438398c354be50b207e80550148
2017-01-13 16:09:05 +00:00
Bartosz Fabianowski
a34f53f61b Add install reason
This CL allows a reason to be specified when installing a package. The
install reason is a sticky piece of metadata: When a package is e.g.
installed via enterprise policy and an update is then manually
installed or sideloaded, the install reason will remain "policy."
The install reason is tracked separately for each user.

With this CL, two install reasons exist: "policy" and "unknown." Other
install reasons will likely be supported in the future.

Bug: 32692748
Bug: 33415829
Test: Tested manually with "adb install" / "adb uninstall"

Change-Id: I0c9b9e1b8eb666bb6962564f6efd97e41703cd86
2017-01-13 16:51:28 +01:00
Steve McKay
d7ece9f78d Add OFFSET and LENGTH args for paged queries.
Also update docs according to parting comments on ag/1726256.

Bug: 30927484
Test: Build and update api.
Change-Id: Ie0dd3ae06f6a7a20001571beec10a4d5bca63970
2017-01-12 17:33:49 -08:00
TreeHugger Robot
07323a9824 Merge "Add structured sort data to ContentResolver.query." 2017-01-12 22:21:53 +00:00
Jeff Sharkey
0078e1b777 Add support for fallback categories.
When an app doesn't define a category, look for a fallback category
in a hard-coded list.  This change only defines a fallback for a
single package, but device-specific overlays can be used to provide
more detailed fallback lists.

The precidence order is: app manifest > installer hint > fallback

Test: builds, boots, fallback categories work
Bug: 33815939
Change-Id: I1f5ca76fb7e5743a4500c0a1230a754266f34d9e
2017-01-12 09:53:44 -07:00
Jeff Sharkey
9bc89af3f1 Add API for apps to declare their "category".
Upcoming platform features need to cluster apps together into broad
categories to help summarize information to users.  (For example,
when presenting battery, network, and disk usage.)

We are tightly limiting the set of categories to keep them easily
presentable to users when summarizing information.  This feature is
not designed to be a general-purpose taxonomy, nor should it be
allowed to become one.

Older apps may not have defined a category in their manifests, so
allow the installing app to define a category on their behalf.

Test: builds, boots
Bug: 33815939
Change-Id: I785b882ee7c18072ef47d56e0fc19ad72888e1b7
2017-01-12 09:53:44 -07:00
Etan Cohen
7a36073c14 Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)" am: dfe8f5dc13 am: 2a4e3bef2c am: b32dfa4ef5
am: 3fc5b186fa

Change-Id: Ib668ed15ccf1f05c5ed31f700b69e1f3ab8b4cac
2017-01-11 23:28:20 +00:00
Etan Cohen
3fc5b186fa Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)" am: dfe8f5dc13 am: 2a4e3bef2c
am: b32dfa4ef5

Change-Id: If2a6b632cd03984921572b190745865953a8e808
2017-01-11 23:22:51 +00:00
Etan Cohen
b32dfa4ef5 Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)" am: dfe8f5dc13
am: 2a4e3bef2c

Change-Id: I6f894d92451032657678639c3021eef07289a6a2
2017-01-11 23:17:19 +00:00
Steve McKay
29c3f68cfa Add structured sort data to ContentResolver.query.
Update DocumentsProvider to override
    ContentProvider#query(Uri, String[], Bundle, CancellationSignal);
Added an otherwise unneeded import to pass doc check
    on DocumentsProvider.

Bug: 30927484
Change-Id: I295c21f53901d567455286f22439f21d22a8a25a
Test: Build and run. Test from DocsUi.
2017-01-11 15:01:50 -08:00
Makoto Onuki
7f53ac1504 Merge "Expose getApplicationInfo(UserHandle)" 2017-01-11 21:56:24 +00:00
Makoto Onuki
458e54f00f Merge "@hide RetentionPolicy.SOURCE annotation" 2017-01-11 21:14:20 +00:00
Zak Cohen
1a6acdbb86 Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
Bug: 30989383
Test: Unit test for aapt2
Change-Id: I66dc65af6327b94fed74538bee08cada0b8be4fa
2017-01-11 11:44:47 -08:00
Etan Cohen
6a4b323f08 [AWARE] Unhide Wi-Fi Aware API (baseline)
Baseline Wi-Fi Aware API providing discovery and connectivity (data-path).

Bug: 30983968
Test: unit tests + integration (sl4a) tests passing.
Change-Id: Idd7c6a625f168717b083d5f13e291ce916571933
2017-01-11 11:13:26 -08:00
Makoto Onuki
db3b10a95e Update the javadoc on requestPinShortcut() about multiple...
requests in a row form the same app.

Bug 34175917
Test: Javadoc change only; presubmit test.

Change-Id: Ibf33010dbd9080c557112e15efcadd30d95b121f
2017-01-10 15:43:20 -08:00
Makoto Onuki
f5663b13c5 @hide RetentionPolicy.SOURCE annotation
Bug 34094103

Test: Hiding an annotation only; "m".
Change-Id: I7e0bec077a96024744977147c4b15cf2e3a1f309
2017-01-09 14:09:56 -08:00
Makoto Onuki
4f6b884f8a Expose getApplicationInfo(UserHandle)
Test: The method already available; just making it public.
Bug 33293439

Change-Id: Ic18eb254c185784ea9f16e0a8de6c62d6c1fe7bd
2017-01-09 10:30:57 -08:00
Jeff Sharkey
8d729e8c14 Merge "Initial API shape for storage statistics." 2017-01-07 16:18:38 +00:00
Stefan Kuhne
643ba812eb Merge "Apps which do not support density cannot be resized" 2017-01-07 01:35:02 +00:00
Makoto Onuki
9fd9019cf1 Revert "ShortcutManager: Floating shortcuts shouldn't have target activities."
This reverts commit 106ff7a0a1.

Test: All the unit tests (ShortcutManagerTest1*) CtsShortcutHostTestCases and CtsShortcutManagerTestCases

Change-Id: Iadce2b3785cbf728daa60c4e2ff103e516d85896
2017-01-06 11:17:08 -08:00
skuhne@google.com
7e85eb0278 Apps which do not support density cannot be resized
This is to prevent apps which do not support density
(so essentially pre-Doughnut) from being resized and / or
windowed in free form mode.

These apps are rendered into a smaller sized buffer and
then scaled onto the screen. Using freeform window mode with
these apps uncovered many different problems.

Bug: 33843467
Test: Pre-N as well as Pre-Doughnut applications are presented
properly in free form mode. (Pre-Doughnut cannot be windowed /
resized, many M apps can).
Change-Id: I3c0eb3681486dc85ace15955432d79200743bce3
2017-01-06 08:39:41 -08:00
Jeff Sharkey
e8cece9f20 Initial API shape for storage statistics.
This API is designed to provide both UID-level stats and overall
summary data for a given storage device, as identified by UUID.

The use of UID-level granularity might appear a bit clunky, but it
matches other usage statistics (such as network and battery), and it
allows us to implement it using an extremely fast quota kernel
feature.

A future CL will wire up the implementation to installd.

Test: builds, boots
Bug: 32206268
Change-Id: I7b51877682d0370c2402c19346f57809f0e7ac53
2017-01-05 15:39:16 -07:00
John Reck
874d45597f Merge "Workaround for custom TypedArray injectors" 2017-01-05 19:00:00 +00:00
Narayan Kamath
8af18a6fa3 Merge "PackageParser: Add serialization mechanism for parse results." 2017-01-05 09:55:40 +00:00
John Reck
abd917d139 Workaround for custom TypedArray injectors
Fixes: 33814858
Works around a crash for apps that inject custom
TypedArrays, which is completely unsupported, but
given the ease with which the crash can be worked
just going with higher compatibility on this one.

Test: App referenced in bug launches

Change-Id: Iac9a9b4fefd08815544211ffa49b02259920381f
2017-01-04 19:06:52 -08:00
TreeHugger Robot
243d13bd5c Merge "Require APK Signature Scheme v2 for ephemeral APKs" 2017-01-04 20:52:33 +00:00
Alex Klyubin
abbc2badf5 Require APK Signature Scheme v2 for ephemeral APKs
This makes Package Manager require APK Signature Scheme v2 signatures
for ephemeral APKs. This part of the effort to deprecate the v1
signature scheme based on JAR signing.

Test: cts-tradefed run singleCommand cts --skip-device-info --skip-preconditions --skip-connectivity-check --abi arm64-v8a --module CtsAppSecurityHostTestCases -t android.appsecurity.cts.PkgInstallSignatureVerificationTest
Bug: 33700225
Change-Id: I3b408487c07085c0a7924d3eca495bdcb344b32d
2017-01-04 11:28:47 -08:00
Sunny Goyal
87a563e070 AppWidgetManager: direct add widget support.
Test: Manual test and all the unit tests:
adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
... to test9
adb shell am instrument -e class com.android.server.appwidget.AppWidgetServiceImplTest -w com.android.frameworks.servicestests

Bug 32404406
Change-Id: Icd6d4cbd25d9cdf4508da725d95d6401cc3a46a7
2017-01-03 13:28:56 -08:00
Narayan Kamath
fb2afbf7fa PackageParser: Add serialization mechanism for parse results.
Also adds unit tests that assert that the cached value is equivalent
to the parsed value.

bug: 30792387
Test: PackageParserTest
Change-Id: Ibf6dfd1225243b436e3d7473170c2ccc31cfbbd7
2017-01-03 15:55:09 +00:00
Tony Mak
bf9928de18 Make sure ServiceConnection callback is called in main thread
Fix: 33568999

Test: cts-tradefed run cts --module CtsDevicePolicyManagerTestCases
--test com.android.cts.devicepolicy.DeviceOwnerPlusManagedProfileTest

Change-Id: I14c8b5b1f78192429e68a3057430406245a909c8
2016-12-29 14:07:46 +00:00
TreeHugger Robot
37d37f0fa9 Merge "Settings recovery support" 2016-12-22 09:19:13 +00:00
Svetoslav Ganov
e080da9ee0 Settings recovery support
This change allows the system to perform iterative reset
of changes to settings in order to recover from bad a
state such as a reboot loop.

To enable this we add the notion of a default value. The
default can be set by any package but if the package that
set it is a part of the system, i.e. trusted, then other
packages that are not a part of the system, i.e. untrusted,
cannot change the default. The settings setter APIs that
do not take a default effectively clear the default. Putting
a setting from a system component always makes it the
default and if the package in not trusted then value is
not made the default. The rationale is that the system is
tested and its values are safe but third-party components
are not trusted and their values are not safe.

The reset modes from the least intrusive are: untrusted
defaults - reset only settings set by untrusted components
to their defaults or clear them otherwise; untrusted clear
- clear settings set by untrusted components (or snap to
default if provided by the system); trusted defaults - reset
all settings to defaults set by the system or clear them
otherwise.

Also a package can reset to defaults changes it made to
the global and secure settings. It is also possible to
associate a setting with an optional token which can then
be used to reset settings set by this package and
associated with the token allowing parallel experiments
over disjoint settings subsets.

The default values are also useful for experiment (or
more precisely iterative tuning of devices' behavior in
production) as the stable configuration can be set to
the "graduated" safe defaults and set the values to the
experimental ones to measure impact.

Test: tests pass

Change-Id: I838955ea3bb28337f416ee244dff2fb1199b6943
2016-12-22 01:14:28 +00:00
Ben Lin
836f9249b7 Unihiding REFRESH_SUPPORTED and ContentProviderClient#refresh.
Test: Only unhiding previously hidden methods.
Change-Id: Id1731b64b86760d3249855d685d8cb83721596fc
2016-12-21 11:45:33 -08:00
Jeff Sharkey
75e7b8c9ee Merge "Finish up API for missing content:// flags." 2016-12-21 19:28:05 +00:00
Jeff Sharkey
f8efc66773 Merge "Relax protected broadcast checks for shell." 2016-12-21 18:49:30 +00:00
Fyodor Kupolov
457608986c Revert "Settings recovery support"
This reverts commit aa31697424.

Fixes: 33799277
Change-Id: I438e97c6a81512c673f20f6a01d3b9715c2dbf8a
2016-12-21 18:26:21 +00:00
Jeff Sharkey
f361f2fc89 Finish up API for missing content:// flags.
Feature is already built under the hood, but it needs it's own public
StrictMode API so it can be independently enabled.

Test: builds, boots
Bug: 32447617
Change-Id: I3c0c6d62dd36aaf25f30e0ef8e0e7b40cf32c6d2
2016-12-21 10:48:47 -07:00
Jeff Sharkey
6a34e56780 Relax protected broadcast checks for shell.
On userdebug/eng devices, the shell can run as non-shell UIDs, so
define a flag to identify broadcasts coming from the shell, and
don't yell if they're non-protected.

Test: builds, boots, root shell can send broadcasts
Bug: 32369665
Change-Id: I5f55930ee434cb8318c86aaf05eba3c59a326694
2016-12-21 10:13:53 -07:00
Calin Juravle
5be781d874 Merge "Report non-primary dex files loads to PM" am: f23ea2ca62 am: 78b3889804
am: 9947e79b26

Change-Id: I8ddb7756c0690584343cb026a298bc5f0b8d4e27
2016-12-21 10:14:42 +00:00
Calin Juravle
9947e79b26 Merge "Report non-primary dex files loads to PM" am: f23ea2ca62
am: 78b3889804

Change-Id: Iaf17def2729170403fa61ce0e09ced4675a47191
2016-12-21 10:09:45 +00:00
Svet Ganov
aa31697424 Settings recovery support
This change allows the system to perform iterative reset
of changes to settings in order to recover from bad a
state such as a reboot loop.

To enable this we add the notion of a default value. The
default can be set by any package but if the package that
set it is a part of the system, i.e. trusted, then other
packages that are not a part of the system, i.e. untrusted,
cannot change the default. The settings setter APIs that
do not take a default effectively clear the default. Putting
a setting from a system component always makes it the
default and if the package in not trusted then value is
not made the default. The rationale is that the system is
tested and its values are safe but third-party components
are not trusted and their values are not safe.

The reset modes from the least intrusive are: untrusted
defaults - reset only settings set by untrusted components
to their defaults or clear them otherwise; untrusted clear
- clear settings set by untrusted components (or snap to
default if provided by the system); trusted defaults - reset
all settings to defaults set by the system or clear them
otherwise.

Also a package can reset to defaults changes it made to
the global and secure settings. It is also possible to
associate a setting with an optional token which can then
be used to reset settings set by this package and
associated with the token allowing parallel experiments
over disjoint settings subsets.

The default values are also useful for experiment (or
more precisely iterative tuning of devices' behavior in
production) as the stable configuration can be set to
the "graduated" safe defaults and set the values to the
experimental ones to measure impact.

Test: tests pass

Change-Id: I8c23b145d4f8ee0de2f29dedaa4641ac59343d6a
2016-12-20 13:05:09 -08:00
Tomasz Mikolajewski
080a88ed63 Merge "Update documentation for ACTION_SEND." 2016-12-20 05:03:54 +00:00