Commit Graph

9745 Commits

Author SHA1 Message Date
Songchun Fan
c7c2e0e270 Merge "[incremental/pm] register progress listener" 2020-09-16 05:02:37 +00:00
Songchun Fan
a70985945b [incremental/pm] register progress listener
Incremental Serivce periodically polls loading progress and sends to
Package Manager Service. Package Manager provides APIs for other
interested parties to listen to the loading progress.

BUG: 165841827
Test: unit test
Change-Id: I44b9e17c2240b9efe53bc09fc728b6671f1f7dfe
2020-09-15 17:39:41 -07:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Winson Chiu
40e1467fd0 Merge "Optimize (Parsing)PackageImpl implementation" 2020-09-15 16:22:37 +00:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
da7478b570 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I9b79dbf3e9983523db11599d8ae289b05aabf80c
2020-09-14 23:42:34 +00:00
Winson
c086fe9ac1 Optimize (Parsing)PackageImpl implementation
To speed up recurring ApplicationInfo creation, this caches
the the appInfoFlags/appInfoPrivateFlags at parse time, since
they're immutable at that point. This saves having to calculate
it hundreds of times for all the packages in getInstalledPackages
or similar.

This also saves the base app data directories for the system user,
or user 0, interning the strings since they're shared across
packages with the same volume UUID. A better solution would
cache these paths during boot scan and re-use the strings directly
rather than re-building and relying on interning, but there was
no good mechanism for that.

This decreases string append computation time and compromises
between persistent memory and performance.

This also compacts boolean fields into a bitset, decreasing
the amount persisted in both the object memory and the Parcelable
output.

In combination these changes result in a net decrease in memory
usage, although the difference is neglible, on the order of
~4KB for 181 packages or ~22B a package. The increase in speed is
roughly 2/3rds saved off the total time of generateWithComponents.

An important note is that hideAsParsed/hideAsFinal are now
required to be called because they now calculate the derived
fields to be cached.

Bug: 153656459

Test: atest CrossProfileAppsServiceImplRoboTest
Test: atest PackageManagerComponentLabelIconOverrideTest
Test: atest PackageParserTest
Test: atest UserSystemPackageInstallerTest
Test: atest DexoptUtilsTest
Test: atest com.android.server.pm.parsing
Test: atest PackageInfoUserFieldsTest
Test: atest com.android.server.pm.ScanTests
Test: atest android.content.pm.cts.PackageManagerTest

Change-Id: I977edb9dec720893ccb1ce5b9df33733c408d3c1
2020-09-14 15:06:41 -07:00
Mat Bevilacqua
8160121220 Initial commit of PowerStatsService
Bug: 164465661
Bug: 164466995
Bug: 167280723
Test: Verified PowerStatsService is functional on targets that
have ODPM data.

Change-Id: Ic555b380c566ea26bc2214374f142c5448ea2ee7
2020-09-14 20:30:49 +00:00
Alex Buynytskyy
d15391e426 Rollforward: Digest API: allow installer to provide digests for an APK.
5d9710d5b72136b2face76b578ac120ad6ed931e

Bug: 160605420
Fixes: 168445565
Test: atest ChecksumsTest
Test: atest ApkVerityTest:com.android.apkverity.ApkVerityTest

Change-Id: Ib559ad9107996290f4ae4661ccec4dc14658a7e9
2020-09-14 16:23:40 +00:00
Jeff Sharkey
16dd960d6f Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Id1a0f2a38e41badee3a34bd71af240511f273a7b
2020-09-14 10:00:05 -06:00
Jeff Sharkey
6516a83886 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ifce5239991e3b78dd4757712e3b88093ad7161f0
2020-09-14 10:00:02 -06:00
Jeff Sharkey
705f6bec2d Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I53003332717baf57dc088b2f6b969cdb1863f65e
2020-09-14 09:59:01 -06:00
Slava Shklyaev
a3d1d1452a Merge "Revert "Digest API: allow installer to provide digests for an APK."" 2020-09-14 15:43:44 +00:00
Slava Shklyaev
4a102df4f2 Revert "Digest API: allow installer to provide digests for an APK."
Revert "Tests for installer-provided checksums."

