Commit Graph

15812 Commits

Author SHA1 Message Date
James O'Leary
bbfe962fff Fix crash when number of pixels < max colors
If extraction is run on a set of pixels whose count is less than the
number of max colors, then colors.length < max colors, and accesses
to colors[index] inside the for loop throw an ArrayOutOfBoundsException.

Test: add widget to home screen, reduce size of widget to small area.
observe crash. `mp core services` with fix, observe that crash no longer
occurs. `mp core services` again without fix, verify crash occurs after
boot.
Fixes: 181130209

Change-Id: I60bf1ab39f7a69f2fb0745049fd46d2f0b53a12c
2021-03-03 10:46:16 -05:00
Jeff DeCew
6cd5cb738d Merge changes I57fb542a,If2a13daf into sc-dev
* changes:
  Fix the vertical positioning of the text in collapsed notifications.
  Increase the notification height to 88dp
2021-02-27 03:08:17 +00:00
Shuo Qian
8b8f2625db Merge changes from topic "cp-rvc-aosp" into sc-dev
* changes:
  [automerged blank] Add Emergency callback mode shell command 2p: b201f9b1e6
  Add Emergency callback mode shell command
2021-02-26 22:56:18 +00:00
Jeff DeCew
19864ec962 Fix the vertical positioning of the text in collapsed notifications.
Test: manual / visual
Bug: 181048615
Change-Id: I57fb542a776b254a6537dbed608259e69def411f
2021-02-26 14:19:00 -05:00
Hans Boehm
1d550ecd10 Merge "Add zygote native fork loop" am: 43a9a8089f am: dd81ed70c7 am: 925ecc3f80
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3afb617aab80b073b56fa0c61398ae6d42800a75
2021-02-26 17:20:42 +00:00
Todd Kennedy
5f9160b6cf Merge "Add self to owners for SystemConfig.java" am: 4b6dcc5192 am: 0e7a0c7ba9 am: 9a03d6f19e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606874

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I43f7e957d5c50d1762dbc2473eb0380b1ac168e3
2021-02-26 17:20:16 +00:00
Adam Bookatz
47fe2c6ade Merge "TEST_MAPPING for BatteryStats" into sc-dev 2021-02-26 17:11:40 +00:00
Galia Peycheva
656d774184 Merge "Fix synchronisation in BackgroundBlurDrawable" into sc-dev 2021-02-26 14:30:04 +00:00
Jeff Sharkey
869d848e45 Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2 am: 4df29fd76a am: 2b3fee42d8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icb05293712e0b6127bda0e8e297e447956ee5aa1
2021-02-26 13:08:55 +00:00
Mark Renouf
20bd3d4935 Merge "Long screenshots framework update and API unhide" into sc-dev 2021-02-26 13:06:47 +00:00
Dmitri Plotnikov
02073550c0 Merge "Add UID time-in-state to UidBatteryConsumer" into sc-dev 2021-02-26 04:51:40 +00:00
Dmitri Plotnikov
f441fbf774 Add UID time-in-state to UidBatteryConsumer
Bug: 158137862
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsTest
Change-Id: I8fde2f754deaa0d2c4ebb06b9a2c99d60086bc23
2021-02-25 15:47:20 -08:00
Mark Renouf
8f1b73e183 Long screenshots framework update and API unhide
This change includes a series of API review changes. The most
significant update is the addition of cancellation signals to
API methods where needed.

Renames some internal classes and interfaces to support the
API changes and to simplify tests and improve quality.

Test: numerous presubmits
Bug: 175830670
CTS-Coverage-Bug: 180419562
Change-Id: I9b1b950a2779fc902ecf4d6394e3c35171926700
2021-02-25 23:02:17 +00:00
Adam Bookatz
b62859528e TEST_MAPPING for BatteryStats
Creates presubmit test mapping for BatteryStats-related
files.

These tests can be run manually via
atest FrameworksServicesTests:com.android.server.am.BatteryExternalStatsWorkerTest FrameworksServicesTests:com.android.server.am.MeasuredEnergySnapshotTest FrameworksServicesTests:com.android.server.am.BatteryStatsServiceTest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests

