Commit Graph

8333 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
TreeHugger Robot
34cb1e1519 Merge "Link wm shell command to enable protolog in shell" 2020-09-15 21:28:57 +00: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 Chung
d2b6017684 Link wm shell command to enable protolog in shell
- Pass through unhandled logging commands to SysUI to simplify
  enabling/disabling logging for the shell.

Bug: 168497382
Test: adb shell wm logging enable-text WM_SHELL_TASK_ORG
Test: adb shell wm logging enable-text WM_DEBUG_RECENTS_ANIMATIONS
Change-Id: I37942eaee82fdcf545212b18375f3d3e2638b8ee
2020-09-15 12:18:50 -07:00
Winson Chiu
40e1467fd0 Merge "Optimize (Parsing)PackageImpl implementation" 2020-09-15 16:22:37 +00:00
Fiona Campbell
5e687ef407 Merge "Remove TODO" 2020-09-15 09:21:05 +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
2192b22cf2 Merge changes from topic "sep11"
* changes:
  Remove advisory registerNativeAllocation().
  Hand-rolled linked list for Parcel performance.
2020-09-14 23:53:57 +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
Jeff Sharkey
741c0a78cc Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I7da537200efe31e803234bd1a0236843064186c8
2020-09-14 23:10:42 +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
Jing Ji
157550849f Track the child processes that are forked by app processes
Apps could use Runtime.exec() to spawn child process and framework
will have no idea about its lifecycle. Now track those processes
whenever we find them - currently during the cpu stats sampling
they could be spotted. If it's consuming too much CPU while its
parent app process are also in the background, kill it.

By default we allow up to 32 such processes; the process with the
worst oom adj score of their parents will be killed if there are
too many of them.

Bug: 160548789
Bug: 157089413
Test: atest AppChildProcessTest
Test: atest CtsAppTestCases:ActivityManagerTest
Change-Id: I95b20a1f36ccd43d09027201d14872305b169d8d
2020-09-14 10:39:06 -07: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
Jeff Sharkey
c208099506 Remove advisory registerNativeAllocation().
After consulting with the ART team, we learned that sending them
detailed advisory native allocation sizes isn't as useful when the
overall lifecycle of the object is tightly managed, which is the
case with Parcel objects.  (Because Parcel users use explicit
obtain() and recycle() methods, any variable-sized native
allocations have already been freed by the time a Parcel instance
is considered for GC.)

The Parcel benchmarks referenced below are showing a uniform ~3%
performance improvement across 1, 4, and 16 thread cases.  Note that
this is in addition to the improvements recently made with the shift
to a linked-list pooling design.

Bug: 165032569
Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:android.os.ParcelObtainPerfTest
Change-Id: Id0ce9b3bff1d0ffb426a9f105c7a54eb00060f85
2020-09-11 11:18:30 -06:00
Bradley Allen
86ae8e29b6 Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc am: 7fad6c94d6 am: 86b4867913 am: 9920ad38f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: Ieeeb630b72f3b809620a4520dce09412f1a396e9
2020-09-10 17:59:25 +00:00
Bradley Allen
9920ad38f6 Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc am: 7fad6c94d6 am: 86b4867913
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: I18cf6a43e0e89bc6d8a0833fa797f6f39fabc153
2020-09-10 16:23:56 +00:00
Bradley Allen
86b4867913 Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc am: 7fad6c94d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: I5c439afb2294cbae80660178dce46d4f2cd3300a
2020-09-10 16:02:36 +00:00
Bradley Allen
e2cc59d76c Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: Ic39b3b9ffd4338b4fcd060fd628411b5beceb060
2020-09-10 15:52:28 +00:00
Bradley Allen
7fad6c94d6 Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: Ib44d0aee6a87a79dcc668337c945d67678e4c43d
2020-09-10 15:51:51 +00:00
Bradley Allen
5d7be413bc Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev 2020-09-10 15:23:01 +00:00
Martijn Coenen
cf38e32ef4 Merge "Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode transition." into rvc-qpr-dev am: f902374308
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12419090