Revert submission 12538860-installer-digests

Reason for revert: Droidcop: Potential culprit for b/168445565
Reverted Changes:
I112ba8594:Tests for installer-provided checksums.
I69a787bde:Digest API: allow installer to provide digests for...

Bug: 168445565
Change-Id: I2276373024bb951719cf056d28c4de0838c0519f
2020-09-14 15:25:59 +00:00
TreeHugger Robot
69db2f9521 Merge "Added UserInfo.convertedFromPreCreated" 2020-09-12 20:48:26 +00:00
Alex Buynytskyy
0138bf5f53 Merge "Digest API: allow installer to provide digests for an APK." 2020-09-12 03:45:19 +00:00
Alex Buynytskyy
48c717ecc1 Digest API: allow installer to provide digests for an APK.
Bug: 160605420
Test: atest ChecksumsTest

Change-Id: I69a787bde596c9841ba04772a06c227d902f721f
2020-09-11 13:00:43 -07:00
TreeHugger Robot
ce48d61c99 Merge "Fix up PackageSetting pkg and path documentation" 2020-09-10 01:37:52 +00:00
Winson
b92073c580 Fix up PackageSetting pkg and path documentation
Renames baseCodePath -> baseApkPath and codePath -> path to better
reflect their actual meanings. Their respective JavaDoc has also been
consolidated and updated.

Also explains why the pkg field can be null, as this has been the cause
of a significant number of bugs. Also hides it behind a getter to
preempt any mutation issues. Doesn't refactor existing usages. This can
be done inline with other changes that touch that code.

Bug: 164218844
Bug: 164488334

Test: atest com.android.server.pm

Change-Id: Ia254e7cebb0ab86165e5ec42e8f8bfcf8673884b
2020-09-09 16:19:44 -07:00
TreeHugger Robot
07ca993ac3 Merge "Allow "self" to also use RecognitionService" 2020-09-09 22:27:41 +00:00
TreeHugger Robot
38cc1531f3 Merge "Clean up trivial package refactor TODOs" 2020-09-09 20:28:56 +00:00
Philip P. Moltmann
56d6e0453e Allow "self" to also use RecognitionService
restoring Q behavior

Bug: 160933537
Test: TH
Change-Id: I66e5b743f1e61f744f9aad2248a9b619fd9b97f7
2020-09-09 13:24:55 -07:00
Felipe Leme
c2aa0be065 Added UserInfo.convertedFromPreCreated
This attribute is useful to identify (on bugreports) whether a
user was created "from scratch" or converted from a pre-created user.

Test: adb shell cmd user list --all -v
Test: adb shell dumpsys user
Test: atest UserControllerTest UserManagerServiceUserInfoTest

Bug: 165703573

Change-Id: Iee9df636db5677b4d968d49bb5f5b3fbb9a7f02d
2020-09-08 17:36:15 +00:00
TreeHugger Robot
ff512344d2 Merge "Update language to comply with Android's inclusive language guidance" 2020-09-07 07:19:55 +00:00
Jackal Guo
4f020a8dd1 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

Fix: 167521269
Test: m docs
Change-Id: Ia8b8e9248dc48ce40ba862aea48e24e43febbfac
2020-09-07 13:53:23 +08:00
Andrii Kulian
e2bd80228d Don't default to 1.33 min aspect ratio for pre-Q apps
1.33 minAspectRatio requirement for legacy apps was removed from CDD.

