Commit Graph

4879 Commits

Author SHA1 Message Date
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
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
Calin Juravle
8d2a51f1b8 Report non-primary dex files loads to PM
Scaffold for the reporting of non-primary dex files loads to the package
manager.

This will enable:
1) monitoring and compilation of secondary dex file
2) better way to track foreign dex file usage (used to determined the
compilation filter of apks).

Test: device boots
Bug: 32871170
Change-Id: Ib0fe076af2c734dd054f092247a1ec7e2a74a70d
2016-12-14 18:01:54 +00:00
Michal Karpinski
e093a98925 Merge "Fix javadoc for PackageManager#getNameForUid()" 2016-12-14 11:44:02 +00:00
Michal Karpinski
d1c710d5cf DO NOT MERGE [DPM] Management and retrieval of network logs
am: 4c47adef60

Change-Id: I39486c9d6116023f1ee9bd576b7fcd0fe20023a1
2016-12-14 10:51:33 +00:00
Mark Lu
33ec106d22 docs: changes to broadcast documentation
- move BroadcastReceiver info to developer guide. see cl/140402421
- add usage note to CONNECTIVITY_ACTION broadcast

bug:32533262
bug:33106411

Change-Id: Ic2aa517831d29418e0c42aa6fc1e7f9aeb50f802
2016-12-13 18:28:32 -08:00
Ruben Brunk
58369e3d53 Prevent crash on uninstall. am: 12ab5e1d70
am: a1501095cf

Change-Id: I62bbc3c8e228b6dcda8d8edcb22d29634cabf271
2016-12-14 00:41:45 +00:00
Ruben Brunk
a1501095cf Prevent crash on uninstall.
am: 12ab5e1d70

Change-Id: I8301d17bb0bbd16a4adeaadb7b7bd04ad7159407
2016-12-14 00:34:59 +00:00
Rob Carr
b8eac24ff2 Merge "Correct error in Configuration.updateFrom" 2016-12-13 22:34:30 +00:00
Michal Karpinski
cb67dc9ead Fix javadoc for PackageManager#getNameForUid()
Change-Id: Ia4fbd6948ab0703c7df9dceae99170ffb8c96ddb
2016-12-13 18:20:23 +00:00
Makoto Onuki
2d895c3efd ShortcutManager: direct pin shortcut 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 test8

Bug 32908854

Change-Id: I11b81656959cccfb4efa83f08380b915e6eb84a6
2016-12-13 09:56:03 -08:00
Michal Karpinski
4c47adef60 DO NOT MERGE [DPM] Management and retrieval of network logs
This CL follows up on ag/1530343 and adds:
1) Various network events.
2) Retrieval method in DPM and APIs in DeviceAdminReceiver.
3) Extension of NetworkLogger and it's NetworkLoggingHandler.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Bug: 29748723
Change-Id: I42a1a477e7c75c109a3982f809c22732b814e8b2
2016-12-13 17:19:22 +00:00
TreeHugger Robot
cf4d2ce358 Merge "Introduce TextClassificationManager." 2016-12-12 21:42:19 +00:00
Abodunrinwa Toki
8158af53e8 Introduce TextClassificationManager.
This handles smart selection and language detection features.
This CL only contains code to integrate the TextClassificationManager.
Implementation will be added in a follow up CL.

Test: Test will be added when TextClassificationManager is added.
Bug:32503402
Change-Id: I5f22150ff998156fbc91b51c733d93478efaa51f
2016-12-12 19:52:31 +00:00
TreeHugger Robot
72d633f430 Merge "Scope package manager queries for ephemeral apps" 2016-12-12 19:11:38 +00:00
Todd Kennedy
7bc3a70966 Scope package manager queries for ephemeral apps
Ephemeral apps can only see their own components or those components
exposed via the "visibleToEphemeral" XML attribute.

Normal apps can only see other normal apps. There is no way to expose
ephemeral components to normal apps.

Bug: 33458220
Test: Manually install ephemeral/normal apps and ensure they can only see appropriate components
Change-Id: I6ae65fd2a6ddc9aa9691f02cd55d4953048966b0
2016-12-12 08:01:25 -08:00
TreeHugger Robot
e15e208ad0 Merge "Make MATCH_ANY_USER system api" 2016-12-09 22:36:39 +00:00
TreeHugger Robot
61bde4d40c Merge "Replace ContentProvider SQL args w/ Bundle & Constants." 2016-12-09 22:25:29 +00:00
Steve McKay
ea93fe7539 Replace ContentProvider SQL args w/ Bundle & Constants.
Test: cts-tradefed run cts-dev -m CtsContentTestCases
Bug: 30927484
Change-Id: Idb9dbc2b80896e9f8474a0db71353b7a3810d597
2016-12-09 12:31:44 -08:00
Todd Kennedy
b771768249 Add system API to install ephemeral apps
Test: manual; install using "adb install --ephemeral"
Change-Id: Idce214779fea5f3c4a0121542319044f9f0e0a42
2016-12-08 14:51:43 -08:00
Amith Yamasani
475f9a3d42 Make MATCH_ANY_USER system api
to allow for some privileged apps to use it.

Also fixed the javadoc to mention the correct permission.

Test: API already exercised by Settings and PackageInstaller
Bug: 31000380
Change-Id: I5fc810dfe9f8d2b64d01bbaaa0bd26ebef4e8de1
2016-12-08 09:54:35 -08:00
Robert Carr
df259d3021 Correct error in Configuration.updateFrom
When updating the non direction members of screenLayout
we check that they are not in total undefined, before
accepting the new value in full. This was enough for LONG/SIZE
which are always undefined or set together. It seems we have paths
now where SCREENLAYOUT_ROUND however can be undefined and the others
will be set. In this case if we pass a configuration with
SCREENLAYOUT_ROUND_UNDEFINED but LONG/SIZE set to updateFrom then
we will overwrite our previous SCREENLAYOUT_ROUND value.
This triggers extra configuration changes. We take extra care with
SCREENLAYOUT_COMPAT_NEEDED as it doesn't have an undefined value.

Bug: 33098677
Test: bit FrameworksCoreTests:android.content.res.ConfigurationTest
Change-Id: I6e7d123d5444f93c511aeb6e0f3adfea2a480352
2016-12-07 20:33:05 -08:00
skuhne@google.com
322347ba58 Adding orientation preserving resizing
Adding freeform resizing to activities which require
a certain orientation. This is needed for e.g. ARC++.

Bug: 33267688
Test: runtest frameworks-services -c com.android.server.wm.TaskPositionerTests
Test: Visually on ARC++
Change-Id: If708c1602cb2ff464174389af4648ad767b0b079
2016-12-07 20:01:19 -08:00