Commit Graph

66444 Commits

Author SHA1 Message Date
Christopher Tate
8aa8fe1289 Add an 'am crash' shell command
Induce a normal VM crash via adb, because it's quite different from the
effects of 'am kill'.

Test: induced crashes via adb shell using both pid & pkg

Change-Id: I79654afa7c4a70364cfd7d3af3e80a7b0e59b882
2017-01-23 20:18:45 +00:00
TreeHugger Robot
4a65687b85 Merge "Expose fonts.xml via public API with a service" 2017-01-23 19:57:23 +00:00
TreeHugger Robot
953038d1ce Merge changes from topic 'anb'
* changes:
  Adding HardwareBuffer, a Java wrapper around AHardwareBuffer.
  AHardwareBuffer implementation.
2017-01-23 19:29:05 +00:00
Jeff Schumacher
b16bddca89 Merge "Opened some App Links APIs to @SystemApi" 2017-01-23 18:50:16 +00:00
TreeHugger Robot
ec30d6e12f Merge "add a signaled reader to the eventlog" 2017-01-23 18:18:30 +00:00
Charles He
34f04ffa0b Merge "DPM: Notify DO/PO of security updates." 2017-01-23 17:11:53 +00:00
Chris Wren
d09bf8271e add a signaled reader to the eventlog
Test: manual using a logspammer app
Change-Id: I89e3dda82d4d1d3fc6d343b634642687e550f70a
2017-01-23 11:40:52 -05:00
Toby Sargeant
773deddaf5 Merge "WebView: Add the definition of the renderer importance API." 2017-01-23 16:21:18 +00:00
Clara Bayarri
04d72abde1 Expose fonts.xml via public API with a service
This change creates a new FontManagerService, in charge of providing
font management data. It exposes a public API to retrieve the
information in fonts.xml without accessing it directly. To do this,
it also refactors FontListParser's internal classes into a new public
FontConfig class holding all the font data.

getSystemFonts() returns all the available information in fonts.xml
as well as file descriptors for all the fonts. This allows us to
share the memory consumed by these files between all clients.

Bug: 34190490
Test: See attached CTS change in topic
Change-Id: I0e922f8bcc9a197a1988d04071eb485328d66fb7
2017-01-23 15:02:23 +00:00
TreeHugger Robot
83d577581b Merge "Expose Resources.getFont" 2017-01-23 13:31:33 +00:00
Andrei Stingaceanu
2317b64f02 Merge "AutoSize TextView (part 7) - APIs for configuring auto-size" 2017-01-23 11:21:57 +00:00
Clara Bayarri
18e9f9f377 Expose Resources.getFont
Based on the work already done in aapt2, load a Font from a
resource id.

Test: WIP
Change-Id: Idc06bfbfd16452a328bfcc6ea9dcfb723b633f0c
2017-01-23 11:18:09 +00:00
Charles He
dea0c3b654 DPM: Notify DO/PO of security updates.
We add a variant of notifyPendingSystemUpdate method which takes an
additional isSecurityPatch boolean flag. This information, if available,
will be persisted and available to device and profile owners when they
call getPendingSystemUpdate method.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t com.google.android.gts.devicepolicy.DeviceOwnerTest#testPendingSystemUpdate
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t com.google.android.gts.devicepolicy.ManagedProfileTest#testPendingSystemUpdate
Bug: 33102479
Bug: 30961046
Change-Id: If3f1b765bb18a359836ac43ac9a0a9f29e9f8428
2017-01-23 09:38:49 +00:00
Daichi Hirono
baa0116854 Remove StorageManager#mountAppFuse hidden API.
The API should be replaced with StorageManager#openProxyFileDescriptor.

Bug: 32891253
Test: build
Change-Id: Ibbf8b64f3a39900a1f05a52132aa931491d6fd48
2017-01-23 09:36:59 +09:00
TreeHugger Robot
e2a31c0226 Merge "Platform support for static shared libraries" 2017-01-22 23:45:12 +00:00
Svet Ganov
6788212d17 Platform support for static shared libraries
This change adds support for static shared libraries that
emulate static linking allowing apps that statically link
against the same library version to share a common
implementation. A library is hosed by a package in a standard
APK.