Change-Id: If07ef71f7c175c32096631eb9aea1f00636a1713
2020-09-10 10:49:11 +00:00
Martijn Coenen
f902374308 Merge "Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode transition." into rvc-qpr-dev 2020-09-10 10:21:49 +00:00
Martijn Coenen
decc8a2353 Merge "Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode transition." 2020-09-10 07:38:55 +00:00
Seigo Nonaka
f192ef78ae Accept repeated locale as an input of LocaleList construction. am: 41b1674f77 am: 8b4cd9aef3 am: c0b541b0ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540040

Change-Id: I1d7f2cf3d005534c841e16d46fdd5096ef5047e0
2020-09-09 21:29:29 +00:00
Seigo Nonaka
9555d60871 Accept repeated locale as an input of LocaleList construction. am: 41b1674f77 am: 8b4cd9aef3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540040

Change-Id: I5e6889206dc08d4475695ed619c5b5fc1423e6a0
2020-09-09 20:57:57 +00:00
Seigo Nonaka
c0b541b0ec Accept repeated locale as an input of LocaleList construction. am: 41b1674f77 am: 8b4cd9aef3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540040

Change-Id: If6140b007349d0c4be79c98acc816c9de3c55e61
2020-09-09 20:57:20 +00:00
Seigo Nonaka
8b4cd9aef3 Accept repeated locale as an input of LocaleList construction. am: 41b1674f77
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540040

Change-Id: I69509d7ddadb1787f56ce31f0ff2fb617537b2ce
2020-09-09 20:33:10 +00:00
TreeHugger Robot
6e480c0dde Merge "Accept repeated locale as an input of LocaleList construction." into rvc-qpr-dev am: b303b8eae1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540550

Change-Id: I3283505c572d270a2a7b50e4fa83f747ab3d09cd
2020-09-09 20:19:08 +00:00
Bradley Allen
cefc89c911 docs: Added links to the Android 11 summary pages on developer.android.com.
Test: http://go/forrest-run/L06800000688439076
Bug: 163618180
Change-Id: Ibe136020df4ef60183f3726fc0f6336b58c37f99
2020-09-09 17:41:07 +00:00
Seigo Nonaka
373ac57b2d Accept repeated locale as an input of LocaleList construction.
Repeated locale has not been accepted and IllegalArgumentException
is thrown. Instead of throwing exception, dropping repeated locale
instead.

Bug: 152410253
Test: atest LocaleListTest
Change-Id: I80f243678ac3024eaeb0349f770cff897df7f332
2020-09-08 22:35:39 +00:00
Seigo Nonaka
41b1674f77 Accept repeated locale as an input of LocaleList construction.
Repeated locale has not been accepted and IllegalArgumentException
is thrown. Instead of throwing exception, dropping repeated locale
instead.

Bug: 152410253
Test: atest LocaleListTest
Change-Id: I80f243678ac3024eaeb0349f770cff897df7f332
2020-09-08 20:22:48 +00:00
Treehugger Robot
3284f1c75f Merge "android.os.Binder: remove unused getFinalizer" am: c59758ab41 am: e98c205ba8 am: 4d279afec1 am: 402ef20f46 am: f5d56737ea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418956

Change-Id: I4cf1ecd318ea03823763d047a08f57539607f7fa
2020-09-08 17:13:07 +00:00
Treehugger Robot
f5d56737ea Merge "android.os.Binder: remove unused getFinalizer" am: c59758ab41 am: e98c205ba8 am: 4d279afec1 am: 402ef20f46
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418956

Change-Id: If247aae8c28671f63f0101cc96f1443b56173dee
2020-09-08 17:06:18 +00:00
Treehugger Robot
402ef20f46 Merge "android.os.Binder: remove unused getFinalizer" am: c59758ab41 am: e98c205ba8 am: 4d279afec1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418956

Change-Id: I1ea049a26712a8db06dd3f3c9bbaee7884ec5c30
2020-09-08 16:48:11 +00:00
Treehugger Robot
4d279afec1 Merge "android.os.Binder: remove unused getFinalizer" am: c59758ab41 am: e98c205ba8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418956

Change-Id: Ia3996b2e60afdb8944b431501ee90e3c1997b8c2
2020-09-08 16:22:14 +00:00
Treehugger Robot
e98c205ba8 Merge "android.os.Binder: remove unused getFinalizer" am: c59758ab41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1418956