Tests that currently fail are marked to be skipped;
they should be addressed by b/180015146.
This is accomplished by introducing a new annotation, @SkipPresubmit.

Test: treehugger presubmit
Bug: 180016384
Change-Id: If01beaa342468aeded660e5766a14391d3ee9bcc
2021-02-25 14:51:01 -08:00
Adam Bookatz
84fc40ad81 Merge "MeasuredEnergyStats - remove unused accumulate parameter" into sc-dev 2021-02-25 21:55:02 +00:00
TreeHugger Robot
2863f6a40d Merge "Convert WifiPowerCalculator to work with BatteryUsageStats" into sc-dev 2021-02-25 20:15:38 +00:00
Adam Bookatz
26b0a0864c MeasuredEnergyStats - remove unused accumulate parameter
The parameter was always true (it was a remnant of a previous
approach).

Test: atest FrameworksCoreTests:com.android.internal.power.MeasuredEnergyStatsTest
Bug: 174818228
Change-Id: I3be5392966c3455b2df145044809a581abbf245c
2021-02-25 11:02:17 -08:00
Evan Severson
445abca30e Merge "Expose SensorPrivacy as SystemApi" into sc-dev 2021-02-25 18:29:43 +00:00
Galia Peycheva
d129f1e00e Fix synchronisation in BackgroundBlurDrawable
The PositionUpdateListener in BackgroundBlurDrawable is called from
a thread pool to update the position of the BlurRegion. After that,
in frame drawing callback (RenderThread), the Aggregator takes all
the settings in BackgroundBlurDrawable and dispatches them to SF.
However, while the RenderThread is working on frame N, the Ui thread
is working on frame N+1. So when the frame drawing callback is
called on RenderThread for frame N, BackgroundBlurDrawable
might already be holding settings for frame N+1.

In this CL, we fix that by making BackgroundBlurDrawable work only on Ui
thread, while BlurRegion lives only on RenderThread. Just before
drawing, we copy the state of BackgroundBlurDrawable into a BlurRegion.
So when render thread starts doing its thing for frame N, Ui thread can
start setting up BackgroundBlurDrawable for frame N+1. The settings for
frame N are already copied over to BlurRegion. In frame drawing
callback, we take the blur regions if there is a pending update and send
them to SF.

Bug: 167166562
Test: m && atest BlurAggregatorTest
Change-Id: Icec0fa8e97de30b7bad15b97f848ae642076652f
2021-02-25 18:33:33 +01:00
Zoey Chen
da74086ba4 Merge "[Telephony] Store correct value for multi-sim case - DataEnabled" into sc-dev 2021-02-25 13:31:04 +00:00
Alex Buynytskyy
414d9ecc26 API feedback: getVersion instead of isV2.
Bug: 181015045
Fixes: 181015045
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I623f73b834759d9a1c599d7c7f3ff585fa75c4aa
2021-02-25 02:06:08 +00:00
Hans Boehm
925ecc3f80 Merge "Add zygote native fork loop" am: 43a9a8089f am: dd81ed70c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11e1abaa50306262ec5b2a19d95b481ef64987cc
2021-02-25 01:14:50 +00:00
Todd Kennedy
9a03d6f19e Merge "Add self to owners for SystemConfig.java" am: 4b6dcc5192 am: 0e7a0c7ba9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606874

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2816514891cb5f4407e5dee6796aafc440102d69
2021-02-25 01:14:31 +00:00
Hans Boehm
dd81ed70c7 Merge "Add zygote native fork loop" am: 43a9a8089f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I92e404bd6ce19df88d832127f738ec8c6305fe74
2021-02-25 00:30:09 +00:00
Todd Kennedy
0e7a0c7ba9 Merge "Add self to owners for SystemConfig.java" am: 4b6dcc5192
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606874

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If163aef039b83e8337b21b435d7cd801b848ce2a
2021-02-25 00:27:28 +00:00
Adam Bookatz
0b905b1ef4 Merge "BatteryStats custom buckets: don't revive dead Uids" into sc-dev 2021-02-25 00:26:14 +00:00
Hans Boehm
43a9a8089f Merge "Add zygote native fork loop" 2021-02-25 00:02:19 +00:00
Todd Kennedy
be58aa730b Add self to owners for SystemConfig.java
Change-Id: I812841473d390166ccfca6492ff40d3a324b5599
2021-02-24 23:43:22 +00:00
Evan Severson
0f9d5aea50 Expose SensorPrivacy as SystemApi
Rename the apis to be more consistent.
Also expose to test api.
Have the aosp mark that it supports the toggle features by default.