Bug: 165945457
Test: Verify resolved minAspectRatio on pre-Q apps
Change-Id: Ib9e14c2986dd27f900bd8a5fc4d500da3381e73d
2020-09-04 16:01:54 -07:00
TreeHugger Robot
ae052c9936 Merge "Update INSTALL_FAILED_REPLACE_COULDNT_DELETE's comment" 2020-09-01 06:44:22 +00:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Felka Chang
8defec445f Update INSTALL_FAILED_REPLACE_COULDNT_DELETE's comment
To make the comment of INSTALL_FAILED_REPLACE_COULDNT_DELETE easy to
be understood by the developers.

INSTALL_FAILED_REPLACE_COULDNT_DELETE is used to express the situation
that the new package replace the system package neither with
DELETE_SYSTEM_APP flag nor delete application for users.

Fixes: 149890172
Test: m docs
Change-Id: I57fe81845c81376cfa61224dd37579ade2223fa1
2020-09-01 10:07:26 +08:00
Jackal Guo
fa817ade0d Merge "Update the document" 2020-09-01 01:07:41 +00:00
Jackal Guo
b47f1dc91c Update the document
Both getInstallAsInstantApp and getInstallAsFullApp have an unused
boolean parameter. Update the javadoc to note that the argument is
ignored.

Bug: 166546001
Test: m docs
Change-Id: I10083ab1996d9f6926c647aafc71aa3814db89e6
2020-08-31 10:17:10 +00:00
TreeHugger Robot
577539c9a0 Merge "Fix transfer API." into rvc-qpr-dev am: 92d9af6c47
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12478084

Change-Id: I9cc0cc4e7856f22f6917a2e22b6d40a3494142df
2020-08-28 17:38:30 +00:00
Alex Buynytskyy
b1d0a839f1 Fix transfer API.
Transfer API should throw security exception when transfering the
session which is not installing the original installer.
Moving it onto commit stage and still fail the installation.

Fixes: 165775712
Test: atest InstallSessionTransferTest
Test: atest -p frameworks/base/services/core/java/com/android/server/pm
Change-Id: I8511d4357788e70f83bcbd366908b42a691afbcb
Merged-In: I8511d4357788e70f83bcbd366908b42a691afbcb
2020-08-28 05:06:41 +00:00
hkuang
3eb57dc580 TranscodingAPI: Expose MediaTranscodeManager as System API.
Bug: 160260102
Test: Unit test
Change-Id: I38e9efc46e23fe1aafe65100bbc7f72eb200720f
2020-08-27 22:20:18 +00:00
Mohammad Samiul Islam
ac0b486841 Merge "Remove dry run flag and its use" 2020-08-27 10:05:03 +00:00
Colin Cross
082aec6c84 Revert "Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c4223e1d0..."
Revert "Snap for 6793014 from 44725f06b7f7d6407b5ee82d989bdd6c7a..."

Revert "Snap for 6793014 from f22ad3164937a8f2e309965c102b6366d5..."

Revert "Snap for 6793014 from 11467102abddb6026aaa164c1361439c2d..."

Revert "Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5f7ae65..."

Revert "Snap for 6793014 from f2989f9c65556d5155dbd57f82f0c93a16..."

Revert "Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab1222ffd6..."

Revert "Snap for 6793014 from 3777d883a3857b1a1589181c436d9018d7..."

Revert "Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528460c8b..."

Revert "Snap for 6793014 from a43295d1825da62af038d345a7a861ed7a..."

Revert "Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb386109..."

Revert "Snap for 6793014 from d0e31526c62b2aeb35c293ac96feb180fc..."

Revert "Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376efabd2..."

Revert "Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293b79684..."

Revert "Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57a8e7d5..."

Revert "Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aad87a67..."

Revert "Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24af9964..."

Revert "Snap for 6793014 from 14cb57e107a3abce8b14937b1f92c28d18..."

Revert "Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc03a606..."

Revert "Snap for 6793014 from 8c65adad0bcdfb3acc561063b4048dca24..."

Revert "Snap for 6793014 from b3061942700265e2bf04af9997775dcbbb..."

