Commit Graph

15622 Commits

Author SHA1 Message Date
Adam Bookatz
6344e2dbe8 Merge "MeasuredEnergyStats supports custom energy buckets" into sc-dev 2021-02-04 08:38:15 +00:00
Galia Peycheva
bf21f495df Merge "Make window blur behind public API" into sc-dev 2021-02-04 08:31:45 +00:00
Adam Bookatz
696dd2af2d MeasuredEnergyStats supports custom energy buckets
MeasuredEnergyStats now supports a variable number of
'buckets', including both the standard buckets (fixed number)
and additional custom buckets (variable number) whose meaning
is unknown to BatteryStats (but is enumerated as an 'ordinal').
This will be used to store per-uid energy data from custom
power components.

Test: atest MeasuredEnergyStatsTest
Test: atest com.android.internal.os.BatteryStatsTests
Bug: 179107328
Bug: 174186358
Change-Id: I0022ac6940daca5f1e7d0e502eed01effa71f796
2021-02-04 02:26:31 +00:00
Benjamin Schwartz
d42057fc61 Merge "BatteryStats: Pull subsystem stats from Power Stats Service" into sc-dev 2021-02-04 01:39:09 +00:00
Adam Bookatz
52534776ec Merge "Measured screen energy into BatteryStatsHelper" into sc-dev 2021-02-04 00:33:10 +00:00
Benjamin Schwartz
3bdc838570 BatteryStats: Pull subsystem stats from Power Stats Service
Also remove redundant PlatformIdle stats section from history details

Bug: 173132005
Bug: 178315485
Test: Ran device to drain battery then checked dumpsys batterystats
Test: Verified that Historian could correctly parse the bugreport
Change-Id: I65c1824695dd026231f83664b00f72912dee2164
2021-02-03 12:49:14 -08:00
Dmitri Plotnikov
df5ebd7eab Merge "Calculate total power for a BatteryConsumer by adding up PowerComponents" into sc-dev 2021-02-03 19:06:15 +00:00
Adam Bookatz
c7f41b68a5 Measured screen energy into BatteryStatsHelper
Use measured screen energy usage (where available)
in battery reporting in BatteryStatsHelper, including
total and per-app screen energy usage.

Regardless of the data source (measured screen power usage vs.
estimating from screen time), the blame on apps is 'smeared',
meaning that it is apportioned (after-the-fact) based on each
app's foreground usage. That does not change here.

Also fixes a mistake in Uid.getScreenOnEnergy().

Future followups to do
1. Make getMeasuredOrEstimatedPower more universal (as more
   PowerCalculators follow suit)
2. Support for BatteryUsageStats
3. Deal with voltage properly
4. Toggle whether to report the measured energy on/off.

Test: atest BatteryStatsHelperTest
Bug: 174818228
Change-Id: I0eaa4bc594cb31b4a26b5488b08114cbf80e3884
Merged-In: I0eaa4bc594cb31b4a26b5488b08114cbf80e3884
(cherry picked from commit 30594e82d5)
2021-02-03 18:46:49 +00:00
Marcin Oczeretko
81ed6656ba Merge "Use PerfettoTrigger to trigger traces from LatencyTracker" into sc-dev 2021-02-03 18:07:04 +00:00
TreeHugger Robot
8dcab0dee6 Merge "Do not propogate test api access flags to Zygote." into sc-dev 2021-02-03 18:01:30 +00:00
Jeff Sharkey
eb4fdbc3b7 Merge "Add core notifications team as owners of internal notification widgets." am: 752040bead am: 6b3ed78bf6 am: b7cd95098f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571164

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0c79eefd95bb24714c79145fdc907cbd6f4672e8
2021-02-03 16:33:36 +00:00
Galia Peycheva
8e30771f55 Make window blur behind public API
This CL makes the blur behind functionality a public API. As part of
this change, we change its previous name (windowBackgroundBlurRadius) to
windowBlurBehindRadius. This avoids a name clash with the Window
background blur, which only blurs the area of the window. Blur behind
blurs everything behind the window (similar behaviour to the dim).

This CL exposes WM.LP.blurBehindRadius and, in addition, undeprecates an
old flag - FLAG_BLUR_BEHIND. FLAG_BLUR_BEHIND enables the blur behind
and blurBehindRadius specifies how dense the blur will be.

In addition, we expose two xml attributes on the Window -
windowBlurBehindEnable and windowBlurBehindRadius. The usage is similar
to the dim api.

