Commit Graph

9369 Commits

Author SHA1 Message Date
Automerger Merge Worker
ccd2f1c690 Merge "Merge "Change the way how we call setStorageParams." into rvc-dev am: 9f16f2665a am: 14e544cd4d" into rvc-d1-dev-plus-aosp am: a477eaf6ec am: 34d4599dfc
Change-Id: I29cfc77e86db62ee451809eecd6d619245a8b7ba
2020-04-08 01:40:26 +00:00
Alex Buynytskyy
f415679228 Change the way how we call setStorageParams.
Now it's unified with callback FS connector - we are passing the
callback pointer directly to dataloader. This restricts access only
to methods we want and only by someone we want.

Bug: b/153468113
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: Ib557ebbe7c6c5ce92140eb20534a3626b3ac96d3
2020-04-07 14:42:50 -07:00
Kholoud Mohamed
0d692957c1 Merge "Remove platform-signed apps from configurable cross profile apps" into rvc-dev am: 5ec3cbac4c am: 0e434418d7 am: a5d68b63cc am: fbbc616ac5
Change-Id: I1b36d3a4a1e5fe23fd9205ceb27f0591c963bbf9
2020-04-07 10:41:40 +00:00
Kholoud Mohamed
5ec3cbac4c Merge "Remove platform-signed apps from configurable cross profile apps" into rvc-dev 2020-04-07 09:55:18 +00:00
Rhed Jao
62427df6f2 Merge "Fix an exception while scanning apex packages" into rvc-dev am: 2aab1a4d49 am: 26870cfee0 am: cea5e93b4e am: c0c0d56ab5
Change-Id: I109467145ee039e980df29a6e7272f8a05586c83
2020-04-07 09:55:06 +00:00
Rhed Jao
2aab1a4d49 Merge "Fix an exception while scanning apex packages" into rvc-dev 2020-04-07 08:49:48 +00:00
kholoud mohamed
9bbab6a6df Remove platform-signed apps from configurable cross profile apps
Most apps that declare the INTERACT_ACROSS_PROFILES permission do
not have it granted, but get the app-op instead. We do not
normally want platform-signed apps that are actually given the
permission to appear in the user-configurable section in Settings,
so we remove them from the return value of
canUserAttemptToConfigureInteractAcrossProfiles in this CL.

Note that OEM can choose to allow some platform-signed apps to be
user-configurable by including them in their OEM whitelist file.
This CL respects that and allows these apps to be configured by the user,
despite being granted the permission. If the user rejects the app-op,
PermissionChecker correctly returns false.

Bug: 149742043
Test: atest CrossProfileAppsServiceImplRoboTest
Change-Id: I693338507eec9cdc0ba10a3584e994a58d2d113c
2020-04-06 10:13:09 +00:00
TreeHugger Robot
f7e0d7da15 Merge "Update documentation of Resources#getDisplayMetrics" into rvc-dev am: 001fddc078 am: 4e59fde49e am: 5126e8c32d am: c5f5a88b0f
Change-Id: Ic0654dbe23f754ac71ea6e574671944b625c71bb
2020-04-06 07:55:52 +00:00
TreeHugger Robot
001fddc078 Merge "Update documentation of Resources#getDisplayMetrics" into rvc-dev 2020-04-06 07:01:35 +00:00
TreeHugger Robot
13bbf2e6e5 Merge "Pipe through attributionTag for package installation" 2020-04-05 01:50:40 +00:00
Philip P. Moltmann
c3278660cb Pipe through attributionTag for package installation
Test: atest CtsAppOpsTestCases
Bug: 136595429
Change-Id: Ifda7464911faf505cd5287dbf48859e17452d3e5
2020-04-03 17:38:36 -07:00
Mehdi Alizadeh
6991da300f Merge "Wrap ShortcutQuery in a parcelable wrapper object and pass it direcly through aidl." into rvc-dev 2020-04-04 00:23:47 +00:00
Ryan Mitchell
3c75f0f529 Merge "Begin moving FrameworkResourceLoaderTest to cts" into rvc-dev am: 1b922d56c0 am: 2f75830e44 am: cd215aa9e3 am: 4f76d2ef62
Change-Id: I81acba05bae15f952073f1db76acb4713ca88841
2020-04-03 16:59:12 +00:00
Ryan Mitchell
1b922d56c0 Merge "Begin moving FrameworkResourceLoaderTest to cts" into rvc-dev 2020-04-03 16:03:24 +00:00
Winson Chiu
bef8e73b62 Merge "Query PlatformCompat for targetSdk check in AndroidPackageParsingTestBase" into rvc-dev am: b6eaf6ed79 am: 3f628376ea am: 8b25a30b29 am: 4ca419cfc7
Change-Id: Ia3fc2d360c6e214612c81d3acba74800aa5e4c9f
2020-04-03 04:56:31 +00:00
Winson
468825347e Query PlatformCompat for targetSdk check in AndroidPackageParsingTestBase
There are prebuilts in the tree and perhaps APKs in general
which don't conform to the manifest checks added in R, so the code
that parses the APK to verify v1 vs v2 needs to actually query
PlatformCompat to do the proper targetSdkVersion check and allow
the APK through if it's not updated yet.

