Commit Graph

15395 Commits

Author SHA1 Message Date
TreeHugger Robot
ac54e30fe5 Merge "Fix job persistence & re-inflation" into qt-dev 2019-04-08 17:17:12 +00:00
Steven Moreland
623b90d65e Merge "ApplicationLoaders: hard failures & tests" into qt-dev 2019-04-08 16:27:21 +00:00
TreeHugger Robot
e9d146ec9a Merge "Remove DELEGATION_PACKAGE_INSTALLATION" into qt-dev 2019-04-08 15:10:59 +00: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
TreeHugger Robot
986f1f4e5f Merge "Add provisioning extra definition to skip education screens" into qt-dev 2019-04-07 10:33:28 +00:00
TreeHugger Robot
b24094f373 Merge "Do not start jit profile in app zygote" into qt-dev 2019-04-06 11:55:48 +00:00
Christopher Tate
7f6acc05db Fix job persistence & re-inflation
We were persisting jobs' battery-not-low constraints but were not
properly restoring that constraint when the job was inflated at boot.
This could result in a runtime bootloop (!) if the job had no other
constraints, requiring a factory reset to restore the device to
usability.

We now:

* properly inflate the battery-not-low constraint;
* persist & inflate the storage-not-low constraint, which previously was
being stripped entirely and could result in a similar crash-at-boot;
* ignore the job rather than crash the system if one is inflated into
a non-viable state; and
* formally test previously-untested constraint persistence

Bug: 130012063
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java
Test: atest CtsJobSchedulerTestCases
Test: JobStoreTest with forced throw in JobInfo.Builder#build()
Change-Id: Ia3ab1eb16aeaa85336409368b4340622cec19f4c
2019-04-05 17:12:28 -07:00
Bo Liu
6c504aebe8 Do not start jit profile in app zygote
Bug: 130031692
Test: Scenario in bug works.
Change-Id: Ia28e8fc60cdf4afd2215b9f2239ca215694fc76c
2019-04-05 14:58:03 -04:00
Steven Moreland
94190e0c00 ApplicationLoaders: hard failures & tests
Make errors in ApplicationLoaders caching hard failures since they are
only ever expected under bad configuration. Tests for these are also
added.

Test: atest android.app.ApplicationLoadersTest
Bug: 128529256
Change-Id: Ib259bcdf472e6a2f7f6b1071bb70cfead4502231
(cherry picked from commit 0975a412b3)
2019-04-05 16:16:17 +00:00
Philip P. Moltmann
206445526b Remove Gallery and Music role
Test: atest CtsRoleTestCases
Bug: 129789528
Change-Id: I10b43f5186e27f2087bbb37d731c557cc1b57cf6
2019-04-04 10:00:05 -07:00
arangelov
373a0eb1a7 Add provisioning extra definition to skip education screens
Bug: 129750998
Test: none
Change-Id: I874c80d36d2d3e7f2a602c2e231a73dab3baef21
2019-04-04 15:33:36 +00:00
Rubin Xu
edeb2ffab3 Remove DELEGATION_PACKAGE_INSTALLATION
Bug: 112982695
Test: atest MixedDeviceOwnerTest.testDelegation
Change-Id: I729f27e132e608e81d4971966743b3988e612ab5
2019-04-04 15:39:09 +01:00
David Brazdil
278f199a73 Merge "Pass app's data dir to ART" am: 16749ac83e am: 33ed677361
am: 6277c39b0e

Change-Id: Iec85a2630e364e66e45e42f2cbb6a26008c0ab4a
2019-04-03 09:30:44 -07:00
David Brazdil
33ed677361 Merge "Pass app's data dir to ART"
am: 16749ac83e

Change-Id: I170cbff78d12ccc418cb440820a584f141f28433
2019-04-03 08:35:34 -07:00
TreeHugger Robot
77a059fe34 Merge "Tidy up some Javadoc." 2019-04-03 15:32:42 +00:00
David Brazdil
06f2e1294b Pass app's data dir to ART
Inform ART about the location of the app's data directory when setting
up the process. This is part of an optimization that has ART cache
verification data into that directory.

