Commit Graph

6376 Commits

Author SHA1 Message Date
Cody Northrop
3432b6df37 Merge "GPU Debug Layers: Allow multiple layer apps" into qt-dev 2019-04-10 21:38:31 +00:00
Nicolas Geoffray
5e05627687 Merge "Disable USAP when running in jitzygote mode." into qt-dev 2019-04-10 21:23:08 +00:00
Cody Northrop
f959f6b5aa GPU Debug Layers: Allow multiple layer apps
This allows applications to specify both a GLES layer app and a
Vulkan layer app, so both APIs can be debugged at the same time.

To specify multiple debug layer apps, colon separate them just
like the layers:

  adb shell settings put global gpu_debug_layer_app app1:app2:appN

Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Change-Id: I5f721b7d9de59577adb6cc03e909ff99ca79d75e
2019-04-10 11:02:28 -06:00
Jeff Sharkey
586d3c013a Split VOLUME_EXTERNAL and VOLUME_PRIMARY.
To let developers focus on specific concrete storage devices in Q,
we need a volume name that can be used to point at the primary
external storage device.  We had been using VOLUME_EXTERNAL for that,
but we've heard that certain apps are making deep assumptions that
media item IDs are globally unique across all volumes.

Thus these changes merge all volumes back into a single underlying
database, and VOLUME_EXTERNAL works with all of the currently
attached volumes.  The new VOLUME_PRIMARY name can be used to focus
on the primary storage device when desired.

When developers try inserting items directly into VOLUME_EXTERNAL,
we gracefully assume they meant VOLUME_PRIMARY.

Bug: 128451765
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: I682ff6e9aaab4f5315a46c9825313a438548c7e6
2019-04-10 09:35:14 -06:00
Nicolas Geoffray
fd00e94dd1 Disable USAP when running in jitzygote mode.
The feature needs to be tweaked for it, and currently
regresses app startup.

Test: build jitzygote config, check there is no usap processes
Bug: 119800099
Change-Id: Ic33c539636f206da72d6d0cc51219e8d2dfe23dc
2019-04-10 14:58:17 +01:00
TreeHugger Robot
41b582936f Merge "Don't use noteop for preflight checks" into qt-dev 2019-04-09 20:29:24 +00:00
Chad Brubaker
45810afbea Don't use noteop for preflight checks
Test: apps don't show as accessing location on start
Fixes: 130187488
Change-Id: Iacd7edbadab64f43229b5d6f8056bb076c4f280c
2019-04-09 11:18:28 -07:00
TreeHugger Robot
1ed8d8109f Merge "DynamicSystem string review followup" into qt-dev 2019-04-09 10:22:19 +00:00
Po-Chien Hsueh
9a1627f521 DynamicSystem string review followup
Some changes to follow string review suggestions:
- Simplify some messages.
- Replace 'Reboot' with 'Restart'.
- Notification action button order: 'Restart' button on the right.

Bug: 129100345
Test: verified with test app
Change-Id: I1ee97b0adbf74add68d3561fc647dc4923ee7237
2019-04-09 14:26:38 +08:00
Svet Ganov
d8eb8b2690 Restricted permission mechanism - framework
This change adds a mechanism for restricting permissions (only runtime
for now), so that an app cannot hold the permission if it is not white
listed. The whitelisting can happen at install or at any later point.

There are three whitelists: system: OS managed with default grants
and role holders being on it; upgrade: only OS puts on this list
apps when upgrading from a pre to post restriction permission database
version and OS and installer on record can remove; installer: only
the installer on record can add and remove (and the system of course).

Added a permission policy service that sits on top of permissions
and app ops and is responsible to sync between permissions and app
ops when there is an interdependecy in any direction.

Added versioning to the runtime permissions database to allow operations
that need to be done once on upgrade such as adding all permissions held
by apps pre upgrade to the upgrade whitelist if the new permisison version
inctroduces a new restricted permission. The upgrade logic is in the
permission controller and we will eventually put the default grants there.

NOTE: This change is reacting to a VP feedback for how we would handle
SMS/CallLog restriction as we pivoted from role based approach to roles
for things the user would understand plus whitelist for everything else.
This would also help us roll out softly the storage permisison as there
is too much churm coming from developer feedback.

Exempt-From-Owner-Approval: trivial change due to APi adjustment

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
Test: atest CtsPermissionTestCases
Test: atest CtsPermission2TestCases
Test: atest RoleManagerTestCases

bug:124769181