A related change to default enabled inside ParsingPackageImpl to
true was also made, as if any malformed APK was allowed through
without an <application> tag, it would never hit the code
where enabled gets assigned to default true.

Any further errors spit out by this test are critical and need to
updated so that their APKs can be installed on R.

Bug: 153058196

Test: manual verify error behavior with broken APK
Test: atest com.android.server.pm.parsing

Change-Id: I2b117f2098d8bd62b92921178a098e838b55b06d
2020-04-02 15:10:13 -07:00
Pinyao Ting
1f31f3ee79 Wrap ShortcutQuery in a parcelable wrapper object and pass it
direcly through aidl.

As part of the effort to simplify the implementation of
LauncherAppsService, We create ShortcutQueryWrapper, a parcelable
object that wraps ShortcutQuery and pass it to LauncherAppsService
directly.

Bug: 148104408
Test: atest ShortcutQueryTest
Merged-In: I2e2ccaf38ef6bd558b4b02e647a7e263c7e612a9
Change-Id: I2e2ccaf38ef6bd558b4b02e647a7e263c7e612a9
(cherry picked from commit d043004cee)
2020-04-02 21:51:59 +00:00
Winson Chiu
5f1c53480d Merge changes from topic "revert-10921255-revert-10403399-pkg-override-label-icon-DCRMJNYAKW-YCXMFEDIAG" into rvc-dev am: bd24ca3daf am: 0905856ed1 am: 4d64895998 am: 60dbc0f8d5
Change-Id: I5b132209c50e2dd5b6d879cd9f45951a2fb5561b
2020-04-02 19:01:58 +00:00
Mehdi Alizadeh
440beb1e84 Merge "Adds ShortcutServiceInternal#isSharingShortcut()" into rvc-dev am: 6ddae0c22b am: 51222c1636 am: 8cb5a8df40 am: f981a9f356
Change-Id: Ia3aba81260112c69025f518bae683619659031e7
2020-04-02 18:03:20 +00:00
Winson Chiu
bd24ca3daf Merge changes from topic "revert-10921255-revert-10403399-pkg-override-label-icon-DCRMJNYAKW-YCXMFEDIAG" into rvc-dev
* changes:
  Add mPackageParserCallback assignment in TestParams constructor
  Revert "Revert "Allow overriding the label and icon of a MainCom..."
  Revert^2 "Add test constructor to PackageManagerService"
2020-04-02 07:49:40 +00:00
Rhed Jao
269616bed2 Fix an exception while scanning apex packages
Package parser throws an exception while it's in the onlyCoreApp
state and parsing an non-core app. Catching the parser exception
during scanning apex packages, if the apex is without coreApp
attribute and device is in minimal boot state.

Also, updates package parser to V2 for the staging manager.

