Commit Graph

8943 Commits

Author SHA1 Message Date
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
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
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
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
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
TreeHugger Robot
842482edaa Merge "Make ACTION_LOAD_DATA a protected intent" 2020-02-10 20:36:33 +00:00
Song Pan
76a0bb8920 Two API changes:
1. Add a new formula type "INSTALLER_ALLOWD_BY_MANIFEST" that evaluates to true
when installer is specified in the manifest.

This CL only adds this class without actually removing the part where we
propagate allowed installers. That will be changed in a new CL.

2. Change the AppIntegrityComponent API so that it is type-safe.

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, 147835536
Change-Id: Icfb996b2f6de241d9790a423dd01992edaf35117
2020-02-10 20:32:57 +00:00
TreeHugger Robot
e39ec317ca Merge "Allow cross-profile interaction when called from the system process." 2020-02-10 19:34:53 +00:00
TreeHugger Robot
28345b2cba Merge "Incremental install via adb." 2020-02-10 19:22:46 +00:00
Jay Aliomer
03906f0e10 Merge "Dark theme helper" 2020-02-10 18:50:11 +00:00
Philip P. Moltmann
41308eced1 Merge "Revert "Activity start: Send featureId from context->AppOpsManager"" 2020-02-10 16:31:33 +00:00
Philip P. Moltmann
e7421e92d9 Revert "Activity start: Send featureId from context->AppOpsManager"
Revert "Adjust monkey to changed internal APIs"

Revert "Test featureId is correctly used in startActivity"

Revert submission 10111030-activityStarter_featureId

Reason for revert: presubmit test breakage
Reverted Changes:
Ic7056b492: Activity start: Send featureId from context->AppOp...
I8e2a07da7: Adjust monkey to changed internal APIs
I7a6af6fb1: Test featureId is correctly used in startActivity

Change-Id: I48c55a962c990b22ea49e923baa7c73b121d179b
2020-02-10 16:14:12 +00:00
Alex Buynytskyy
cd4d3875e2 Incremental install via adb.
- passing V4 signature to IncFS,
- cleanup and use InstallationFile everywhere,
- pass params to DataLoader creation,
- minor refactor for PackageManagerShellCommandDataLoader to prepare for
Incremental data loading.

Test: atest PackageManagerShellCommandTest
Bug: b/136132412 b/133435829
Change-Id: Iacc3e4c51c0fa3410b076147ce153a1303246189
2020-02-10 07:06:34 -08:00
Patrick Baumann
172c497117 Merge "Adds queries->provider tag" 2020-02-10 14:37:56 +00:00
Omer Nebil Yaveroglu
b994372efb Change the way we handle app and installer certificates to be prepared
for the case that there might be multiple certificates signing the app.

Bug: 148373316
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/integrity
Change-Id: Ic1e86aeff6c087266739682fe4fe206200a87420
2020-02-09 18:52:29 +00:00
Philip P. Moltmann
6e406c8ae7 Merge "Activity start: Send featureId from context->AppOpsManager" 2020-02-08 22:54:50 +00:00
Philip P. Moltmann
9c5226fe36 Activity start: Send featureId from context->AppOpsManager
The expected usage pattern for noteOp is to get the
Context#getOpPackageName() and Context#getFeatureId() in the calling app
and the call

noteOp(callingPackageName, Binder.getCallingUid(), callingFeatureId)

As the featureId parameter is new this parameter has to been piped all
through from the ...Manager classes running in the app all way deep into
the bowels of the system server.

There is a special featureId==null for the "default" feature. This is
used in two cases:
- In case the system server (packageName == null || packageName ==
  "android") makes a call
- In the case there is no caller. In this case I left annotations in the
  code to make clear that the default feature is used

Raw binder interfaces (defined in AIDL files) are not supposed to be
used by apps. Still historically this has happened and we ended up with
@UnsupportedAppUsage tags in these files. Also AIDL does not support
two methods with the same name but different parameters. I.e. in the
case when I had to add a paramater to a method tagged as UnsupportedAppUsage I
- created a new method ...WithFeature with the additional paramter
- set a maxTargetSDK for the old method and mention the public API to
  use in the deprecation method
This is really not pretty. Once there is no more app using the old
internal API this hack can be removed.

Additionally this change removed all internal calls to
AppOpsService.noteOperation and AppOpsService.checkOperation and
replaces them with the public API equivalent. This sometimes means to
move the resolution of the mAppOpsManager to be lazy.

Exempt-From-Owner-Approval:: Just piping through arguments
Bug: 136595429
Test: atest --test-mapping frameworks/base/services/core/java/com/android/server/am/
      atest CtsAppOpsTestCases added test to cover activity start
      atest WmTests
Change-Id: Ic7056b492cb1c9a79158e6c2b4864898a0eb5b2a
2020-02-08 22:53:43 +00:00
Patrick Baumann
9918123bac Adds queries->provider tag
This change adds support for the <provider> tag inside of the <queries>
tag to support more succinct declaration that an app would like to see
the provider of a given authority.

Test: atest AppEnumerationTests AppsFilterTest
Bug: 136675067
Change-Id: Ie0f73213fae7a3a0619238e44063d4e5be157201
2020-02-07 17:08:30 -08:00
JW Wang
b82819fc4d Merge "Add a test API PackageManager#MODULE_APEX_NAME (2/n)" 2020-02-08 01:01:36 +00:00