Static shared libraries have a name and a version declared
by a dedicated manifest tag. A client uses also a new tag
to refer to the static library it uses by specifying the
lib name, version, and the hash of the signing certificate.
This allows two apps to rely on two different library versions
and prevents impersonation of the shared library by a side-loaded
app with the same package name.

Internally apps providing static libs use synthetic package
name generated from the manifest package name and the library
version. This allows having different "versions" of the same
package installed at the same time.

An application cannot be installed if a static shared lib it
depends on is missing. A used shared library cannot be uninstalled.
Shared libraries can rotate certificates like normal apps. The
versions of these libs should be ordered similarly to the version
codes of the hosting package. Such libs cannot use shared user
id, cannot be ephemeral, cannot declare other libraries, cannot
rename their package, cannot declare child-packages. They must
target O SDK. Also they cannot be suspended or hidden or their
uninstall blocked. Generally, speaking policy regarding code in
static shared libs should be applied to the packages using the
library as it could have just statically linked the code.

We now have APIs to query information about the shared libraries
on the device in general. To clients static shared libraries are
presented as multiple versions of the same package which is how
they are declared and published. Therefore, one can have two
versions of the same package which means we need way to query
for and uninstall a specific version of a package. Also static
shared libs can depend on other static shared libs which are
versioned packages. To ease representation we add the concept
of a versioned package which should be used in the case of
static shared libs.

A client can see only the static shared libs it depends on and
more specifically only the versions it depends would be retrieved
by using the standard package manager APIs. There is a new
dedicated API to get info about all shared libraries which
would provide data about all static shared lib versions. Also
these libraries must use v2 signing scheme.

Test: CTS tests pass

bug:30974070

Change-Id: I4f3d537ee7a81f880950377b996e1d9d4813da5c
2017-01-22 14:05:15 -08:00
Tobias Sargeant
d10e4af098 WebView: Add the definition of the renderer importance API.
The renderer importance API is used to specify how important
out-of-process WebView renderer services are for the purposes of OOM
killing and scheduling with respect to the binding application.

This allows an application to - for example - specify that renderers can
be killed while the application is not in the foreground, thus cleaning
up additional resources.

Bug: 30824898
Test: Tests await Chromium change.
Change-Id: I6dca3d427d6cdb5cb7e0be6f7fb8ece64bd24af9
2017-01-22 18:59:12 +00:00
TreeHugger Robot
39e25af396 Merge "Use infinities for one-sided ranges for a11y." 2017-01-22 00:06:55 +00:00
TreeHugger Robot
9a33bda070 Merge "Add @TestApi PopupMenu.getMenuListView" 2017-01-21 07:10:05 +00:00
Phil Weaver
79e441929c Use infinities for one-sided ranges for a11y.
This was a request from Chrome to be able to specify
one-sided ranges. Rather than add new behavior, I'm just
documenting what seems to me a reasonable convention.

Bug: 30025621
Test: No tests as this just adds comments.
Change-Id: I1467f57729eed08a981c3e6d50951e78c3564a50
2017-01-21 06:06:54 +00:00
Chad Brubaker
9d8e0fc679 Merge "Rename visibleToEphemeral to visibleToInstantApps" 2017-01-21 04:38:55 +00:00
Sanket Agarwal
705eedcb01 Merge "Change HFP Client API to support multi device" 2017-01-21 03:21:58 +00:00
Craig Donner
1a4d07d919 Adding HardwareBuffer, a Java wrapper around AHardwareBuffer.
Bug: 34050596
Test: new CTS test added in other topic CL; tested with cts-tradefed on Pixel XL
Change-Id: I177107757f917fcab5bc1f1dcdbb5b81a605f777
2017-01-20 18:52:01 -08:00
TreeHugger Robot
af6668bc9d Merge "resolve merge conflicts of 5fa7fb1d9f to master" 2017-01-21 02:41:19 +00:00
TreeHugger Robot
885019151d Merge "Add Setting for curating saved open networks." 2017-01-21 02:27:30 +00:00
TreeHugger Robot
5feefa54c4 Merge "Introduce RescueParty." 2017-01-21 02:22:43 +00:00
Zac Iqbal
655f908aa6 Merge "Added an onDeviceUnlockLockout callback to TrustAgentService." 2017-01-21 01:35:43 +00:00
TreeHugger Robot
c49f2e5d88 Merge "Add ClipData.addItem(Item, ContentResolver)" 2017-01-21 01:09:28 +00:00
Jesse Hall
3bb7e5c909 resolve merge conflicts of 5fa7fb1d9f to master
Test: make
Change-Id: I7f119535a120303796fcd08f0274269f7d0dbaba
2017-01-20 17:04:48 -08:00
TreeHugger Robot
4cbec883f1 Merge "Set permissions for launching on private displays" 2017-01-21 00:59:20 +00:00
Jeff Sharkey
fe6f85cac9 Introduce RescueParty.
When a device gets stuck in a crash loop, it's pretty much unusable
and impossible for users to recover from.