Change-Id: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-04-07 22:39:54 -07:00
Mathieu Chartier
5d6c852211 Merge "Enabled the USAP Pool by default." into qt-dev 2019-04-06 19:21:30 +00:00
TreeHugger Robot
6e14a0326e Merge "Add cooling device into thermal service" into qt-dev 2019-04-05 23:24:01 +00:00
Chris Wailes
d0c3664b00 Enabled the USAP Pool by default.
Set the default value for the USAP Pool to true for devices that don't
receive DeviceConfig profiles.

Bug: 128851983
Test: m & boot & check log for USAP creation
Change-Id: Id171336671a4fb8b8ad59c5b0e2e725657361107
(cherry picked from commit 0f7bce31a8)
2019-04-05 22:59:49 +00:00
Wei Wang
38e5bd7bf3 Add cooling device into thermal service
This is for statsd to log new metrics, as statsd has moved to use
thermal service in framework instead of connecting to HAL directly.

Bug: 119688911
Test: Build and dumpsys thermalservice
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/power/ThermalManagerServiceTest.java
Change-Id: Ib334c448c3615bf9d1cb0f1b6c2dd8a83d44f371
2019-04-05 14:34:31 -07:00
Nick Kralevich
d88acc95ab Don't set sehash when calling restoreconRecursive
restorecon_recursive updates the SELinux label of the files in the
filesystem, and then attempts to write the xattr "security.sehash" as an
optimization for future restorecons. Writing security.* extended
attributes requires CAP_SYS_ADMIN, which system_server doesn't have (and
shouldn't have).

Suppress the computation and writing of the hash value. It's not
needed.

This bug has been around for a long time, but due to the fix for
bug 62302954, the error message is being generated more frequently
now.

TODO: It would be better if the default for restorecon was to suppress
the hash computation, since otherwise it encourages programs to be
overprivileged with CAP_SYS_ADMIN. I'll plan on doing that in a followup
commit.

Bugs where this error message has been called out:
Bug: 129766333
Bug: 129271240
Bug: 128700692
Bug: 129925723

Test: install an APK and ensure that no "SELinux:  setxattr failed"
    error messages are generated.

(cherry picked from commit cb1dddad27)

Change-Id: Ifc5be24d14029cb616d5564366fc10a0b93c9939
2019-04-05 09:50:58 -07:00
Jeff Sharkey
e9fcabcaa1 Fix isExternalStorageSandboxed() bug.
It needs to use the same STOPSHIP logic for consistency with the
two other enforcement sites across the OS.

Bug: 129487770
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I7a3fa836e0795912c264aae58a55472ffae3d8c3
2019-04-04 11:19:24 -06:00
TreeHugger Robot
ad0dbc493b Merge "Set packages.list context to packages_list_file." 2019-04-03 19:34:28 +00:00
Florian Mayer
d4db997a81 Set packages.list context to packages_list_file.
Bug: 123186697

Test: adb shell su root ls -lZd /data/system/packages.list
-rw-r----- 1 system package_info u:object_r:packages_list_file:s0 35816 2019-04-02 14:17 /data/system/packages.list

Change-Id: I62ae03b5c2acf6c703f2e4c6f49cc68825e3a785
2019-04-03 18:28:16 +01:00
Olivier Gaillard
f84f4f8a34 Change visibility of *WorkSourceUid APIs to public instead of @SystemApi.
Bug: 127465468
Test: atest BinderWorkSourceTest
Change-Id: Ib5743219ed44b893a64825d3d8c66e2f20b4197f
2019-04-03 14:49:24 +01:00
Po-Chien Hsueh
2d204b3985 Merge changes from topic "dyn_system_ff"
* changes:
  Use setEnable() when there is an installed image
  Use gsid.isGsiEnabled to refine DynamicSystemService
  Use FeatureFlagPersistent to guard DynamicSystem
  Make feature flag settings_dynamic_system persistent
2019-04-03 07:55:55 +00:00
Howard Chen
72324e4eb1 Use gsid.isGsiEnabled to refine DynamicSystemService
* Add isEnabled
* Replace toggle with setEnable

Test: Compile passed
Bug: 125079548
Change-Id: I4931e6469388ea05194ba44ccb994f32c08ad40d
2019-04-03 07:53:50 +00:00
Amith Yamasani
282420fe7b Merge "Avoid elevating apps to high proc states on binding" 2019-04-03 05:50:28 +00:00
Po-Chien Hsueh
4167b42f89 Use FeatureFlagPersistent to guard DynamicSystem
Check persistent feature flag 'settings_dynamic_system' before
invoking the installation service. User can still use gsi_tool if
the device is unlocked.

