Commit Graph

8974 Commits

Author SHA1 Message Date
Alex Kershaw
0f9d6aff1d Merge "Add CrossProfileAppsInternal#getTargetUserProfiles" 2020-02-18 19:25:44 +00:00
Alex Kershaw
809c58a598 Merge "CrossProfileApps#startActivity by intent starts in same task by default" 2020-02-18 18:37:12 +00:00
Dmitri Plotnikov
ca854b42fd Merge "Prevents an NPE when content provider is slow to start" 2020-02-18 17:26:04 +00:00
Alex Kershaw
16406c38d8 CrossProfileApps#startActivity by intent starts in same task by default
This is based on developer feedback from Google Calendar. Tweak the API
to take in the calling activity.

Javadoc in ActivityTaskManagerInternal's new method is copied from the
existing method.

Bug: 149677845
Bug: 136249261
Test: atest com.android.cts.devicepolicy.CrossProfileAppsHostSideTest#testStartActivityIntent_sameTaskByDefault
Change-Id: I2f2d4d8fd82febf4916ba70a08de5e71c678a1f4
2020-02-18 13:56:53 +00:00
Nicolas Geoffray
6f589478d9 Merge "Revert "[DexLoadReporter] Report classloader contexts directly f..."" am: ae50e15d59 am: ea12868665 am: f96a5bf6a0
Change-Id: I0b69537e9c729cf5983bffcc6d37dfb35e000172
2020-02-17 14:19:52 +00:00
Calin Juravle
8e9f0b4d55 Merge "[DexLoadReporter] Report classloader contexts directly from classloader" am: 5a01991fef am: ce9b12f5bf am: cb3d0f7ab5
Change-Id: I181e9df3dbf4e0c8551abcb4b7b912f4a05c11c0
2020-02-17 14:16:38 +00:00
shubang
0184edc6ad Add tuner feature to PackageManager
Context: Tuner system APIs and Tuner HAL are adding to R. Tuner hardware
and HAL implementation are required for these new features.

Test: make;
Bug: 139308734
Change-Id: I89f56ee58cdfae447d33cdcd841e0d556e7f6cab
2020-02-16 21:44:55 -08:00
Nandana Dutt
5ff3568929 Merge changes from topic "preserve_legacy"
* changes:
  Enforce the preserveLegacyExternalStorage manifest attribute
  Support preserveLegacyExternalStorage manifest attribute
  Introduce preserveLegacyExternalStorage manifest attribute
2020-02-15 21:59:23 +00:00
Alex Kershaw
179ba0b4e4 Add CrossProfileAppsInternal#getTargetUserProfiles
This will be used by the logic that updates the app bucket state of
cross-profile connected apps that declare the crossProfile manifest
attribute.

Also makes the following changes:
- Fixes CrossProfileAppsServiceImplRoboTest by registering the local
service in a different way.
- Removes some code duplication in CrossProfileAppsServiceImpl.
- Some clean-up.

Robolectric tests will be added later. Right now, there seems to be a
problem causing log messages not to appear, making debugging impossible.

Bug: 140808123
Bug: 136249261
Test: atest com.android.server.pm.CrossProfileAppsServiceImplRoboTest
Change-Id: Iefa6b2a7cb7535d5796d5ca8916c10b29c2e0661
2020-02-15 19:42:30 +00:00
Nicolas Geoffray
f96a5bf6a0 Merge "Revert "[DexLoadReporter] Report classloader contexts directly f..."" am: ae50e15d59 am: ea12868665
Change-Id: I4faaff1f5227b64028222c5824d70ac0356cf20f
2020-02-15 17:51:03 +00:00
Nicolas Geoffray
ea12868665 Merge "Revert "[DexLoadReporter] Report classloader contexts directly f..."" am: ae50e15d59
Change-Id: Icc45c40ce116ce54a915650ca6f6600b6db08e0e
2020-02-15 17:36:14 +00:00
Nicolas Geoffray
371fcb7cf2 Revert "[DexLoadReporter] Report classloader contexts directly f..."
Revert "Fix shared libraries not being reported via Reporter"