Revert "Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd0ac3be..."

Revert "Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec70d8da6..."

Revert "Snap for 6793014 from 988d4244914e0c749655e8cb6db18ba44f..."

Revert submission 12465146-release-request-6b259cbc-1f45-4b05-bc7e-c9b893b79d68-for-git_main-busytown-release-6793014

Reason for revert: b/166531456
Reverted Changes:
I5ff7a6c0d:Snap for 6793014 from f2989f9c65556d5155dbd57f82f0...
I77bdff943:Snap for 6793014 from a43295d1825da62af038d345a7a8...
I2ac5c520a:Snap for 6793014 from c3f124cca05579acf0a6cb589ebd...
I023b9702f:Snap for 6793014 from 98756d6d3e2bb0ba28eb125caa7a...
Ibc7893d72:Snap for 6793014 from fd1ad6750ef332d3f50f218f4d5d...
Ic27847bee:Snap for 6793014 from 8c65adad0bcdfb3acc561063b404...
If20bc9352:Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376...
I6542d17e8:Snap for 6793014 from 3777d883a3857b1a1589181c436d...
I66e6bb8a9:Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab12...
I3cd190b6b:Snap for 6793014 from 424180bdc4aa18249e678daebfd0...
If92db7402:Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc...
Iaced03c87:Snap for 6793014 from d0e31526c62b2aeb35c293ac96fe...
I5d28c6b4b:Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aa...
I30d07bea3:Snap for 6793014 from 7594ec6384c4da320726def34f47...
I473205f48:Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd...
I0656b41af:Snap for 6793014 from 44725f06b7f7d6407b5ee82d989b...
I0f9796067:Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec7...
I9a38cda8f:Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb...
I876a82f51:Snap for 6793014 from 11467102abddb6026aaa164c1361...
I749d7d023:Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293...
I038daea41:Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24...
I47aa3131c:Snap for 6793014 from 14cb57e107a3abce8b14937b1f92...
I32dba8a95:Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528...
I2ebc9f9db:Snap for 6793014 from 988d4244914e0c749655e8cb6db1...
Iae7c3370f:Snap for 6793014 from 9ffb8852294e06e2d387dc1fb868...
I6467a7f1b:Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57...
I8c6375203:Snap for 6793014 from b3061942700265e2bf04af999777...
I843b2e1f3:Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5...
Ie254f7079:Snap for 6793014 from f22ad3164937a8f2e309965c102b...
I01e0974ed:Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c42...

Change-Id: I9160aa1ae5523d8e92c618ae1922576bb70a7ac8
2020-08-27 04:12:26 +00:00
Winson
c17bb68cd6 Clean up trivial package refactor TODOs
Several TODOs were wrapped up as part of other work, but not cleaned up
properly.

Also fixes some toString methods which were incorrectly copy-pasted.

Bug: 160868823

Test: manual build, mostly non-functional changes

Change-Id: I577786f1ee178922a8d9a0d6c2708589b1b8dc37
2020-08-26 13:32:31 -07:00
Alex Buynytskyy
ec6f3e189c APK digest API and initial implementation.
Bug: 160605420
Test: atest ChecksumsTest

Change-Id: I08ef0b131c44313f2c6acddad00dfa03598cc1ff
2020-08-24 19:54:02 -07:00
Mohammad Samiul Islam
a78d25cdfb Remove dry run flag and its use
Bug: 159336213
Test: atest StagedInstallTest
Change-Id: Ie0d2346d6391b55506d3548879730b7b0329d80f
2020-08-24 12:48:06 +01:00
Darryl Johnson
48f430566d Merge "Don't override config of display contexts with activity display." 2020-08-20 21:47:53 +00:00
Darryl L Johnson
3c0078e80f Don't override config of display contexts with activity display.
This change migrates the previous usages of
ResourcesManager#getResources() from using the display id of expected
resources to an override display ID which will override the display
properties from the parent token resources. This ensures that all
contexts derived from a display context keep the overrides for their
intended display.