Bug: 151296698
Test: atest ApexManagerTest
Test: atest StagedInstallTest
Change-Id: I098e08d4064812465a29086c3fde1a55348bcae5
2020-04-02 12:41:51 +08:00
Mehdi Alizadeh
f802f3777e Adds ShortcutServiceInternal#isSharingShortcut()
Bug: 152346206
Test: atest com.android.server.pm.ShortcutManagerTest1
Change-Id: I86bea32215a24aa5c7be3a5bc4bbf704b39baea0
2020-04-01 21:49:44 +00:00
Ryan Mitchell
199b09a1a7 Begin moving FrameworkResourceLoaderTest to cts
This changes removes FrameworkResourceLoaderTest from frameworks/base
before it is moved to CTS.

Bug: 152979463
Test: atest CtsResourcesLoaderTest
Change-Id: I4b899564ab93472cb6d2a5ed0917026753c2827f
2020-04-01 20:09:29 +00:00
Steven Thomas
3c4fbe9686 Merge changes from topic "revert-10403399-pkg-override-label-icon-DCRMJNYAKW" into rvc-dev am: b69f2bc126 am: 745b38486b am: a29a64c17e am: 8cef774d81
Change-Id: Id79432b343d9b15852434f1619de7151c9c3645e
2020-04-01 19:21:13 +00:00
Winson Chiu
8e865ecd06 Revert "Revert "Allow overriding the label and icon of a MainCom..."
Revert submission 10921255-revert-10403399-pkg-override-label-icon-DCRMJNYAKW

Reason for revert: Re-submit broken change with included fix.
Reverted Changes:
Ic5c719cbb:Revert "Allow overriding the label and icon of a M...
Id9d37e661:Revert "Add test constructor to PackageManagerServ...

Bug: 113638339

Change-Id: I4f5247f528f62c175bd34f0e4cb16c9456c8afe4
2020-04-01 19:17:53 +00:00
Steven Thomas
b69f2bc126 Merge changes from topic "revert-10403399-pkg-override-label-icon-DCRMJNYAKW" into rvc-dev
* changes:
  Revert "Add test constructor to PackageManagerService"
  Revert "Allow overriding the label and icon of a MainComponent"
2020-04-01 18:13:13 +00:00
Steven Thomas
822bc84bfe Revert "Allow overriding the label and icon of a MainComponent"
Revert submission 10403399-pkg-override-label-icon

Reason for revert: Droidcop: Potential culprit for Bug 152987173 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted Changes:
I4b20ec294:Add test constructor to PackageManagerService
Id48eda556:Allow overriding the label and icon of a MainCompo...

Change-Id: Ic5c719cbbd904f8cc1c5c6a6d826c7b807f03e39
2020-04-01 17:50:51 +00:00
Winson Chiu
2ce450a967 Merge changes from topic "pkg-override-label-icon" into rvc-dev am: 9249981abb am: d074c073d4 am: 7b62a5a6df am: b5f9f04e03
Change-Id: Ie56856d0e30cf0899e32c2303fec0078ae121769
2020-04-01 17:39:42 +00:00
Winson Chiu
9249981abb Merge changes from topic "pkg-override-label-icon" into rvc-dev
* changes:
  Allow overriding the label and icon of a MainComponent
  Add test constructor to PackageManagerService
2020-04-01 16:53:57 +00:00
Charles Chen
529318a713 Update documentation of Resources#getDisplayMetrics
Test: build & run
fixes: 150213575
Change-Id: I439a8f8473236e29cc6371cda51e46a3b242ec3e
2020-04-01 18:29:51 +08:00
Winson Chiu
36228de8a2 Merge changes Id7d1ff26,Id53a2e65 into rvc-dev am: bde104f8be am: 1eeef296d2 am: 0f31ef312c am: 3c73f8553a
Change-Id: I5941e087972363398cc8ab85c158ffd0afe6229a
2020-04-01 06:41:18 +00:00
Winson
727da64be5 Gate stricter manifest enforcement on targetSdk R
Two package parsing issues have been promoted to failures in R:
a missing <application>/<instrumentation> tag, and an empty
"android:name" attribute. The latter due to a bug in the parsing
code.

These need to be gated by targetSdkVersion so that APKs built for
previous versions can still scan/install properly. This change
introduces support for this through a framework that leverages
@ChangeId to introduce individually toggle-able errors, in
case a developer needs to install an app that isn't completely
migrated for a new SDK version yet.

