Commit Graph

4900 Commits

Author SHA1 Message Date
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
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
TreeHugger Robot
ccec35c456 Merge "Add tests, refactor min/targetSdkVersion checks in PackageParser" 2016-12-19 22:23:12 +00:00
Mark Lu
e4ffa3a53c docs: remove implicit intent from bindService and startService am: 94ebbe0e58 am: d7c29565ba am: 8c232935f0
am: 40a3877a5d

Change-Id: I3ae34d2268d7d142ac10e17b43dc617c25601cbe
2016-12-19 20:40:56 +00:00
Alan Viverette
82f4b263a0 Add tests, refactor min/targetSdkVersion checks in PackageParser
Tests were added and verified before refactoring to ensure no behavior
changes. This is the first step in revising compat checks for O policy.

Bug: 33455703
Test: PackageParserTest#testComputeMinSdkVersion
Test: PackageParserTest#testComputeTargetSdkVersion
Change-Id: I483b4d23945183702b7e077fa1bd6d3ab5065acc
2016-12-19 15:40:05 -05:00
Mark Lu
40a3877a5d docs: remove implicit intent from bindService and startService am: 94ebbe0e58 am: d7c29565ba
am: 8c232935f0

Change-Id: I45cdec5b2820a4a95a8aa6e1b67856891a8a6cd5
2016-12-19 20:34:23 +00:00
Mark Lu
8c232935f0 docs: remove implicit intent from bindService and startService am: 94ebbe0e58
am: d7c29565ba

Change-Id: Ife9581030d8579d6e2dd625814a049d5f488229a
2016-12-19 20:27:56 +00:00
Calin Juravle
12e15a9c22 Merge "Report non-primary dex files loads to PM" 2016-12-19 11:23:53 +00:00
Tomasz Mikolajewski
d8a2e19493 Update documentation for ACTION_SEND.
Test: Documentation only.
Bug: 28409713
Change-Id: I6efc4e80a7289ab25e491c29fbd92e10c1b50281
2016-12-19 14:08:11 +09:00
Mark Lu
94ebbe0e58 docs: remove implicit intent from bindService and startService
bug: 18295867
Change-Id: Ib4b561dd215f4b124ce9a90b446bc03676f7e00a
2016-12-17 07:23:45 +00:00
TreeHugger Robot
10ec36772f Merge "Implicitly expose activities" 2016-12-17 00:19:19 +00:00
Todd Kennedy
388eb8c4a2 Implicitly expose activities
Activities that have a browsable web intent filter [action.VIEW,
category.BROWSABLE and http(s) scheme] are implicitly exposed to
instant apps. Authors can explicitly hide these activities by
using the attribute android:visibleToInstantApp="false".

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: I88b277a719e7ecd5631f8cbd281757eb3e3d2ce6
2016-12-16 14:55:06 -08:00
Joe Onorato
10e237e5c8 Merge changes from topic 'incident_1'
* changes:
  First checkin of incident reporting.
  Add a native class to interact with DropBoxManager.
2016-12-16 18:19:50 +00:00
Makoto Onuki
de315b99dc Merge "ShortcutManagre: foreground check, more tests." 2016-12-16 17:01:35 +00:00
Mark Lu
bce1e456dc docs: changes to broadcast documentation am: 33ec106d22 am: 377dab8ab3 am: fd737791e8
am: 45d6ba7b98

Change-Id: I2dcb6bc7f8ebf385bc7d6a571a760c140a65e9fb
2016-12-16 05:30:20 +00:00
Mark Lu
45d6ba7b98 docs: changes to broadcast documentation am: 33ec106d22 am: 377dab8ab3
am: fd737791e8

Change-Id: I18b47ba01b0af8882c25526d8823f263f456aae2
2016-12-16 05:14:34 +00:00
Mark Lu
fd737791e8 docs: changes to broadcast documentation am: 33ec106d22
am: 377dab8ab3

Change-Id: I2e8377b188ce6a10ea633e089c3a20f9ef7908fd
2016-12-16 05:06:42 +00:00
TreeHugger Robot
624a821c8d Merge "Fix IntentFilter#getAutoVerify()" 2016-12-16 03:58:27 +00:00
Tamas Berghammer
2688cfcc4a Merge "Install all files from the lib directory for debuggable apps" am: c0cc7c646c am: 736852e2c4 am: db274f7859
am: 362775ee20

Change-Id: I9194b856610e7b102bc46705fb2cb6937def7023
2016-12-16 03:50:40 +00:00
Tamas Berghammer
362775ee20 Merge "Install all files from the lib directory for debuggable apps" am: c0cc7c646c am: 736852e2c4
am: db274f7859