Test: compiles, boots
Bug: 72131483
Change-Id: Ic80526b6ee383733eb5860e66f6c608109d838fb
2019-04-03 13:22:27 +01:00
Mathew Inwood
1c53bca656 Merge "Greylist IActivityTaskManagerSingleton." 2019-04-03 11:52:23 +00:00
Alex Kershaw
83b0528587 Tidy up some Javadoc.
Tidy up InstallSystemUpdateCallback#UPDATE_ERROR_UPDATE_FILE_INVALID
javadoc.

Test: Javadoc change only
Change-Id: I114c60ec330c1cea96a187f727570373b4e7f3bc
2019-04-03 11:28:12 +01:00
Mathew Inwood
7fb5aca05d Greylist IActivityTaskManagerSingleton.
This is needed by Tinker, a hotfix framework commonly used in China so
it can continue working in Q.

Bug: 129726065
Test: m
Change-Id: Ie559b1bd9ad256de789e387c3f2b182bd761d23f
2019-04-03 09:49:04 +01:00
Amith Yamasani
282420fe7b Merge "Avoid elevating apps to high proc states on binding" 2019-04-03 05:50:28 +00:00
Michael Wachenschwanz
c2a64487ae Merge "Clarify timebase for UsageStats Api" 2019-04-02 20:52:50 +00:00
Andrii Kulian
a2236cb932 Merge "Update Activity lifecycle documentation" 2019-04-02 19:38:44 +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
Lucas Dupin
d9c4cac4c7 Merge "Do not colorize dark mode actions" 2019-04-02 16:58:27 +00:00
Steven Moreland
0ec1b0f9de Merge "Revert "Revert "Preload non-bootclasspath Java lib ClassLoaders.""" am: 4b5ca28dfe am: 4e709ea3fd
am: 96724b57ae

Change-Id: I3de2f4b4fb092d0db5001209d68ea217e150b8da
2019-04-01 20:14:55 -07:00
Steven Moreland
4e709ea3fd Merge "Revert "Revert "Preload non-bootclasspath Java lib ClassLoaders."""
am: 4b5ca28dfe

Change-Id: I63fa6d4a8671db24bf9fce898414c27068547ed2
2019-04-01 19:38:43 -07:00
Steven Moreland
4b5ca28dfe Merge "Revert "Revert "Preload non-bootclasspath Java lib ClassLoaders.""" 2019-04-02 02:19:44 +00:00
Lucas Dupin
f15c5e5181 Do not colorize dark mode actions
Test: visual
Fixes: 120080173
Change-Id: I9f016670aa88f13b7fd99e89a509a56f62926797
2019-04-01 19:00:12 -07:00
Mathieu Chartier
eecf228d5d Merge "Pass debug.allocTracker.stackDepth to runtime if it exists" am: 72e80b5b1a am: efeaad3225
am: e58f122e19

Change-Id: I40fc2836471279635acc26c06aa4a18a183947f9
2019-04-01 17:32:46 -07: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
Mathieu Chartier
efeaad3225 Merge "Pass debug.allocTracker.stackDepth to runtime if it exists"
am: 72e80b5b1a

Change-Id: Iaf05e6a285dbf626854a3b37101bea032af3a7a8
2019-04-01 16:24:14 -07:00
Michael Wachenschwanz
17415c2f72 Clarify timebase for UsageStats Api
Fixes: 113353553
Test: n/a
Change-Id: I6517b38a56b7ba60585c597b5f1cd01de4b4dfd4
2019-04-01 15:40:49 -07:00
Svetoslav Ganov
8c45f11b79 Merge "Add missing argument and return annotations" 2019-04-01 22:30:03 +00:00
Svetoslav Ganov
51b78e305d Merge "Add missing nullability annotations" 2019-04-01 22:12:35 +00:00
Michael Groover
d18900b937 Merge "Remove unused code and cleanup parameters for DPM dev ID access" 2019-04-01 19:27:42 +00:00
Mathieu Chartier
90aa945df5 Pass debug.allocTracker.stackDepth to runtime if it exists
Since this is no longer called in ART, pass it down in bind application.

Bug: 37291459
Test: test-art-host