The ignoreError method was removed from ParseResult as the errors
it was used for were manually compared to PackageParser and it's
likely they can be hard errors without breaking anything.

This also adds tests for general ParseInput/Result behavior.

Exempt-From-Owner-Approval: AppIntegrity already approved in older PS.

Bug: 150776642

Test: atest android.content.pm.parsing.result.ParseInputAndResultTest
Test: atest com.android.server.pm.parsing.PackageParsingDeferErrorTest
Test: atest com.android.server.integrity.AppIntegrityManagerServiceImplTest
Test: atest com.android.server.pm.parsing

Change-Id: Id53a2e65f6e5e4dee9a41cc77007275b3a220ac3
2020-04-01 05:42:52 +00:00
Automerger Merge Worker
0dae415ae7 Merge "Merge "Use ParcelableException to put exception in bundle" into rvc-dev am: 13c7d899da am: 3c7be53621" into rvc-d1-dev-plus-aosp am: d7dfb5c9a8 am: 453710ca59
Change-Id: I15612e4c77e989fb2a7b4ed6d13033d03c093070
2020-03-31 20:50:50 +00:00
Dmitri Plotnikov
13c7d899da Merge "Use ParcelableException to put exception in bundle" into rvc-dev 2020-03-31 18:36:57 +00:00
Winson
561e0afb94 Allow overriding the label and icon of a MainComponent
Normally these attributes are immutable once parsed from the
AndroidManifest.xml of the corresponding app, but there exists
a requirement for a special privileged app to change this
at runtime.

This change allows overriding label/icon of any component
(Activity, Receiver, Provider, Service) that belongs to the
app declared as R.string.config_overrideComponentUiPackage.

This role can only be taken by 1 package, which must be a system
app, and state is stored per-user. Different users with potentially
different requirements can show a different label/icon.

Co-authored-by: Yoshiaki Naka <yoshiaki.naka@sony.com>

Bug: 113638339

Test: manual verify behavior using test app
Test: atest PackageManagerComponentOverrideTests

Change-Id: Id48eda55650ffc88854423498675b001c2500259
2020-03-31 03:14:25 -07:00
JW Wang
1876a22e6e Merge "Replace IntArray with List<Integer> (3/n)" 2020-03-31 06:08:43 +00:00
Diego Vela
ebdfac0b49 Merge "Fix incorrect closing tag" into rvc-dev am: fb94ded221 am: bdbf0e5a72 am: aad2c42b47 am: 9dbbe51a24
Change-Id: I757a889e4862efef0654bfa2da3bb57a3345af53
2020-03-31 05:59:21 +00:00
Ryan Mitchell
d5c3aff922 Merge "Synchronize before calling unstableRemoveIf" into rvc-dev am: ad5a070a87 am: 84e64c26ee am: a1a1a212cf am: 61f1cc5152 am: c928850493
Change-Id: I6b6b04dc2ed082852fd1a2903f9e374ac2ff840d
2020-03-31 04:35:52 +00:00
Diego Vela
fb94ded221 Merge "Fix incorrect closing tag" into rvc-dev 2020-03-30 23:42:08 +00:00
Dmitri Plotnikov
e7f48d9917 Use ParcelableException to put exception in bundle
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Bug: 149184281
Change-Id: Ice6e1207ace7a0cc6b4b8dc1b99da22b13b04031
2020-03-30 20:49:05 +00:00
Jackal Guo
898bcafe7d Merge "Using for loop instead of stream" into rvc-dev am: c822c12780 am: f8df08f780 am: a34e1e2ec4 am: 55e9fef1d0 am: 72688f975e
Change-Id: I52d6e633dd7141a81fe87b5556f6bae2319463cf
2020-03-30 19:06:03 +00:00
Adam Bookatz
9968525afb Merge "UserSystemPackageInstaller only (un)installs when appropriate" into rvc-dev 2020-03-30 18:09:25 +00:00
Ryan Mitchell
ad5a070a87 Merge "Synchronize before calling unstableRemoveIf" into rvc-dev 2020-03-30 15:44:00 +00:00
JW Wang
6270482457 Replace IntArray with List<Integer> (3/n)
Per discussion of go/modularize-rollbackmanager, module code can't use
hidden APIs. Considering CPU and memory impact, we decide to replace
IntArray with List<Integer> to get rid of the use of hidden APIs.