Change-Id: Ia8f7da7e819eaa5080412efe86b7c9d96bb7b971
2020-09-08 15:45:15 +00:00
Treehugger Robot
c59758ab41 Merge "android.os.Binder: remove unused getFinalizer" 2020-09-08 15:26:56 +00:00
Martijn Coenen
27c52fcaa8 Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode
transition.

When handling unknown sources, PackageManager transitions from
MODE_DEFAULT to MODE_ERRORED, causing us to kill the app before the user
has even decided whether to allow external sources or not.

Since MODE_DEFAULT and MODE_ERRORED are the same from a storage point of
view, ignore transitions between the two.

This required some AppOps changes to store the previous mode and pass it
in.

Bug: 162849988
Test: run Epic installer
Change-Id: Ic866216f877e9b727fe70556f66dd998966fe0a2
Merged-In: Ic866216f877e9b727fe70556f66dd998966fe0a2
2020-09-08 14:23:31 +00:00
Martijn Coenen
e9e278f670 Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode transition.
When handling unknown sources, PackageManager transitions from
MODE_DEFAULT to MODE_ERRORED, causing us to kill the app before the user
has even decided whether to allow external sources or not.

Since MODE_DEFAULT and MODE_ERRORED are the same from a storage point of
view, ignore transitions between the two.

This required some AppOps changes to store the previous mode and pass it
in.

Bug: 162849988
Test: run Epic installer
Change-Id: Ic866216f877e9b727fe70556f66dd998966fe0a2
2020-09-08 16:21:51 +02:00
Steven Moreland
2e4e636f87 android.os.Binder: remove unused getFinalizer
This native method is unimplemented, and it is never called.

Bug: N/A
Test: N/A
Change-Id: I6da9da9dc47051bd7d1591a8e88272739e06cf4c
2020-09-04 00:30:55 +00:00
TreeHugger Robot
8317be2bbf Merge "Accept repeated locale as an input of LocaleList construction." 2020-09-03 22:17:48 +00:00
Seigo Nonaka
fc8c211b43 Accept repeated locale as an input of LocaleList construction.
Repeated locale has not been accepted and IllegalArgumentException
is thrown. Instead of throwing exception, dropping repeated locale
instead.

Bug: 152410253
Test: atest LocaleListTest
Change-Id: I80f243678ac3024eaeb0349f770cff897df7f332
2020-09-03 00:16:27 -07:00
Xin Li
c8c8e8e8be Merge RP1A.200720.011
Bug: 167588565
Merged-In: Iec7a26ecd68aca9c7a38cc8f441197a8237b0c8c
Change-Id: Ia8f5f008bc1f77115b644ab996aedc892fab68e7
2020-09-02 12:34:37 -07:00
Fiona Campbell
68b9085b28 Remove TODO
This todo doesn't need to happen since we're keeping both the int and float values for backwards compatibility.

Bug: 160141704
Test: manual
Change-Id: I26a5057acd7604578f3021c21a1412d6c1b7b0d6
2020-09-02 18:05:42 +01:00
Yo Chiang
309f789948 Merge "Check error status after installing each DSU partition" am: fbd85db85d am: 73d5afb2cb am: dbe6d55157 am: 9b2f226473 am: 52a88df94a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404669

Change-Id: I0b3f8dcbdfe4bf4451bb38d734aa423f489187d4
2020-09-02 06:25:57 +00:00
Yo Chiang
52a88df94a Merge "Check error status after installing each DSU partition" am: fbd85db85d am: 73d5afb2cb am: dbe6d55157 am: 9b2f226473
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404669

Change-Id: I43354358dacaf1b5f39cffab1717cef9774e7d18
2020-09-02 06:16:09 +00:00
Yo Chiang
9b2f226473 Merge "Check error status after installing each DSU partition" am: fbd85db85d am: 73d5afb2cb am: dbe6d55157
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1404669

Change-Id: I06c9dc97b6cf55884718357cdf3b0e03af583ba6
2020-09-02 05:59:24 +00:00