Commit Graph

8364 Commits

Author SHA1 Message Date
Peiyong Lin
7b446ea75e Merge "Add global settings variables for ANGLE debug." 2020-09-30 02:10:59 +00:00
Peiyong Lin
2d466d0062 Merge "[GraphicsEnvironment] Avoid null access." 2020-09-29 16:02:49 +00:00
Peiyong Lin
c5c17e66ba [GraphicsEnvironment] Avoid null access.
Currently when debug layer apk is not installed, GraphicsEnvironment
logs the message and proceeds, which results in null pointer access
crash when later trying to access primaryAbi. Avoid null access by an
early return statement.

Bug: N/A
Test: specify not installed debug layer apk and no crash
Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
2020-09-28 23:17:37 -07:00
TreeHugger Robot
0f3fbe3e9f Merge "Optimize getting time_in_state for threads of system server" 2020-09-28 22:56:24 +00:00
Dmitri Plotnikov
2237efed88 Optimize getting time_in_state for threads of system server
Prior to this change, we would iterate over _all_ UIDs in
the system, select the one for SystemServer and then iterate over
_all_ threads in _all_ processes running under that UID.
This iteration involves reading many directories in /proc and
many files in those directories.

In the new implementation, we only read time_in_state for the
threads in the system server process itself, identifying them by
the PID.  This optimization reduces the cost 5:1 to 8:1 in terms
of CPU time, number of files read and amount of RAM used.

Bug: 167994570
Bug: 163063901

Test: atest FrameworksCoreTests:com.android.internal.os.SystemServerCpuThreadReaderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: atest FrameworksCoreTests:com.android.internal.os.KernelSingleProcessCpuThreadReaderTest
Change-Id: Iaa2eabc9f39999b2867bbffbac93b282cde74165
2020-09-28 15:32:42 -07:00
Peiyong Lin
318ad33061 Add global settings variables for ANGLE debug.
Introduce angle.egl.features to assist ANGLE debugging. The input
contains lists for each opt-in apps. The format is each list of features
is separated by a comma, each feature in each list is separated by a
colon, e.g.  feature1:feature2:feature3,feature1:feature3:feature5

Bug: b/169156341
Test: use adb shell command to verify
Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: I752047df1c2567b4ebf900c3acb4a965e35dd6c2
2020-09-28 11:45:56 -07:00
Yogisha Dixit
898219f558 Merge "Add a hidden API to check if ambient display is suppressed for a token." 2020-09-28 16:37:28 +00:00
Peiyong Lin
64389beb16 Merge "[GraphicsEnvironment] Minor polish." 2020-09-25 20:06:07 +00:00
Steven Moreland
4be3ece8e5 Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444ba7 am: b1b830369e am: 7ceee368ee am: f5f4344d2f am: 4acdea4cb8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436518

Change-Id: I0cffc23dc0d96cacd7c546b42391af33f54ada80
2020-09-25 19:52:10 +00:00
Steven Moreland
4acdea4cb8 Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444ba7 am: b1b830369e am: 7ceee368ee am: f5f4344d2f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436518

Change-Id: I6a8cebfe4e97f916b9411979b6bb2d5099882557
2020-09-25 19:19:47 +00:00
Yogisha Dixit
784b62a517 Add a hidden API to check if ambient display is suppressed for a token.
Added 1 method:
boolean isAmbientDisplaySuppressedForTokenByApp(String token, int appUid)

Context:
The Settings team is working on adding a string to the AOD settings page when ambient display is suppressed by Bedtime mode: b/168790245.

The current PowerManager#isAmbientDisplaySuppressedForToken(String token) method will only work if the calling app is also the app that suppressed the ambient display. That is, if Digital Wellbeing called suppressAmbientDisplay("winddown"), then isAmbientDisplaySuppressedForToken("winddown") will only return true for Digital Wellbeing. It will return false for Settings app

This CL adds a hidden API PowerManager#isAmbientDisplaySuppressedForTokenByApp(String token, int appUid) that will return true if the given app is suppressing ambient display with the given token. Settings can then call isAmbientDisplaySuppressedForTokenByApp("winddown", digitalWellbeingUid) to get whether ambient display is suppressed by Bedtime mode.

Test: atest FrameworksServicesTests:PowerManagerServiceTest
Bug: 169241595
Change-Id: I41aecc4ff0ab159d67e62193af27362a96c3174c
2020-09-25 20:13:43 +01:00
Steven Moreland
f5f4344d2f Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444ba7 am: b1b830369e am: 7ceee368ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436518

Change-Id: I7755509b329914c491a205f843e731694b02ce84
2020-09-25 19:09:52 +00:00
Steven Moreland
7ceee368ee Merge "ServiceManager: add getDeclaredInstances" am: 9ff2444ba7 am: b1b830369e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436518