Bug: 150347230
Test: atest RollbackUnitTest
      atest RollbackStoreTest
      atest AppDataRollbackHelperTest
Change-Id: Ica3b0d3bd0eb930cc6cb89f06a7dd9a89202fcf3
2020-03-30 11:09:34 +08:00
Jackal Guo
c822c12780 Merge "Using for loop instead of stream" into rvc-dev 2020-03-30 01:08:46 +00:00
Adam Bookatz
8006a71876 Merge "UserSystemPackageInstaller only (un)installs when appropriate" 2020-03-28 00:29:49 +00:00
Adam Bookatz
1efd27cde3 UserSystemPackageInstaller only (un)installs when appropriate
The UserSystemPackageInstaller (USPI) uninstalls system
packages that are not needed, depending on the user type.
When that determination changes (or the feature is disabled)
it can also re-install those packages.
This cl specifies when it is appropriate for USPI to actually
perform the (un)installation.

1.
Introduces uninstallReason: records the reason why a package
was uninstalled from a given user. Right now, the only values
are UNKNOWN and USER_TYPE. The latter indicates that the USPI
system uninstalled the package. If the USPI whitelist changes
(or the USPI feature is disabled), uninstalled packages will
only be installed by USPI if the uninstallReason was USER_TYPE.
Any further uninstalls (e.g. by ManagedProvisioning) will reset
the uninstallReason to UNKNOWN, so USPI will no longer install
such packages in the future.
This prevents USPI from reinstalling system packages that other
mechanisms (such as ManagedProvisioning) uninstalled.

2.
USPI will uninstall a system package if it is blacklisted, but
only if that system package is new, i.e in two circumstances:
a. on first boot
b. on an OTA where the package was not present prior to the OTA

Bug: 143200798
Test: atest UserSystemPackageInstallerTest
Test: Confirmed (un)installations during manually simulated OTAs
Change-Id: Ia0714d1faa8f7c79082f2cc93a92ae36b9a4c918
Merged-In: Ia0714d1faa8f7c79082f2cc93a92ae36b9a4c918
2020-03-28 00:19:37 +00:00
Chris Li
f5e484ea7a Merge "Report incorrect context usage in ViewConfiguration" into rvc-dev am: c64d21d47a am: 5d0046ee46 am: bcbe1c853b am: bd88785e86
Change-Id: I51e744faf91439f7ed454c67906f7396f97f8c24
2020-03-27 22:16:16 +00:00
Chris Li
c64d21d47a Merge "Report incorrect context usage in ViewConfiguration" into rvc-dev 2020-03-27 20:19:15 +00:00
Adam Bookatz
a141493130 UserSystemPackageInstaller only (un)installs when appropriate
The UserSystemPackageInstaller (USPI) uninstalls system
packages that are not needed, depending on the user type.
When that determination changes (or the feature is disabled)
it can also re-install those packages.
This cl specifies when it is appropriate for USPI to actually
perform the (un)installation.

1.
Introduces uninstallReason: records the reason why a package
was uninstalled from a given user. Right now, the only values
are UNKNOWN and USER_TYPE. The latter indicates that the USPI
system uninstalled the package. If the USPI whitelist changes
(or the USPI feature is disabled), uninstalled packages will
only be installed by USPI if the uninstallReason was USER_TYPE.
Any further uninstalls (e.g. by ManagedProvisioning) will reset
the uninstallReason to UNKNOWN, so USPI will no longer install
such packages in the future.
This prevents USPI from reinstalling system packages that other
mechanisms (such as ManagedProvisioning) uninstalled.

2.
USPI will uninstall a system package if it is blacklisted, but
only if that system package is new, i.e in two circumstances:
a. on first boot
b. on an OTA where the package was not present prior to the OTA

Bug: 143200798
Test: atest UserSystemPackageInstallerTest
Test: Confirmed (un)installations during manually simulated OTAs
Change-Id: Ia0714d1faa8f7c79082f2cc93a92ae36b9a4c918
2020-03-27 12:00:52 -07:00