Revert submission 1198456-slclc

Reason for revert: Fails on luci:
https://ci.chromium.org/p/art/builders/ci/host-x86_64-cdex-fast/3123

Exempt-From-Owner-Approval: pure revert

Bug: 148494302
Reverted Changes:
I46d8d9105: Fix shared libraries not being reported via Report...
I00357cfe0: [DexLoadReporter] Report classloader contexts dire...

Change-Id: Ib58066e8f059642a11d9eaab02ec0b8b3217e487
2020-02-15 17:13:58 +00:00
Alex Kershaw
c4b5cc5957 Update cross-profile javadoc
Update the javadoc after reviewing the new public-facing Javadoc
implemented for the INTERACT_ACROSS_PROFILES work.

Bug: 136249261
Test: no Java changes
Change-Id: I1a669adea2ff47171dbbcbe6e847a3be0cfa7509
2020-02-15 10:46:16 +00:00
TreeHugger Robot
d836b829c2 Merge "Improve BaseBundle#kindofEquals" 2020-02-15 00:54:50 +00:00
Suprabh Shukla
0e8c9c4daa Improve BaseBundle#kindofEquals
If both BaseBundles are empty, we can infer that without needing to
unparcel any of them.

Test: atest FrameworksCoreTests:android.os.BundleTest

Bug: 146037505
Change-Id: I04c28cdd1293227d9887b0c17e178f61328c1959
2020-02-14 13:43:53 -08:00
Calin Juravle
cb3d0f7ab5 Merge "[DexLoadReporter] Report classloader contexts directly from classloader" am: 5a01991fef am: ce9b12f5bf
Change-Id: I55eb1b61f848b993d17d54e68f0e6403c61e456d
2020-02-14 20:42:33 +00:00
Calin Juravle
ce9b12f5bf Merge "[DexLoadReporter] Report classloader contexts directly from classloader" am: 5a01991fef
Change-Id: Ida294271950c3f330f1acb2150ac3892db88ab64
2020-02-14 20:29:11 +00:00
Zim
b14fba21d3 Support preserveLegacyExternalStorage manifest attribute
Parsed the manifest and included in the relevant PackageManager data
structures.

Test: atest RestrictedPermissionsTest
Test: atest RestrictedStoragePermissionSharedUidTest
Bug: 148944140
Change-Id: I785e707aa4c879ea163c1611c1693fea74f4ac82
2020-02-14 14:33:51 +00:00
TreeHugger Robot
a4d20a71b3 Merge "Fixes Context Hub feature naming and documentation" 2020-02-14 04:34:23 +00:00
Evgenii Stepanov
45c350c0a8 Merge changes from topic "allowNativeHeapPointerTagging"
* changes:
  Add android:allowNativeHeapPointerTagging.
  Refactor NativeHeapTagging compat feature.
2020-02-14 01:41:37 +00:00
Dmitri Plotnikov
ab87b27663 Prevents an NPE when content provider is slow to start
Also, extends the client-side timeout to match that
in ActivityManagerService.

Also, fixes an ANR that could occur if getType is called for
an unknown content provider

---------------

Revert "Revert "Prevents an NPE when content provider is slow to start""

This reverts commit 3a54effffd.

Reason for revert: Roll forward of the original CL,
  with a fix for the regression it caused

Original commit 140fc2e9c9
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Fixes: 148987678

Change-Id: Ic60acceaabbf6b32c71d0b8bdf831a7d1f13d392
2020-02-13 17:23:05 -08:00
TreeHugger Robot
4e659f4266 Merge "Add marker flag for permissions revoked by auto-revoke" 2020-02-14 00:46:32 +00:00
Terry Wang
1bc7be7fca Merge "Add @hide to Context.APP_SEARCH_SERVICE" 2020-02-13 22:50:17 +00:00
Etan Cohen
ee9f12795b Merge "[WIFICOND] Rename to nl80211" 2020-02-13 22:34:09 +00:00
Evgenii Stepanov
751fa188e9 Add android:allowNativeHeapPointerTagging.
android:allowNativeHeapPointerTagging in the app manifest disables heap
pointer tagging, even for targetsdklevel > 29.