Change-Id: I7c8d6058ac7fc4434870d808325823fdc7972c19
2020-09-25 18:52:01 +00:00
Steven Moreland
9ff2444ba7 Merge "ServiceManager: add getDeclaredInstances" 2020-09-25 18:25:55 +00:00
Peiyong Lin
dacef1a9fe [GraphicsEnvironment] Minor polish.
Log more information to assist debugging without having to rebuild the
system image. Adjust ANGLE related properties.

Bug: b/169156341
Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest
Test: atest CtsAngleIntegrationHostTestCases
Change-Id: I30b0056d42d30ccadc72fd642068c3aa66592a5c
2020-09-25 10:38:11 -07:00
Treehugger Robot
ec0846ea9e Merge "Fix unique identifiers best practices links in device ID API docs" am: 8b6aa74d6b am: 1d8a35f66e am: 33035121fd am: 3c6a3316b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1438023

Change-Id: I966b630eb1635094ab12eebe3c34f994579bcbc5
2020-09-25 07:46:39 +00:00
Treehugger Robot
3c6a3316b0 Merge "Fix unique identifiers best practices links in device ID API docs" am: 8b6aa74d6b am: 1d8a35f66e am: 33035121fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1438023

Change-Id: Iab0aeedf19911857e475ddb8efac6a2fffb4dc76
2020-09-25 07:27:18 +00:00
Treehugger Robot
33035121fd Merge "Fix unique identifiers best practices links in device ID API docs" am: 8b6aa74d6b am: 1d8a35f66e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1438023

Change-Id: If225d991796eebcb2fc37bc1451991f92fa3eed0
2020-09-25 07:10:58 +00:00
Treehugger Robot
8b6aa74d6b Merge "Fix unique identifiers best practices links in device ID API docs" 2020-09-25 04:32:42 +00:00
Michael Groover
a73539128d Fix unique identifiers best practices links in device ID API docs
Bug: 168447060
Test: m docs
Change-Id: I483e0cf4915862254461200deb5d3dc7302bafb4
Merged-In: I483e0cf4915862254461200deb5d3dc7302bafb4
2020-09-24 17:36:32 -07:00
Michael Groover
11be5c6214 Merge "Fix unique identifiers best practices links in device ID API docs" 2020-09-24 18:35:36 +00:00
TreeHugger Robot
ce91a73a7d Merge "Create IVibratorManagerService.aidl" 2020-09-24 17:29:39 +00:00
Steven Moreland
d243d23f84 ServiceManager: add getDeclaredInstances
Corresponding to change in IServiceManager API, for finding out what
instances of a VINTF service are installed.

Bug: 168715768
Test: manual
Change-Id: Ic54b0cfd1bd42e45dc66858dbd614db7ba22083f
2020-09-24 00:46:56 +00:00
Suren Baghdasaryan
3c71366c43 Merge "Report ION usage event when ION heap size is 0" am: 7687adc00d am: d493ed705b am: da855f3363 am: 29711d8cba am: 2042c9c32a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431373

Change-Id: I6cd8918f799160020d3f9b0577671dc3632d386e
2020-09-23 20:29:44 +00:00
Suren Baghdasaryan
2042c9c32a Merge "Report ION usage event when ION heap size is 0" am: 7687adc00d am: d493ed705b am: da855f3363 am: 29711d8cba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431373

Change-Id: Ie65b8fbe70a82f4d00d2fb2dc824372329e3acb1
2020-09-23 20:20:06 +00:00
Suren Baghdasaryan
29711d8cba Merge "Report ION usage event when ION heap size is 0" am: 7687adc00d am: d493ed705b am: da855f3363
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431373

Change-Id: I0abb5aebd750732e01a101cce8b9a7f80ebd9d51
2020-09-23 20:03:14 +00:00
Suren Baghdasaryan
da855f3363 Merge "Report ION usage event when ION heap size is 0" am: 7687adc00d am: d493ed705b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1431373

Change-Id: I11cfef78933c1978919b6e85bc0ebf817993d73a
2020-09-23 18:25:44 +00:00
Suren Baghdasaryan
193da6e642 Report ION usage event when ION heap size is 0
In a situation when ION heap size is 0 dumpsys meminfo will not report
ION memory usage. Fix this by differentiating 0-size ION heap or pool
from the cases when /sys/kernel/ion/* do not exist or not readable.

Bug: 168942451
Test: emulate 0-size ION heap and run dumpsys meminfo
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I66624c9e3c73a59462cce8830a36323677db0029
2020-09-23 16:09:08 +00:00
Michael Groover
17b4bbd270 Fix unique identifiers best practices links in device ID API docs
Bug: 168447060
Test: m docs
Change-Id: I483e0cf4915862254461200deb5d3dc7302bafb4
2020-09-21 15:27:52 -07:00
Alex Buynytskyy
b39d13ed7f Installer digests for Incremental installations.
Bug: 160605420
Test: atest ChecksumsTest
Change-Id: I9d46c218cccf87781e9b33711c4d02d94bf824f5
2020-09-21 12:40:56 -07:00
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