Test: atest CtsSensorPrivacyTestCases
Bug: 162549680

Change-Id: Ib38c16adfc5cec931347e1a1891618983d78248b
2021-02-24 15:39:19 -08:00
Flavio Fiszman
491cbd85c8 Merge "Simplify onNotificationClear signature" into sc-dev 2021-02-24 22:32:17 +00:00
James O'Leary
7edf52d602 Merge "Revert^2 "[framework] Integrate new quantizers"" into sc-dev 2021-02-24 21:59:47 +00:00
Jeff Sharkey
2b3fee42d8 Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2 am: 4df29fd76a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iab3982e777395a9579505ad90b143c3b6c04b6f3
2021-02-24 21:52:33 +00:00
Adam Bookatz
5bb1ec89d3 BatteryStats custom buckets: don't revive dead Uids
It is possible for old uids to be reported to BatteryStats
in updateCustomMeasuredEnergyDataLocked().
This can happen, e.g., if a uid was uninstalled between
successive custom energy updates, so that the uid did use non-zero
energy but BatteryStats doesn't care anymore since the uid is gone.
If this happens,
we don't want to recreate any removed Uid objects, so we need
to be careful to only consider Uids that aren't removed.

In practice, this method will only be called after the CPU update,
which means that BatteryStats should already know about all active
uids (assuming they used CPU). Therefore, there shouldn't be any
unknown uids actively using custom energy buckets at this point.
We therefore simply ignore any unknown uids (just log them), on
the assumption that they refer to removed uids or stopped users.

Test: atest BatteryStatsTests
Bug: 180030409
Change-Id: If4fee7a1d11b148ca16d464d6ce4720c5a251130
2021-02-24 21:30:59 +00:00
Jeff Sharkey
4df29fd76a Merge "Add OWNERS for long screenshots framework code" am: 79bed70aa2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600453

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I916187da222fa9e100d9beb67866427b10481900
2021-02-24 20:59:35 +00:00
Jeff Sharkey
79bed70aa2 Merge "Add OWNERS for long screenshots framework code" 2021-02-24 19:42:32 +00:00
James O'Leary
9d3ad10eb9 Revert^2 "[framework] Integrate new quantizers"
96169052c4

Change-Id: Idefcf279b9fedeeaa29f75e705adfb60f0ad5c8a
2021-02-24 17:09:06 +00:00
Flavio Fiszman
462f2579d5 Simplify onNotificationClear signature
Change-Id: Ib944418dea78fb090c70206c34519f9248a02c04
Test: NotifCollectionTest and NotificationManagerServiceTest
Bug: 172575678
2021-02-24 13:31:45 +00:00
Zoey Chen
4d459c28db [Telephony] Store correct value for multi-sim case - DataEnabled
Bug: 180438087
Text: manual and make
Change-Id: I4bcb66d125be582f3392f4c5af1471849a0fe9b1
2021-02-24 18:22:36 +08:00
Treehugger Robot
1c12237ee3 Merge "Revert "Do not propogate test api access flags to Zygote."" am: 6faddabeb7 am: 1856a9efdd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1598954

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I35de41959fed409a49d101ea9ef3da5c4ced84b6
2021-02-24 04:07:23 +00:00
Treehugger Robot
1856a9efdd Merge "Revert "Do not propogate test api access flags to Zygote."" am: 6faddabeb7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1598954

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icd5c0eea7f0e595dc3f65ccfb20e7f6797280c0d
2021-02-24 03:00:41 +00:00
Wu Ahan
f6ed5fc57c Merge "Send broadcast to notify the events of a CUJ session" into sc-dev 2021-02-24 02:48:48 +00:00
Treehugger Robot
6faddabeb7 Merge "Revert "Do not propogate test api access flags to Zygote."" 2021-02-24 02:20:37 +00:00
Treehugger Robot
155808b3e2 Merge "Defer UID data removal until after reading is finished" am: ce2d40870e am: 7fddb382f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554529

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie0a26de931a690d5248d4449fa048a2abf2e7d71
2021-02-24 02:07:31 +00:00
Treehugger Robot
7fddb382f7 Merge "Defer UID data removal until after reading is finished" am: ce2d40870e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554529

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I96787bdcf17949de0df847c92ffe49b790225e74
2021-02-24 01:49:38 +00:00
Lucas Dupin
e36c4de103 Merge "Revert "[framework] Integrate new quantizers"" into sc-dev 2021-02-24 01:00:49 +00:00
James O'Leary
96169052c4 Revert "[framework] Integrate new quantizers"
Revert "[sysuig] Integrate Monet color extraction to theme algorithm"