Bug: 135754954
Test: atest CtsTaggingTestCases CtsTaggingDisabledTestCases
Change-Id: I51776809f35a6501c6c0ef2e3de1d4a319311553
2020-02-13 13:31:25 -08:00
Patrick Baumann
7955e8ec47 Enables the App Enumeration Feature
This change enables the app enumeration feature by default. This change
is very likely to break some tests that manually install APKs. The fix
for them is generally easy: add the --force-queryable flag to the shell
command.

This change will also make some apps targetting R unable to see other
apps that are installed or sideloaded on the device.
go/app-visibility-playbook outlines the steps needed to re-gain that
visibility.

Fixes: 136675067
Test: atest AppEnumerationTests AppsFilterTest
Test: atest CtsCalendarProviderTestCases
Test: atest CtsAccountManagerTestCases
Test: atest CtsContentTestCases
Test: atest CtsPermission2TestCases
Test: atest CtsAppSecurityTests
Test: atest CtsAppTestCases
Change-Id: I9db3c0768416dd7ba24108b2a142a24672dab561
2020-02-13 20:35:48 +00:00
Eugene Susla
1d1819246e Add marker flag for permissions revoked by auto-revoke
UX wants special UI to explain permissions revoked because of auto-revoke,
so we need a way to mark them.

Bug: 146513245
Test: presubmit
Change-Id: Idb753c5036ffe94995773756f329ea26d7c40b64
2020-02-13 11:08:06 -08:00
Ryan Mitchell
6e106c549b Merge "API council changes for ResourcesLoaders" 2020-02-13 16:31:55 +00:00
Arthur Ishiguro
49e96a8ab7 Fixes Context Hub feature naming and documentation
- Adds "_" in variable name for consistency with feature string
- Adds documentation on what the feature is used for

Bug: 149475852
Test: None
Change-Id: I6eca279df8409de1155cd7014647a705d0d31d6f
2020-02-13 08:08:55 -08:00
Song Pan
6a0fd8b041 Implement the InstallerAllowedByManifest rule.
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/integrity
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Bug: 148780440
Change-Id: Ie452e2a8a93b31ee91ae6d3e119212684c022c6a
2020-02-13 13:56:28 +00:00
Dan Zimmerman
a05766e507 [DexLoadReporter] Report classloader contexts directly from classloader
At the moment classloader contexts are incorrectly computed in the
PackageManager for secondary dex files. There are two issues:

(1) The wrong computed classLoaderContext will be reported for a secondary
    dex file if it was loaded at the same time as a primary dex file
    - This is due to the continue statement that doesn't increment
      dexPathIndex
(2) If a secondary dex file was loaded with a shared library then that
    shared library info isn't passed through the dex load reporting
    infrastructure, and thus its classloader context is incorrectly computed
    in PackageManager.

In order to fix the issues described above & prevent further classloader
context computation divergences between the package manager and the
runtime, lets compute the classloader context in the runtime at dex load
time and report the expected classloader context directly to
DexLoadReporter (and thus the package manager).

Notes: This is mostly just a refactor (i.e. there are a lot of line
changes, but functionally speaking this set of CLs doesn't do much
except change where the classloader context is computed)

Addendum: The bugs described above could also be fixed by:
- changing DexLoadReporter to report information about shared libraries that
  the reported classloaders depend on to PackageManager
- Teach DexoptUtils.processContextForDexLoad about shared libraries
- Fix dexPathIndex calculation in DexManager

I opted for this set of changes instead because this reduces the
possibility of context computation divergence between the framework and the
runtime. Additionally it feels more "solid" that the classloader context
is now computed directly when a dex file is loaded, rather than the
context recreated later on in the PackageManager.