Bug: 167166562
Bug: 177524486
Test: m && test app
Change-Id: If2fcde644c5bcca112495ca99ee66bae909877db
Merged-In: If2fcde644c5bcca112495ca99ee66bae909877db
2021-02-03 16:25:49 +00:00
Jeff Sharkey
b7cd95098f Merge "Add core notifications team as owners of internal notification widgets." am: 752040bead am: 6b3ed78bf6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571164

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7133f6b8f758f6a37973691aea5e1ea2386a848b
2021-02-03 15:54:28 +00:00
Jeff Sharkey
6b3ed78bf6 Merge "Add core notifications team as owners of internal notification widgets." am: 752040bead
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571164

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4ced104b3622d406e0eefe64aa311ab5970ccc02
2021-02-03 15:30:13 +00:00
Matt Pietal
0448729358 Merge "Lock Pattern View - Visual update" into sc-dev 2021-02-03 13:08:12 +00:00
Artur Satayev
eb05e6c8fa Do not propogate test api access flags to Zygote.
The flow has been replaced by @ChangeId ALLOW_TEST_API_ACCESS, making
old approach obsolete.

Bug: 147113465
Test: atest CameraEvictionTest#testBasicCamera2ActivityEviction
Merged-In: I0bf109fa78212d6d71ba85d25f80e27e8e7cd900
(cherry picked from commit a27cd30535)
Change-Id: I0e58b6924744590afaadec6a6230aa9d552b2f6f
Exempt-From-Owner-Approval: cp
2021-02-03 12:29:45 +00:00
Galia Peycheva
e6ae6e325a Merge changes from topic "revert-13350963-blur_system_api-AFRJFBKNBA-sc-dev" into sc-dev
* changes:
  Revert "Add permission for blur SystemApi"
  Revert "Make window background blurs SystemApi"
  Revert "Make BackgroundBlurDrawable a SystemApi"
2021-02-03 05:49:41 +00:00
Ahaan Ugale
b7fd9a7814 Merge "VIMS: Clarify NonNullability of PackageMonitor#onPackageModified." into sc-dev 2021-02-03 02:57:18 +00:00
Jeff DeCew
c879d183a8 Add core notifications team as owners of internal notification widgets.
Change-Id: Ie1a8e61f8c250340083940af866552e0d15851dd
2021-02-03 01:07:21 +00:00
Galia Peycheva
3804d61f2a Revert "Make window background blurs SystemApi"
Revert "Add permission check for blurs in SurfaceFlinger"

Revert "Remove public usages of FLAG_BLUR_BEHIND"

Revert "Add pid and uid to SF::setClientStateLocked"

Revert "Add USE_BACKGROUND_BLUR to cts expected permissions"

Revert submission 13350963-blur_system_api

Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case.

Reverted Changes:
I3683db296:Remove public usages of FLAG_BLUR_BEHIND
I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission...
Id21f03793:Add pid and uid to SF::setClientStateLocked
If5d8344a5:Add permission for blur SystemApi
I70d1e1715:Add permission check for blurs in SurfaceFlinger
Icf98c3607:Make window background blurs SystemApi
I0b881ec6e:Make BackgroundBlurDrawable a SystemApi

Bug: 177523043
Test: m
Change-Id: I0f7bcf34db2986d8d5e08b115a611e8e07db5917
Merged-In: I0f7bcf34db2986d8d5e08b115a611e8e07db5917
2021-02-02 23:08:29 +01:00
Galia Peycheva
f83b52cc13 Revert "Make BackgroundBlurDrawable a SystemApi"
Revert "Add permission check for blurs in SurfaceFlinger"

Revert "Remove public usages of FLAG_BLUR_BEHIND"

Revert "Add pid and uid to SF::setClientStateLocked"

Revert "Add USE_BACKGROUND_BLUR to cts expected permissions"

Revert submission 13350963-blur_system_api

Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case.

Reverted Changes:
I3683db296:Remove public usages of FLAG_BLUR_BEHIND
I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission...
Id21f03793:Add pid and uid to SF::setClientStateLocked
If5d8344a5:Add permission for blur SystemApi
I70d1e1715:Add permission check for blurs in SurfaceFlinger
Icf98c3607:Make window background blurs SystemApi
I0b881ec6e:Make BackgroundBlurDrawable a SystemApi

Bug: 177523043
Test: m
Change-Id: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
Merged-In: Iee4b89b06508c7dc3b7266452bb0b987f8670fac
2021-02-02 23:02:05 +01:00
Ben Lin
6292565f13 Merge changes If42d4470,Ia0b701b7 into sc-dev
* changes:
  PiP: Add tap-to-unstash function.
  PiP: Allow stashing via dropping on the edge.
2021-02-02 19:27:55 +00:00
Bill Yi
e02a98aab6 Merge RQ1A.210205.004 to stage-aosp-master - DO NOT MERGE
Merged-In: Ie9567c088e4fff075cce5b6f44bd73199377c91b
Change-Id: I3a2480f2cb8331a70141dad9af61ac3fd7f39991
2021-02-02 09:54:38 -08:00
Matt Pietal
6a40f0c588 Lock Pattern View - Visual update
1. Create a wider path
2. Allow dots to be a different color
3. Draw dots over the path instead of below