Change-Id: I4bd6e3da9c41fcfb9a5d8f39c63da446515fc9ff
2016-12-16 01:46:39 +00:00
Tamas Berghammer
db274f7859 Merge "Install all files from the lib directory for debuggable apps" am: c0cc7c646c
am: 736852e2c4

Change-Id: I0faa3ab541ca8d1400719653171b4bcafceada81
2016-12-16 01:21:31 +00:00
Treehugger Robot
c0cc7c646c Merge "Install all files from the lib directory for debuggable apps" 2016-12-16 00:35:55 +00:00
Makoto Onuki
a01f4f03e9 ShortcutManagre: foreground check, more tests.
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 test8

Bug 32908854

Change-Id: I30ba421e9730741776c1936e40ccf7b7431289da
2016-12-15 15:58:41 -08:00
Christopher Tate
3decab60ac Fix IntentFilter#getAutoVerify()
Also fix the verification result display in dumpsys.

Bug 21490494

Change-Id: I043bd9a7cc0dc6bf4490b5501682aef63cbe5c72
2016-12-15 14:41:57 -08:00
Joe Onorato
1754d744a7 First checkin of incident reporting.
There are a few major pieces here:

incidentd
---------
This daemon (started by init) runs and accepts incoming requests to take
incident reports.  When prompted, it calls into various system services
and fills in an IncidentProto data structure, and then writes the report
into dropbox.

The next steps for incidentd:
    - Security review of SELinux policies. These will be a subset of
      the dumpstate permissions.  Until this is done, incidentd is
      not started at boot time.

incident
--------
This shell command calls into incidentd, and can initiate an incident
report and either capture the output or leave for dropbox.

incident_report
---------------
This host side tool can call adb shell with the correct parameters
and also format the incident report as text.  This formatting code
was left of the device on purpose.  Right now it's pretty small, but
as the number of fields increases, the metadata and code to do the
formatting will start to grow.

The incident_report command also contains a workaround to let it
work before incidentd is turned on by default.  Right now, it is
implemented to call adb shell dumpsys <service> --proto directly,
whereas in the future it will go through the full incidentd flow.

incident_section_gen
--------------------
A build-time tool that generates a stripped down set of information
about the fields that are available.

libincident
-----------
This library contains the code to connect to incidentd, and the
meta proto definitions that are used by the framework protos.
The basics are here now, but they are not fully fleshed out yet.
The privacy.proto file contains annotations that can go in the
proto file that we will later use to filter which fields are
uploaded, and which are used by local sources.  For example, a
device in a test lab is safe to upload much much more information
than a real user.  These will share the same mechanism, but the
user's output will be filtered according to these annotations.

frameworks/core/proto
---------------------
These .proto files contain the definitions of the system's
output.  There is one master android.os.IncidentProto file that
is the top level of an incident report, but some other services
(notification, fingerprint, batterystats, etc) will have others
that are used directly by the logging mechanism.

Other files which are shared by several of the services also go
here, such as ComponentName, Locale, Configuration, etc.  There
will be many more.

There is also a first iplementation of a dump method handling
--proto in the fingerprint service.

IncidentManager
---------------
The java API to trigger an incident report.

Test: Not written yet
Change-Id: I59568b115ac7fcf73af70c946c95752bf33ae67f
2016-12-15 11:23:05 -08:00
Makoto Onuki
ab99c11c55 Merge "ShortcutManager: direct pin shortcut support." 2016-12-15 17:59:39 +00:00
Lenka Trochtova
73aeea2da2 Make master clear constants system APIs.
This is needed for unbundling of the OobConfig apk.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases --test com.google.android.gts.devicepolicy.DeviceOwnerUserRestrictionTest#testFactoryReset_disallowFactoryReset

Bug: 32974361

Change-Id: I71e7270bb4c3234ec0516382b18a2ca35aab4c81
2016-12-15 13:25:09 +01:00
TreeHugger Robot
a9db0faecd Merge "Delay SharedPreferences.apply() by 50 ms" 2016-12-15 03:13:39 +00:00
Philip P. Moltmann
3349644872 Delay SharedPreferences.apply() by 50 ms
... so that multiple applies can be combined into a single write.

Do do this I replaces the executor in the QueuedWork by a more Android-y
handler.

Test: Ran shared preferences CTS tests. Looked at log and saw a lot of
      skipped writes
Bug: 33385963

Change-Id: I8f33df717be7091532930ccf6ca8c48940e4edd4
2016-12-14 15:48:39 -08:00