Test: atest com.android.server.pm.dex.DexManagerTests
Test: atest com.android.server.pm.PackageManagerServiceTest
Test: Install app depending on shared library & uses secondary dex
files; adb shell pm bg-dexopt-job; launch app and see odex file
successfully loaded (from smaps/no logcat errors)

Bug: 148494302
Change-Id: I00357cfe086ff149f92c1078c6df6daa713c8f7c
2020-02-13 04:31:55 -08:00
Amy Zhang
8527147b3d Merge changes from topic "tuner-rm"
* changes:
  Add a TunerResourceManagerService as an Android System Serivce.
  Add Lnb related APIs into the TunerResourceManager interface
  Add Cas related APIs into the Tuner Resource Manager
  Adding ITunerResourceManagerService interface into android.media.tv
2020-02-12 23:48:29 +00:00
Ryan Mitchell
e272307dd3 API council changes for ResourcesLoaders
Per API council guidance, setLoaders, getLoaders, and clearLoaders
are no longer part of the public API. addLoader and removeLoader
are now consume variadic loaders.

Bug: 142716192
Test: atest FrameworksResourceLoaderTests
Change-Id: If29d47b526ae6acd582b14206b2c6372f3c497be
2020-02-12 12:34:44 -08:00
Alex Buynytskyy
780d2bb75d Merge "v4 signing schema parsing and verification." 2020-02-12 19:19:06 +00:00
Philip P. Moltmann
0946037764 Merge "Revert "Revert "Activity start: Send featureId from context->AppOpsManager""" 2020-02-12 18:52:23 +00:00
Philip P. Moltmann
ee29509ecd Revert "Revert "Activity start: Send featureId from context->AppOpsManager""
This reverts commit e7421e92d9.

Exempt-From-Owner-Approval: revert-revert and only piping anyway
Test: 1:1 revert-revert
Bug: 136595429
Change-Id: I44e5fa2019f5604c6e2c08bdd1967129c64a90a7
2020-02-12 18:51:53 +00:00
Alex Buynytskyy
036864b62c v4 signing schema parsing and verification.
v4 is a streaming add-on to the existing v2/v3 schemas.

Flow:
- APK is signed with v2/v3 and v4 signature blocks,
- on installation, v4 signature bytes are stored next to the APK in
hidden block,
- on each read from APK, kernel verifies the v4 signature using
fs-verity-like code,
- on parsing/verification, we extract certificates from kernel and
compare them with certificates extracted from v2/v3 signature block.

By doing this we are making sure that v4 signature is produced by developer and original APK bytes are not changed.

Test: atest PkgInstallSignatureVerificationTest
Bug: b/136132412 b/133435829
Change-Id: Ia2a56c82c9864bf65e1338700dfe51abf6800deb
2020-02-12 09:46:06 -08:00
TreeHugger Robot
c228e1d88a Merge "Add manifest broadcasts for profile (un-)available." 2020-02-12 11:39:12 +00:00
Pierre Barbier de Reuille
1858482e49 Add manifest broadcasts for profile (un-)available.
This mean both switch on/off and add/remove profiles.

The broadcasts already exists for registered receivers, this adds them
for manifest receivers with INTERACT_ACROSS_PROFILES permission and
crossProfile attribute.

The MANAGED_PROFILE_REMOVED broadcast is sent to all application with
android:crossProfile="true". Any cross profile app may be impacted, and
there is no possible transfer of information as the account is already
deleted at the time the signal is emitted.

Change-Id: I17fb9a01b70b28845c5d6aacdcdd497a82391474
Fix: 145135525, 145598120
Test: Demo-app using Digital Wellbeing (automated test underway).
Test: atest com.android.cts.devicepolicy.CrossProfileAppsPermissionHostSideTest
Test: atest 'com.android.cts.devicepolicy.QuietModeHostsideTest#testBroadcastManagedProfileAvailable_withCrossProfileAppsOp'
Test: atest 'com.android.cts.devicepolicy.QuietModeHostsideTest#testBroadcastManagedProfileAvailable_withoutCrossProfileAppsOp'
2020-02-12 07:44:23 +00:00
Amy
06a551ee7b Add a TunerResourceManagerService as an Android System Serivce.
This service is used to interact with TunerHAL interface and the Tuner
framework to manage the Tuner resources currently used on the device.
Tuner framework claims resource from this service. The service will
handle the requests from multiple applications based on their priority.