Change-Id: I23623e9b8e9ca6261d90cc1ae1c5d8c24cc4eba5
2019-04-01 17:56:56 +00:00
TreeHugger Robot
8ccf6439af Merge "Fix the javadoc of setAutoTimeRequired." 2019-04-01 14:58:32 +00:00
TreeHugger Robot
389dfc89cb Merge "Change javadoc of isManagedKiosk." 2019-04-01 14:51:23 +00:00
Alex Kershaw
fa3b77f27c Fix the javadoc of setAutoTimeRequired.
Fix the javadoc of DevicePolicyManager#setAutoTimeRequired to mention
that PO support is only from O onwards.

Fixes: 126325573
Test: Javadoc change only
Change-Id: Ib415e20a312d2cc454843562bff6cc0eb1e98244
2019-04-01 13:24:54 +01:00
Alex Kershaw
dafcc9dbf9 Change javadoc of isManagedKiosk.
Change the javadoc of isManagedKiosk and isUnattendedManagedKiosk to
reflect feedback from the CDD update process at http://b/124358598.

Bug: 124358598
Fixes: 129458503
Test: Javadoc only
Change-Id: Iad69be116ccd62ff8091d1be412a06afdd714603
2019-04-01 13:12:11 +01:00
Jeff Sharkey
f5e3d6a735 DATA is deprecated, but some apps really want it.
The DATA column points at raw filesystem locations, which aren't
always valid when an app is placed into a sandbox, so apps need to
move away from using them.

We had hoped to block this access based on an app targeting Q, but
we've received feedback that it's too painful for apps to transition,
so we'll continue returning paths that can be translated.

Also reduce CPU usage by skipping permission checks when not
processing an IPC, such as when called by ModernMediaScanner.

Bug: 128452447, 125725916
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Ibd41d8ddedfaf9807333560b2d8e64e42ea7a1ba
2019-03-31 12:03:50 -06:00
Svet Ganov
8d54bcc1a6 Add missing nullability annotations
Test: manual

bug:126699370

Change-Id: Ie3bcb82ed24a1aa98004d88befe1f14c0c9e658b
2019-03-30 22:13:50 -07:00
Svet Ganov
00a46ef45c Add missing argument and return annotations
Test: manual

bug:128317336

Change-Id: I239b251b15dceb062e7be9ab602f4b0dce446987
2019-03-29 21:13:07 -07:00
TreeHugger Robot
e5e258148d Merge "Adding automatic heap dumping for system server." 2019-03-30 02:35:22 +00:00
Winson Chiu
fbe87233d5 Merge changes from topic "code-paths-and-resources-caching-fix"
* changes:
  Revert ContextImpl LoadedApk packageInfo caching workaround
  Fix AssetManager2 isUpToDate check
  Diff resource dirs when checking LoadedApk packageInfo cache in ActivityThread
  Diff overlays between PackageManagerService and OverlayManagerService
  Propagate base code path and split dir changes to Resources objects
2019-03-29 23:50:02 +00:00
Kweku Adams
fa8256386e Adding automatic heap dumping for system server.
This adds a request to ActivityManager to track the system server's pss heap
and make sure it doesn't go above a predefined limit. If it does, the dump is
generated and a notification is posted.

Bug: 77490269
Test: flash device and test with 100MB and 150MB limits
Change-Id: Ie886cc36860e8557fbd037b3bfd4975d12806a4b
2019-03-29 16:25:06 -07:00
Steven Moreland
bdc2702cdf Revert "Revert "Preload non-bootclasspath Java lib ClassLoaders.""
This reverts commit d3c2bc5a4e.

Reason for revert: reland fix
Bug: 128529256

Change-Id: I0647d4242406e31348a68ebba328e5f8ad750144
2019-03-29 21:52:32 +00:00
TreeHugger Robot
a869ccb1d0 Merge "Grants camera permission to Attention Service." 2019-03-29 21:31:26 +00:00
Winson
710e3ecbe0 Revert ContextImpl LoadedApk packageInfo caching workaround
Reverts changes made for b/120987987 that are no longer necessary
with changes for b/124363683.

Test: manually built, enabled/disabled FontCursiveMonospaceOverlay

Change-Id: Ied18a412d30514b40cc720d9a1af5c0d2053d795
2019-03-29 12:18:18 -07:00