Bug: 119647479
Test: Verified with 'adb shell am' and test app.
Change-Id: If2265d877bc7eedf9b7a107bba04d2e95cf1b89a
2019-04-03 10:29:31 +08:00
Joe Onorato
5da1b3dc05 Fix ConditionVariable.block to use elapsedRealtime.
System.currentTimeMillis() is NEVER okay to use to calculate a time delta.
The original spirit of this probably should have used SystemClock.uptimeMillis(),
but use SystemClock.elapsedRealtime because it's the same as
System.currentTimeMillis() in all the cases where System.currentTimeMillis() is
correct.

Test: Treehugger
Change-Id: Ib6e090425af83e7e822fb12814d87e8a37e2d2ac
2019-04-02 19:19:13 +00:00
Amith Yamasani
f235d0b53a Avoid elevating apps to high proc states on binding
For service and provider bindings from TOP and
FOREGROUND_SERVICE apps, don't elevate bound apps
to above BOUND_FOREGROUND_SERVICE.

For service bindings, it is possible to explicitly
request the binding to match the foreground app
such that the bound app can get similar privileges
of foreground permissions.

For instance, when a foreground service has a location
type, providers it binds to don't automatically get the
location privilege. On the other hand, sometimes apps
showing UI want to treat their dependencies also as if
they are showing UI.

This change does not affect the oom_adj calculation,
only the proc state calculation for bound processes.

New BIND_INCLUDE_CAPABILITIES flag can be used to restore old
behavior for bound services.

Introduces a new state PROCESS_STATE_BOUND_TOP

Bug: 128337543
Test: atest CtsAppTestCases:ActivityManagerProcessStateTest

Change-Id: I13733e7f43a78903299254bc110cd8f7a8db4c40
2019-04-02 10:27:03 -07:00
Cody Northrop
236b283b4e Merge "ANGLE: Allow libs from debug package" 2019-04-02 13:47:30 +00:00
Jeff Sharkey
68b3e186c2 Remove greylist of apps that gain legacy access.
Per design pivot, access to legacy behavior will be determined by
the new "allowExternalStorageSandbox" manifest flag.

Bug: 124818022, 129487770
Test: atest --test-mapping packages/providers/MediaProvider
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Change-Id: I169e5eb3612c23aad47204cde9ff263f9df6f8c1
2019-04-01 18:48:52 -06:00
Philip P. Moltmann
8f8cf3430b Merge "Remove dual storage permission model" 2019-04-01 23:45:23 +00:00
Philip P. Moltmann
129a0b0c5e Remove dual storage permission model
- Also remove typed media permissions
- Leave typed media app-ops

Bug: 129716569
Test: Used apps, looked at permissions in the UI
Change-Id: If7714fb1a6955584157e1a60ab72b09e35287827
2019-04-01 16:30:11 -07:00
TreeHugger Robot
ddc438d13d Merge "Update javadoc on BatterySaverPolicyConfig" 2019-04-01 22:09:19 +00:00
Makoto Onuki
c458c07dd3 Update javadoc on BatterySaverPolicyConfig
Change-Id: I21a536a603174ee859b49689f4a16184adab6813
Fix: 129473934
Test: Treehugger
2019-04-01 12:56:27 -07:00
TreeHugger Robot
cb91b276f3 Merge "Making Battery Saver policy setting more defensive." 2019-03-29 23:30:16 +00:00
Cody Northrop
dc2fd94628 ANGLE: Allow libs from debug package
Add a new setting that allows a developer to specify where
to load ANGLE libraries from, rather than the default location.
This is only allowed for apps that are dumpable, i.e. can have
libraries injected.  That includes debuggable, profileable,
and root.

To use the new setting:

  adb shell settings put global angle_debug_package <package>

This allows a developer to build an APK directly from Chromium
and use it with a production build of Android. It will override
pre-installed system packages and updates.

Note: Use of ANGLE Developer Options UI will cease to function
until the debug package is uninstalled.

Bug: 80239516
Test: Apply setting, see new ANGLE used
Test: cts-tradefed run singleCommand cts -m CtsAngleIntegrationHostTestCases

Change-Id: Ib3b1fb52c0eb669e7ea931959a73aba2bd15bedf
2019-03-29 15:50:06 -06:00
Kweku Adams
c1d844a52b Making Battery Saver policy setting more defensive.
1. Making a full copy of the config Builder's map so that changing
the map in the builder doesn't change the config's map.