This also changes the meaning of ResourcesKey#mOverrideConfiguration and
ResourcesKey#mDisplayId. Previously mDisplayId was used as both the
current display of the ResourcesKey and used to apply overrides
to mOverrideConfiguration. This made it unclear whether a particular key
should keep its display override when an activity changes display or
whether it should inherit the new display from the activity. Now the
display IDs and overrides are managed by the ActivityResources struct and the
ResourcesKey is expected to only contain the final display ID expected
for the resources in 'mDisplayId' and the final configuration that should
be applied to the global configuration in 'mOverrideConfiguration'.

Fixes: 153866583
Fixes: 156758475
Fixes: 163813210
Fixes: 163812902
Fixes: 163813227

Test: ActivityThreadTest
Test: ResourcesManagerTest
Test: AppConfigurationTests#testActivityContextDerivedDisplayContextOrientationWhenRotating

Change-Id: If93f98f93ee15b27d8c7292a2f830c2cc0f49277
2020-08-20 10:15:48 -07:00
TreeHugger Robot
739663d450 Merge "Replace redundant error code with a specific one" 2020-08-20 12:59:20 +00:00
Mohammad Samiul Islam
4292708d0e Replace redundant error code with a specific one
As discussed on b/163039465#comment3, it's not desirable to have two
distinct catch-all error bucket, where the difference is very subtle.

Opting to use STAGED_SESSION_CONFLICT which is more specific, but not
too specific. We can use this error is any scenarios where a staged
session interferes with installation of another staged session and
we have to fail one of them, e.g a staged session is blocking a
rollback or rollback will be causing API downgrade which will break
another staged session (b/163734200).

Bug: 163039465
Test: atest atest RollbackManagerHostTest#testRollbackFailsBlockingSessions
Test: atest StagedInstallTest
Change-Id: Ia05350024093cd537e8ced5ea02af5853620d6ef
2020-08-19 11:11:03 +01:00
Hans Boehm
4f93042048 Merge "Fix ApkAssets mNativePtr accesses" 2020-08-18 04:41:53 +00:00
Hans Boehm
3d49ac4660 Fix ApkAssets mNativePtr accesses
Actually acquire the monitor it claims to be guarded by. Since it was a
final field, it's still not entirely clear what that means.

Clear mNativePtr when we deallocate its referent. This prevents native
heap corruption if methods here are called from another finalizer.
Remove mOpen and use mNativePtr instead.

This probably does not fix the bug below. But let's get rid of the
possible heap corruption source we know about.

Bug: 159041693
Test: Build and boot
Change-Id: I6f0f6250ca8b6a4274c346ae99f1f94cab5844e1
2020-08-17 18:32:31 -07:00
Jackal Guo
2c3f50ce8c Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97 am: 460fc577c9 am: c6564bee2a am: 5666ed9b0d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: I7c1d365f123d6ac7dfe410da3593af716817aa58
2020-08-17 02:04:55 +00:00
Jackal Guo
5666ed9b0d Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97 am: 460fc577c9 am: c6564bee2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: Idbf4ff204c708c80dadc421d50934e9a041b0378
2020-08-17 01:52:11 +00:00
Jackal Guo
c6564bee2a Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97 am: 460fc577c9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: Ia18cae33d2efc71f61c1a2a37b25a1fb2147ccfb
2020-08-17 01:43:16 +00:00
Jackal Guo
460fc577c9 Merge "Update language to comply with Android's inclusive language guidance" am: 0090d82f18 am: c3972b8d97
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398286

Change-Id: Iefb939a07702b1aecfab75a03decf85ab6b55b50
2020-08-17 01:30:51 +00:00
TreeHugger Robot
e00c072047 Merge "Fix confusion of userId vs. uid" 2020-08-14 22:50:55 +00:00