Revert submission 13554372-kahuna

Reason for revert: Colors on some wallpapers shifted, and Lucas found a couple big reasons why, would rather revert a revert tomorrow than fix forward today
Reverted Changes:
I2c3df9f71:[sysuig] Integrate Monet color extraction to theme...
I0fc60a134:[framework] Integrate new quantizers

Change-Id: I7eb8e4fde243bf62e8c750f88028db0a427560b5
2021-02-24 00:33:02 +00:00
Treehugger Robot
ce2d40870e Merge "Defer UID data removal until after reading is finished" 2021-02-23 23:08:31 +00:00
Hans Boehm
69d44b0bfd Add zygote native fork loop
Do not return to Java mode between consecutive fork operations.
This greatly reduces the Zygote overhead, since we no longer need to
stop and restart Java daemons.

By not switching back to Java mode, and being careful about what memory
we touch between forks, we also keep the Zygote heaps much more stable,
facilitating page sharing between the zygote and all its children.
Under normal operation we should no longer allocate any memory in the
zygote between forks. That applies to both the Java and C++ heap.
This makes the zygote behave much more like the mental model many
of us had assumed: It has nearly constant memory contents, which are
copy-on-right cloned at each fork. This does not apply to the initial
system server and webzygote forks, that are currently still handled
differently.

This includes

1. Add ZygoteCommandBuffer, and switch the argument parsing code to use it.
This slightly reduces allocation and enables (3).

2. Support process specialization in the child, even when the arguments
are already know, Leverages existing Usap code.

3. Add support for forking multiple child processes directly to the
ZygoteCommandBuffer data structure. This directly uses the buffer
internals, and avoids returning to Java so long as it can handle the
zygote commands it sees.

FUNCTIONALITY CHANGE:

We now limit the total size of the zygote command, rather than the
number of arguments.

Initial performance observations:

[ These are not perfect, since I'm comparing to numbers before I
started. There may have been other moving parts, but they should be
minor. ]

System-server-observed launch latency:

[Not the best metric, but easy to measure. In particular, this
does not represent a significant reduction in application launch
time.]

Based on measuring the last 10 launches in a lightly used cf AOSP
instance, the system server latency from requesting an app launch to
response with the pid (which does not require the child to execute
anything) went from an average of about 10.7(25) msecs to 6.8(9) and
7.9(16) in two tries with the CL. (The parenthetical numbers are
maxima from among the 10; the variance appears to have decreased
appreciably.)

Dirty pages:

The number of private dirty pages in the zygote itself appears to have
decreased from about 4000 to about 2200. The number of dalvik-main
private dirty pages went from about 1500 to nearly zero.

Initially ART benchmarking service claim -1.88% in PSS. But this is not
consistently repeatable.

Drive-by fix:

Call setAllowNetworkingForProcess on usap / native loop path.

Bug: 159631815
Bug: 174211442
Test: Boots AOSP
Change-Id: I90d2e381bada1b6c9857666d5e87372b6a4c1a70
2021-02-23 15:03:40 -08:00
TreeHugger Robot
9132e2def2 Merge "Revert "Do not propogate test api access flags to Zygote."" into sc-dev 2021-02-23 21:12:41 +00:00
James O'Leary
c7d315947d Merge "[framework] Integrate new quantizers" into sc-dev 2021-02-23 20:20:39 +00:00