Bug: 170729566
Test: manual, visual refresh only
Change-Id: I5c191893132eba89d6e55047d7500efa4aa95a29
2021-02-02 10:57:42 -05:00
Marcin Oczeretko
8d09ec3712 Use PerfettoTrigger to trigger traces from LatencyTracker
Also adds IntDef Action annotation to clarify which methods expect the
ACTION_* arguments.

Test: manual - configure threshold through adb and trigger a trace
Bug: 161781469
Change-Id: I7497901138f71049362927c0491d1ab208df3db3
2021-02-02 15:51:08 +00:00
Wilson Wu
d8343be5ac Merge "Make IInputMethodManager to oneway (11/N)" into sc-dev 2021-02-02 07:35:56 +00:00
Dmitri Plotnikov
afe6fe643d Calculate total power for a BatteryConsumer by adding up PowerComponents
Bug: 158137862
Test: atest BatteryUsageStatsTest
Change-Id: I785799efcc895494be6e338475c6b4f276bdf9d5
2021-02-01 17:44:36 -08:00
Jeff Sharkey
38835a6212 Merge "Add BATTERY_STATS_OWNERS for IBatteryStats.aidl" am: 0db5d441ad am: f486d1dc63 am: db00fbb7b3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1568920

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I799ab3aaaac352805ad2c8dccc3e1f155484494c
2021-02-02 01:28:57 +00:00
Remi NGUYEN VAN
9d060c9e6e Merge "Use consistent Wifi-only checking" into sc-dev 2021-02-02 01:26:16 +00:00
Jeff Sharkey
db00fbb7b3 Merge "Add BATTERY_STATS_OWNERS for IBatteryStats.aidl" am: 0db5d441ad am: f486d1dc63
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1568920

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie4e04f57ef860e64e5b3af541067c5d163abc7f1
2021-02-02 00:44:46 +00:00
Dmitri Plotnikov
1ef5d3f87e Add BATTERY_STATS_OWNERS for IBatteryStats.aidl
Change-Id: Iffb8ded9ff5edc899ab38c74ffe3ad98793ca67c
2021-02-01 23:42:59 +00:00
Chloris Kuo
b3a5d74f93 Merge "Conversation Blocklist" into sc-dev 2021-02-01 22:32:32 +00:00
Ben Lin
6930fd5cbc PiP: Allow stashing via dropping on the edge.
Changes so that:
1) PiP now can be stashed when the user releases/let go of input when
PiP is currently floating on top of the left/right edge of the device.
Currently, 1/3 of the PiP needs to be off-screen in order for stash to
happen.
2) Stashing is now allowed from one edge to the other (e.g. user flings
from left to right, right to left), with VERY high velocity (>=
18000.f).

Bug: 178752503
Test: Let go of PiP when off screen, stashes
Test: fling from left to right with extremely high velocity, stashes
Change-Id: Ia0b701b75f598965d79b07b10f09118f80562f09
2021-02-01 12:41:14 -08:00
Tony Huang
d346ee5315 Merge "Make AppTransition animations sharable (1/n)" into sc-dev 2021-02-01 10:16:33 +00:00
Seigo Nonaka
ff85b932d7 Add FontManager#updateFont API
Bug: 173619554
Test: atest FontManagerTest
Change-Id: I261e55783978d9840b06c586389e2126bc6eb2ca
2021-01-29 14:28:46 -08:00
Chloris Kuo
73bcb5b51f Conversation Blocklist
Add KEY_NOT_CONVERSATION into default allowed adjustments list and add
DeviceConfig to enable it

Bug: 173106605, 178151392
Test: tested on device
Change-Id: I9a34fc3aadadde785bfce2bdf2ff35b0cc0b0ec6
(cherry picked from commit 6fe1741d37)
2021-01-29 17:52:38 +00:00
Ahaan Ugale
8b3b3b9403 VIMS: Clarify NonNullability of PackageMonitor#onPackageModified.
Bug: 178410946
Test: builds
Change-Id: I767e0f7f4ed1ae8c7f0a74afb5114a85a679d86a
2021-01-29 08:41:46 +00:00
TreeHugger Robot
8f15e41d76 Merge "ScreenPowerCalculator is responsible for smearing" into sc-dev 2021-01-28 20:39:30 +00:00
TreeHugger Robot
8f046c76d7 Merge "Revert "Revert "Use eBPF-based time-in-state monitoring for groups of threads""" into sc-dev 2021-01-28 18:20:14 +00:00
TreeHugger Robot
67c5128909 Merge "Correct trace name of LatencyTracker" into sc-dev 2021-01-28 13:24:30 +00:00
Wilson Wu
f226a79fee Make IInputMethodManager to oneway (11/N)
Comply following methods to IVoidResultCallback to emulate
current behavior and apply them to one-way.