To help rescue devices from this state, this change introduces a new
feature that watches for runtime restart loops and persistent app
crash loops, and escalates through a series of increasingly
aggressive rescue operations.  Currently these rescue levels walk
through clearing any experiments in SettingsProvider before finally
rebooting and prompting the user to wipe data.

Crash loops are detected based on a number of events in a specific
window of time.  App stats can be stored in memory, but boot stats
need to be stored in system properties to be more robust.

Start up RecoveryService much earlier during the boot so we can
reboot into recovery when needed.

Add properties tha push system_server or SystemUI into a crash loops
for testing purposes.

Test: builds, boots, forced crashing walks through modes
Bug: 24872457, 30951331
Change-Id: I6cdd37682973fe18de0f08521e88f70ee7d7728b
2017-01-20 17:36:38 -07:00
TreeHugger Robot
961405613c Merge "Updating picture-in-picture API." 2017-01-21 00:29:23 +00:00
David Ouyang
618fb8b194 Merge "Promote DevicePolicyManager.packageHasActiveAdmins for Play Store" 2017-01-21 00:28:17 +00:00
Zachary Iqbal
327323d2b3 Added an onDeviceUnlockLockout callback to TrustAgentService.
Test: Manually tested onDeviceUnlockLockout being called with an actual
TestAgentService implementation.

Notes:
- Active Trust Agents are no longer killed/unbinded from when a temporary
  device lockout occurs. Instead, the onDeviceUnlockLockout callback of
  the agent is called.

Change-Id: Ifa0984d1d7e5153568334d736e9ebd5a00ef1297
Bug: 34198873
2017-01-20 15:55:07 -08:00
Vladislav Kaznacheev
8e7b940f8d Add ClipData.addItem(Item, ContentResolver)
Unlike the existing addItem(Item), this method updates
the MIME type list in the ClipDescription.

Bug: 28750744
Test: cts-tradefed ... -m CtsContentTestCases
  --test android.content.cts.ClipboardManagerTest
Change-Id: Ida0477267d1319a31a738dfd704c0af71928dd2f
2017-01-20 15:39:12 -08:00
Makoto Onuki
75ca7b8edd Merge "Do not allow work profile apps to access main profile app." 2017-01-20 23:35:53 +00:00
Andrii Kulian
fb1bf69d5d Set permissions for launching on private displays
- System UIDs must be allowed to launch anything and everywhere.
- Display owner must be allowed to launch activities on it.
- Apps that are already on target display must be allowed to launch
  there.
- All other apps mustn't be allowed to launch on private displays.

Bug: 34230873
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testPermissionLaunchFromSystem
Test: #testPermissionLaunchFromAppOnSecondary
Test: #testPermissionLaunchFromOwner
Test: #testPermissionLaunchFromDifferentApp
Change-Id: Ic98005649a6368370c512e822cba4e9decc18ae9
2017-01-20 15:15:59 -08:00
Jeff Sharkey
f5d2c7278e Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741 am: c3fbf32011 am: 4a0a4664b9
am: 7bb9ccc1e5