2. Ensuring that location mode and brightness adjustment factors are
within valid ranges.

Bug: 129474588
Test: manual
Change-Id: I6117b7857afa10d71c1fc3de818c51d8719a281b
2019-03-29 13:28:45 -07:00
Jeff Sharkey
65e18e43a2 Merge "Manifest flag for apps to request sandboxing." 2019-03-29 19:31:33 +00:00
Luke Huang
6764eff395 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: b9ef4dd299 am: 1711278ce2
am: ceb74821a3

Change-Id: I2d642b71df25934fddd8a1476b5d27457628b8e2
2019-03-29 02:24:24 -07:00
Luke Huang
ceb74821a3 Merge "Use IDnsResolver instead of INetd for resolver related binder commands" am: b9ef4dd299
am: 1711278ce2

Change-Id: I80ae047bd65b654e01061a9f218be23e1e3ef2ed
2019-03-29 02:10:55 -07:00
Luke Huang
1711278ce2 Merge "Use IDnsResolver instead of INetd for resolver related binder commands"
am: b9ef4dd299

Change-Id: Icca07604bc8f922c51493e72fde8c7377105bf8b
2019-03-29 01:57:44 -07:00
Jeff Sharkey
bcff13c657 Manifest flag for apps to request sandboxing.
We're iterating on the design to let apps request via a manifest
flag if they'd like to opt-in or opt-out of storage sandboxing.  The
default is to assume that P apps don't allow sandboxing, and that
Q apps do allow sandboxing.

Bug: 129487770
Test: manual
Change-Id: I8fddb35eed412c78622be4ccae57c7b7d2aa1286
2019-03-28 14:34:47 -06:00
Jeff Hamilton
38d503fe46 Merge "Add an API to read experiment IDs." 2019-03-28 11:44:52 +00:00
Michael Wachenschwanz
2da219096a Merge "Limit broadcast rate for low priority DropBox entries" 2019-03-28 01:56:18 +00:00
Michael Wachenschwanz
fd6523ec54 Limit broadcast rate for low priority DropBox entries
DropBox entry spamming can negatively impact system and apps listening
to the ACTION_DROPBOX_ENTRY_ADDED broadcast.
Global settings with the DropBox tag prefix can now mark low priority
tags. Low priority tagged entries will have their
ACTION_DROPBOX_ENTRY_ADDED broadcast delayed and the broad cast will be
dropped in spammy situations.

Bug: 119132031
Test: atest CtsDropBoxManagerTestCases

Change-Id: I56554a15e0afb6e1686a33c59b3d6a8d426c2fc6
2019-03-27 13:58:20 -07:00
Jeff Sharkey
53b7e93cc3 Merge "Apps using storage must have runtime permission." 2019-03-27 19:56:51 +00:00
Jeff Hamilton
fa2f91c2fe Add an API to read experiment IDs.
Change the file format to store the
experiment IDs direclty so we don't
need to parse the proto when reading
the values out.

Bug: 129099771
Test: bit statsd_test:* && adb shell cmd stats pull-source 10051
Change-Id: I0dc1fd118f4d9ba597c2f0959648136bbafb5aab
2019-03-27 14:24:49 -04:00
Luke Huang
6591477a5b Use IDnsResolver instead of INetd for resolver related binder commands
migrate resolver related commands from INetd to IDnsResolver

Bug: 126141549
Test: atest FrameworksNetTests ConnectivityServiceTest Nat464XlatTest
      atest DnsManagerTest
Change-Id: I559c0c1304d53dde408c062e1a52e742595e7cbe
2019-03-27 17:39:07 +08:00
Joe Onorato
1c33a64705 Merge "incidentd can now handle multiple callers asking it for incident reports" 2019-03-27 04:06:06 +00:00
Po-Chien Hsueh
43037e40e7 Merge "Add a permission, INSTALL_DYNAMIC_SYSTEM" 2019-03-27 03:21:19 +00:00
Po-Chien Hsueh
f906e0e331 Merge "Improve javadoc for DynamicSystemClient" 2019-03-27 03:20:54 +00:00
Po-Chien Hsueh
244e560c09 Merge "Send URL using Uri instead of String" 2019-03-27 03:20:25 +00:00
TreeHugger Robot
dbc7083c06 Merge "GraphicsEnvironment: Allow profileable apps to load layers" 2019-03-27 00:47:21 +00:00