-. startProtoDump
-. startImeTrace
-. stopImeTrace

Bug: 163453493
Test: atest CtsInputMethodTestCases
Test: 1) Enable the Winscope Trace tile
      2) Do some actions like open keyboard
      3) Disable the Winscope Trace tile
      4) Grad a bugreport and verify trace on go/Winscope
Change-Id: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
2021-01-28 17:09:39 +08:00
Treehugger Robot
8172883202 Merge "Note network interfaces based on transport" am: 8334a265ad am: cd65235a77
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1562876

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I444343c7230c0f947a666334fb895736fa4bc153
2021-01-28 09:02:21 +00:00
Adam Bookatz
2ad7cd4169 ScreenPowerCalculator is responsible for smearing
The estimated energy used by the screen is
smeared over all apps based on their foreground time.
This calculation is performed by BatteryStatsHelper after
most of its other processing.
In this cl, we move that logic to the ScreenPowerCalculator,
which is actually responsible for calculating the total and
app screen energy blaming. This also allows other power calculators
for screen usage (such as actual screen energy measurements) to
be hooked up in the future, without BSH worrying about whether to
smear.

Note: Smeared energy is not included in the app's total energy usage
until the very end; prior to that, it is recorded in a special field
BatterySipper.screenPowerMah. This is NOT changed in this cl.

NOTE: The actual smearing algorithm is NOT altered in this cl.

Test: atest BatteryStatsHelperTest
Bug: 174818228
Bug: 162379528
Change-Id: I30b436b736e96071a1e4167d37512d250119665c
Merged-In: I30b436b736e96071a1e4167d37512d250119665c
(cherry picked from commit 3754504f4b)
2021-01-28 08:31:13 +00:00
Tony Huang
5fcda4f860 Make AppTransition animations sharable (1/n)
Move some animation functions in AppTransition to new
TransitionAnimation class for wm-shell using.

Bug: 175053726
Test: build
Change-Id: I7eef67359fd4532f7e4d97c787d5288362a32f13
2021-01-28 16:03:56 +08:00
Treehugger Robot
8334a265ad Merge "Note network interfaces based on transport" 2021-01-28 07:45:20 +00:00
Dmitri Plotnikov
8d247edc93 Revert "Revert "Use eBPF-based time-in-state monitoring for groups of threads""
This reverts commit c9e9058347.

This is the original CL, unchanged. The test that was the reason for
the rollback now passes, see http://go/forrest-run/L29200000799760670

The reason for the test failure was that Cuttlefish does not
define any CPU frequencies, which caused https://android.googlesource.com/platform/frameworks/native/+/refs/changes/65/1558465/2/libs/cputimeinstate/cputimeinstate.cpp#578
to fall into a near-infinite loop, thus locking up BatteryStats.

The no-frequencies issue was addressed in https://r.android.com/1558465.

Reason for revert: rolling forward since the test failure has been addressed

Bug: 169279846
Change-Id: I537561b4c86ef2aaf236b1807b844855fef38f8b
(cherry picked from commit 4a7792b30c)
Merged-In: I537561b4c86ef2aaf236b1807b844855fef38f8b
2021-01-28 07:16:16 +00:00
Remi NGUYEN VAN
8ec5d32772 Use consistent Wifi-only checking
Use the same checkWifiOnly method in BatteryUsageStatsProvider and other
battery stats logic.

Bug: 174436414
Test: atest
Change-Id: I6ae21c579a063c3dd65726620b7a6c9e9f09a957
2021-01-28 15:43:34 +09:00
Remi NGUYEN VAN
2c9ed7f32d Note network interfaces based on transport
Instead of classifying interfaces by network type in BatteryStats,
classify them based on the transports array provided by the
NetworkAgent.

Network types are deprecated and transports should be used instead. This
change allows BatteryStats to stop depending on unstable APIs such as
isNetworkTypeMobile.

This change also updates nullability annotations in ConnectivityService
and NetworkAgentInfo to show that the NetworkCapabilities are non-null
(as provided by the network agent) when calling
noteNetworkInterfaceTransports.

Bug: 174436414
Test: atest
  atest ConnectivityServiceTest#testBatteryStatsNetworkType \
      --rerun-until-failure 40

Merged-In: I4e928fac8a57a9b1fc758a44af2a5719b8c871b8

Change-Id: I4e928fac8a57a9b1fc758a44af2a5719b8c871b8
2021-01-28 15:10:54 +09:00
TreeHugger Robot
330454222a Merge "Revert "Revert "Note network interfaces based on transport""" into sc-dev 2021-01-28 05:55:23 +00:00
Wilson Wu
299897e9ba Merge "Make IInputMethodManager to oneway (10/N)" into sc-dev 2021-01-28 01:46:32 +00:00