Sepolicy changes are in https://android-review.googlesource.com/c/platform/system/sepolicy/+/1161873
Test: cuttlefish
Bug:
Change-Id: Ifedc4e6f120e711aadffdf715d8720e0b64fbe16
2020-02-11 19:39:44 -08:00
Yohei Yukawa
5af3f917a7 Handle prefix when dumping ApplicationInfo#crossProfile
This is a follow up CL to a CL [1] that added one more state dump from
ApplicationInfo but forgot to take care of prefix handling.

 [1]: I11b5d9919e4463cdaf89826360bc12ae68dbd0af
      f9b99f5fa1

Bug: 142538125
Bug: 142537267
Test: Ran the following command to see "crossProfile"
      is aligned with other outputs from ApplicationInfo.
         adb shell dumpsys input_method
Change-Id: I629d4653b0d9109615feb02718d1228cf4f850d7
2020-02-11 15:40:25 -08:00
TreeHugger Robot
fa65b021e4 Merge "Invert the DONT_AUTO_REVOKE permission flag" 2020-02-11 22:58:18 +00:00
Alex Kershaw
e7a405a54e Merge "Give new permission to set cross-profile app-op to ManagedProvisioning" 2020-02-11 22:44:23 +00:00
TreeHugger Robot
b0fe609d9b Merge "Unmark PackageParser APIs as @Deprecated" 2020-02-11 22:10:09 +00:00
Alex Kershaw
0124a09844 Give new permission to set cross-profile app-op to ManagedProvisioning
This is required for the provisioning cross-profile consent screen which
is used to take some apps off INTERACT_ACROSS_USERS.

Hidden API CrossProfileApps#setInteractAcrossProfilesAppOp is changed
from requiring the broad app-op permissions to requiring
CONFIGURE_INTERACT_ACROSS_PROFILES. It then clears identity before
calling into AppOpsManager. For convenience, we also allow apps (such as
Settings) with the broader app-op permissions to continue to call this
method; in that case, we simply don't clear the identity and let
AppOpsManager check the permissions (so we allow AppOpsManager to set
the requirements if you don't have the new
CONFIGURE_INTERACT_ACROSS_PROFILES).

The CL also adds 'withCleanCallingIdentity' support to
CrossProfileAppsServiceImpl and moves over existing calls.

Bug: 136249261
Bug: 140728653
Test: atest --verbose com.android.managedprovisioning.provisioning.crossprofile.CrossProfileConsentActivityRoboTest
Change-Id: Ibd304563dd1ef5f16784e3502be5ef1ec4675b63
2020-02-11 14:06:33 +00:00
TreeHugger Robot
456ffd240f Merge "Two API changes:" 2020-02-11 10:13:19 +00:00
Etan Cohen
b9f28bc805 [WIFICOND] Rename to nl80211
per API council feedback.

Bug: 149105833
Bug: 148680192
Test: atest android.net.wifi
Test: atest com.android.server.wifi
Change-Id: I1d6bbd126ae0eb06068ff962573021fdec590735
2020-02-10 20:36:51 -08:00
Rhed Jao
0132d90b3f Merge "Support rich content for accessibility shortcut target" 2020-02-11 00:18:28 +00:00
TreeHugger Robot
35c66ff599 Merge "Revert "Prevents an NPE when content provider is slow to start"" 2020-02-10 23:59:40 +00:00
Daniel Chapin
3a54effffd Revert "Prevents an NPE when content provider is slow to start"
This reverts commit 140fc2e9c9.

Reason for revert: b/149176266

Change-Id: I4015fcc1624ee116c4a013c99816d43ce7b24834
2020-02-10 22:12:44 +00:00