Change-Id: I9346a576d57c9f7093b875c4a43134f2ef095018
2017-01-20 23:12:19 +00:00
Sunny Goyal
907b467e91 Merge "Fixing dimensions for AppWidgetProviderInfo not getting updated properly for PinItemRequest" 2017-01-20 23:07:22 +00:00
Dianne Hackborn
9544fe6039 Merge "Improve behavior of bg check." 2017-01-20 23:05:41 +00:00
Dianne Hackborn
85e35643ba Improve behavior of bg check.
There is a new APP_START_MODE_DELAYED_RIGID which means that
things discovering something is not allowed to start should
report a clear error back to the caller.  This is how apps
that opt in to bg check should behave, and will now
be used if the app op mode is set to ERRORED.

This (for now?) removes the code that allows services to
be started if the request is coming from a foreground process.
That behavior isn't in the current bg check spec, and
probably not what we want as the standard platform model (since
it makes knowing when a service can start even harder to
determine).  It was originally done for the experimental
bg check work in N to see how much we could avoid
breaking existing apps, so not relevant when apps need to
explicitly opt in.

Also report temporary whitelist changes to activity manager for
it to lift background restrictions temporarily for apps.  Being
on the whitelist is now part of UidRecord, preventing a uid from
going idle.

Test: Initial CTS test added.

Change-Id: I36fd906fa69de8b7ff360605ae17c088f182e172
2017-01-20 15:03:41 -08:00
Jeff Sharkey
7bb9ccc1e5 Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741 am: c3fbf32011
am: 4a0a4664b9

Change-Id: I9b5667ca6e5497a4eedaaf88979a1a3d0e22c174
2017-01-20 23:03:40 +00:00
Jiuyu Sun
417d30d88b Merge "Change the default behavior when MCC/MNC changes." 2017-01-20 22:58:25 +00:00
Jeff Sharkey
4a0a4664b9 Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741
am: c3fbf32011

Change-Id: Ibd977a017ce48f0791520af3500969aec0c132e5
2017-01-20 22:56:45 +00:00
Chad Brubaker
699c771024 Rename visibleToEphemeral to visibleToInstantApps
Test: builds
Test: cts-tradefed run commandAndExit cts-dev -m
CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ia173af181ec6206dfa8d1956eb2c4894c43c059e
2017-01-20 14:56:03 -08:00
Sanket Agarwal
039eeb81b5 Change HFP Client API to support multi device
- Adds BluetoothDevice as a parameter where required
- Gets rid of device management APIs that can be done via
  BluetoothProfiles instead

Test: Manual sanity tests
Bug: b/33554547
Bug: b/30984220
Change-Id: I3485ac5bfe1fcb29c774ad040fdd608e1cacb8df
2017-01-20 14:55:15 -08:00
Jeff Schumacher
6fd90ed961 Opened some App Links APIs to @SystemApi
This change promotes some of the APIs that Settings uses for the
"Open by default" screen from @hide to @SystemApi.

GTS tests are added in ag/1811536.

This change also changes the protection level for
Manifest.permission.SET_PREFERRED_APPLICATIONS to allow package verifiers
(e.g. the Play Store) to be granted it. This permission is used in the
PM.updateIntentVerificationStatusAsUser() and
PM.setDefaultBrowserPackageNameAsUser() APIs.

Bug:31008483
Test: Patch in ag/1811536 and follow the test instructions there.
Change-Id: I18b069de11eaa8fe97c151fb3cfb63854f1fd056
2017-01-20 14:51:47 -08:00
Jeff Sharkey
c3fbf32011 Merge "Add Binder support for Parcelable exceptions."
am: a2ef6b5741

Change-Id: Ide766c0220e86b7661af83551354b3a498297ed8
2017-01-20 22:50:49 +00:00
Jeff Sharkey
a2ef6b5741 Merge "Add Binder support for Parcelable exceptions." 2017-01-20 22:45:04 +00:00
Chad Brubaker
6ba5dccd50 Merge "Add ephemeral whitelist for SettingsProvider" 2017-01-20 22:06:58 +00:00