Commit Graph

16570 Commits

Author SHA1 Message Date
Issei Suzuki
d2f718cbf3 Stop output WM_DEBUG_WALLPAPER logs to logcat
Bug: 202392340
Test: manual
Change-Id: I0e1c06182f57a195896142f6bcdaafeb7001fb74
2021-11-17 14:22:05 +01:00
Wu Ahan
eec2d1237d Add null check before notifying CUJ events
There is a potential NPE since we didn't have null check before sending
broadcast, so add null cehck.

Bug: 205211901
Test: Manually
Change-Id: Icc60d2c87941373943ec627f669598dca684c09d
2021-11-12 09:06:44 +00:00
Wu Ahan
43f59bb11b Merge "Instrument jank of splash screen AVD and exit animation" into sc-v2-dev 2021-11-03 02:44:08 +00:00
Ahan Wu
aac160b107 Remove deadlock path between InteractionJankMonitor and FrameTracker
A deadlock path is found:
- FrameTracker$1.lambda$surfaceDestroyed (held A)
- InteractionJankMonitor.end (held B) -> FrameTracker.end (wait for A)
- FrameTracker.end -> InteractionJankMonitor.handleCujEvents (wait for B)
This cl resolves this by using a single lock among monitor and tracker.

Bug: 197804653
Test: atest InteractionJankMonitorTest --rerun-until-failure 100
Test: atest FrameTrackerTest --rerun-until-failure 100
Change-Id: Ia6aa196370bdb51b8a5c84c74a3d174a3d4b689f
2021-11-02 12:23:06 +00:00
Shawn Lin
59f51a9538 Merge "Add APIs to get system bar heights" into sc-v2-dev 2021-10-25 04:07:12 +00:00
Wu Ahan
61cd0b63c4 Instrument jank of splash screen AVD and exit animation
Add jank instrument support for splash screen avd and exit animation.

Bug: 195736656
Test: see trace in comment
Change-Id: I1fdb9e14145bcf519eea99e440de74238e3c765c
2021-10-25 03:56:42 +00:00
TreeHugger Robot
0b4f292d62 Merge "Hide SoftInput when INVALID_DISPLAY" into sc-v2-dev 2021-10-21 09:10:48 +00:00
TreeHugger Robot
8baec90550 Merge changes I504d9c65,I45abcf87 into sc-v2-dev
* changes:
  Utilize measured energy for multidisplay power attribution
  Update Screen and AmbientDisplay Power Calculators for multi-display
2021-10-19 22:20:47 +00:00
Issei Suzuki
e7831937e7 Merge "Keep FLAG_SHOW_WALLPAPER flag on NotificationShade." into sc-v2-dev 2021-10-19 09:53:57 +00:00
Wilson Wu
b9e5fc383d Hide SoftInput when INVALID_DISPLAY
We only prevent to show soft input in
IMMS#startInputUncheckedLocked when
DISPLAY_IME_POLICY_HIDE is set.

If a display with DISPLAY_IME_POLICY_HIDE,
we should hide the soft input anyway.

Bug: 199991634
Test: atest CtsInputMethodTestCases
Test: Verify as following steps:
1) adb shell wm size 800x1280
2) adb shell wm density 213
3) atest MultiDisplaySystemDecorationTests#\
   testDisplayPolicyImeHideImeNoSystemDecorations

Merged-In: I3ab03667c28ec5beb6c3332aceaae4a63cd7309a
Change-Id: I3ab03667c28ec5beb6c3332aceaae4a63cd7309a
(cherry picked from commit d41ac0605c)
2021-10-19 08:05:42 +00:00
Shawn Lin
16496cb5c1 Add APIs to get system bar heights
In multi-display devices, there might be differnt cutout on each display
which also causes different status bar height.

Now we no longer overlay the status_bar_height dimen and keep it as
default value and add APIs to calculate the status bar size.

- Add APIs for getting status_bar_height & quick_qs_offset_height in
  system.
- Add APIs for getting split_shade_header_height and
  qs_header_system_icons_area_height in SystemUI.
- Remove all resource overlay for status_bar_height &
  quick_qs_offset_height.

Bug: 186604541
Test: atest SmallClockPositionTest DisplayLayoutTest
      HideDisplayCutoutOrganizerTest SizeCompatTests
      NotificationPanelViewControllerTest
Change-Id: I5a6dfcc6ff06da8ea0fe119fc9d4c089f13b0dff
2021-10-19 14:51:20 +08:00
TreeHugger Robot
e5d0befd2c Merge "Track latency of user switch journey" into sc-v2-dev 2021-10-18 21:45:15 +00:00
Issei Suzuki
4731aa5e1c Keep FLAG_SHOW_WALLPAPER flag on NotificationShade.
Before this change, we controlled wallpaper visibility on the Lockscreen
by combination of visibility of NotificationShade window and
setting/resetting FLAG_SHOW_WALLPAPER flag on its window. When the flag
was removed while NotificationShade was still visible (e.g. OCCLUDE
transition starts on the Lockscreen), the wallpaper became immediately
invisible and caused a flicker.

With this change, we keep the FLAG_SHOW_WALLPAPER on NotificationShade,
and only rely on its visibility weather the wallpaper should be visible
or not on the Lockscreen.

Bug: 191438572
Test: existing tests + manual
  open GPay app from the lockscreen
  open emergency dialer and check the key pad reacts
Change-Id: I7876c92331125b00931218d9e5aca164a1ea50d9
Merged-In: I7876c92331125b00931218d9e5aca164a1ea50d9
2021-10-18 17:29:53 +02:00
Michael Wachenschwanz
684c0b4a77 Merge "Update BatteryStatsImpl to handle multidisplay" into sc-v2-dev 2021-10-15 21:43:12 +00:00
TreeHugger Robot
ae46cf3869 Merge "Revert "Keep FLAG_SHOW_WALLPAPER flag on NotificationShade."" into sc-v2-dev 2021-10-15 13:15:24 +00:00
Daniel Chapin
33bc582317 Revert "Keep FLAG_SHOW_WALLPAPER flag on NotificationShade."
This reverts commit 7f1a5a79d1.

Reason for revert: Droidfood blocking bugs bug: 203025772 & bug: 203041994

Bug: 203041994
Bug: 203030884
Bug: 203025772
Change-Id: Iecb089045525e24b5e5ece312016eb20400da575
Merged-In: I768c13d2959fb92d2a5d038df560e1575aea0712
2021-10-15 10:37:57 +00:00
Michael Wachenschwanz
3214255bab Utilize measured energy for multidisplay power attribution
Fixes: 194107383
Test: atest FrameworksCoreTests:BatteryStatsTests
Change-Id: I504d9c655382c2c6eb664e76ead88bce12da1ae4
2021-10-14 17:16:03 -07:00
Michael Wachenschwanz
e280aaca38 Update Screen and AmbientDisplay Power Calculators for multi-display
Bug: 200239964
Test: atest ScreenPowerCalculatorTest
Test: atest AmbientDisplayPowerCalculatorTest
Change-Id: I45abcf872de7239040f84b26bd9aa2af07cfaa7c
2021-10-14 17:16:03 -07:00
Michael Wachenschwanz
e031d50952 Update BatteryStatsImpl to handle multidisplay
Add screen on and doze timers for multiple displays.

For Battery history, charge/discharge logs and UnsupportedAppUsage, the
legacy screen state timers remain, as well. The legacy timers and
screen state tracking will now track overall screen state of the device.
The current overall screen state is the most "important" state currently
active.
Order of screen state importance is: on, doze, doze suspend, off.

Note: Utilizing per display measured energy will be handled in a follow
up CL.

Bug: 194107383
Test: atest FrameworksCoreTests:BatteryStatsTests
Change-Id: I4ad4f54b6897f406e4ec0f59834dd4762083e0d8
Merged-In: I4ad4f54b6897f406e4ec0f59834dd4762083e0d8
2021-10-14 17:15:57 -07:00
Lucas Dupin
54adb0f8a5 Track latency of user switch journey
Bug: 200160966
Test: atest UserSwitcherControllerTest
Test: atest KeyguardUpdateMonitorTest
Change-Id: Ic4fc85bd2e30029518cfe97d9839e08a687a1692
2021-10-14 11:02:09 -07:00
Issei Suzuki
837add11c3 Merge "Keep FLAG_SHOW_WALLPAPER flag on NotificationShade." into sc-v2-dev 2021-10-13 08:31:35 +00:00
Issei Suzuki
cd9c90750a Merge "Migrate WALLPAPER_LIGHT debug message to ProtoLog." into sc-v2-dev 2021-10-12 15:09:42 +00:00
Issei Suzuki
7f1a5a79d1 Keep FLAG_SHOW_WALLPAPER flag on NotificationShade.
Before this change, we controlled wallpaper visibility on the Lockscreen
by combination of visibility of NotificationShade window and
setting/resetting FLAG_SHOW_WALLPAPER flag on its window. When the flag
was removed while NotificationShade was still visible (e.g. OCCLUDE
transition starts on the Lockscreen), the wallpaper became immediately
invisible and caused a flicker.

With this change, we keep the FLAG_SHOW_WALLPAPER on NotificationShade,
and only rely on its visibility weather the wallpaper should be visible
or not on the Lockscreen.

Bug: 191438572
Test: existing tests + manual (open GPay app from the lockscreen)
Change-Id: Id13ffbbd2c965e0dcc97effd3faf46fd7a8bb1a5
Merged-In: Id13ffbbd2c965e0dcc97effd3faf46fd7a8bb1a5
2021-10-12 09:51:26 +02:00
Issei Suzuki
bde317e6b1 Migrate WALLPAPER_LIGHT debug message to ProtoLog.
Test: manual
Bug: 191438572
Bug: 202392340
Change-Id: Ibf538fce834715dc32741f4b52808f99020f741e
2021-10-12 09:38:58 +02:00
Michael Wachenschwanz
8ac63071a4 Update PowerProfile to support multidisplay devices
Replaced the display related power constants with new ones that support
multidisply.

The legacy constants are marked as UnsupportedAppUsage, so they have not
been removed yet and they attempting to read them will return the power
constant values for the first display.

Fixes: 200226329
Test: atest com.android.internal.os.PowerProfileTest#testPowerProfile
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Id181443bd6f553ee37fc4a1647d31644fcad7912
2021-10-05 11:13:01 -07:00
TreeHugger Robot
89f022ac99 Merge "Add multi-user jank monitoring" into sc-v2-dev 2021-09-29 22:31:47 +00:00
Lucas Dupin
71d3f5bb9e Add multi-user jank monitoring
Created CUJ for monitoring jank when switching users, including guest
users, but excluding the "Add User" user journey.

Bug: 200160966
Test: switch users manually, look at logs
Test: atest KeyguardUpdateMonitorTest
Test: atest UserSwitcherControllerTest
Change-Id: I5570133a1f96a58d39a8f053f9f480cdaada8df1
2021-09-29 10:26:26 -07:00
TreeHugger Robot
7f541b72f7 Merge "Zero out WiFi duration and power if ControllerActivityCounter is null" into sc-qpr1-dev am: c410f29893
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15934611

Change-Id: I94e7ba1c4e69ed2140ca49f4542c08e0bbd72573
2021-09-29 00:43:17 +00:00
Dmitri Plotnikov
fb10be47c9 Zero out WiFi duration and power if ControllerActivityCounter is null
Bug: 200346841
Test: atest FrameworksCoreTests:WifiPowerCalculatorTest
Change-Id: I087e3b60c277c1d1a63b6c06e60ffcbe95224668
(cherry picked from commit 199f93ac3b)
2021-09-28 17:20:34 +00:00
lpeter
918ea9940f [NGA v2] Reliable Visible Activity Lookup
To enable more voice-oriented in-app user journeys, Google Assistant
needs to access more information regarding the visible activities
via the Voice Interaction Session. Thus, we provide the APIs to receive
the changed visible activities in Voice Interaction Session.

Bug: 178244510
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Change-Id: I019d09fee8105ae1eadbc76803f46fd8b1948f6b
2021-09-28 17:06:49 +08:00
Varun Shah
991929b9fb Merge "Dismiss the suspend dialog if conditions have been modified." into sc-qpr1-dev am: 912d89451a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15853562

Change-Id: Id9539465fac375a4c2953aff19d6b3e5a880375a
2021-09-27 16:10:57 +00:00
TreeHugger Robot
a401999f85 Merge "Check custom component names before aggregating BatteryUsageStats snapshots" into sc-qpr1-dev am: 0ef5152b17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15872124

Change-Id: I453c8cda7d7d6ab29facc35acd1d6ab84f6ee5fa
2021-09-25 02:17:20 +00:00
Dmitri Plotnikov
5375fe32cb Drop per-app measured energy when an OTA changes the set of energy components am: 50348e3120
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15857253

Change-Id: Ib7813a74c1c4c12d1827d8a07f6caaa8dd4de65b
2021-09-25 02:11:05 +00:00
Varun Shah
912d89451a Merge "Dismiss the suspend dialog if conditions have been modified." into sc-qpr1-dev 2021-09-24 17:54:45 +00:00
Dmitri Plotnikov
0c561475c3 Check custom component names before aggregating BatteryUsageStats snapshots
If the lists of custom power components do not match, a crash will occur.
Instead of causing a crash, simply skip incompatible snapshots.

Bug: 196040329
Bug: 200511361
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest

Change-Id: I87ba605371a5f3119dcff33f6109e94ee46ab57d
(cherry picked from commit a1ea9ecd56)
2021-09-20 18:35:09 +00:00
Dmitri Plotnikov
50348e3120 Drop per-app measured energy when an OTA changes the set of energy components
Bug: 200123115
Test: atest BatteryStatsTests
Change-Id: I750a5c9fa3faa9757625b2d2494df1484b68016d
(cherry picked from commit 9cb960304e)
2021-09-17 23:10:56 +00:00
Varun Shah
777d87f91b Dismiss the suspend dialog if conditions have been modified.
Whenever suspension conditions change, if there is a user-visible
suspension-related dialog, dismiss it to ensure the user is never
looking at stale information.

Bug: 169137795
Test: atest SuspendPackagesBroadcastTest#sendPackagesSuspendModifiedForUser
Test: manual (steps below)
-enable EBS, tap on suspended app to see dialog
-enable Focus mode, ensure dialog is dismissed
-tap on suspended app again to see relevent dialog,
 disable Focus mode, ensure dialog is dismissed
-tap on suspended app again to see relevant dialog,
 disable EBS, ensure dialog is dismissed correctly
-can permute enable/disable steps to further verify

Change-Id: Ib1650f910f7441498424ab4bc92185ce432ac405
(cherry picked from commit 25e73a8b9e)
2021-09-17 22:35:26 +00:00
Bernardo Rufino
00d9e5301e Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev am: d9ba2df119
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15836011

Change-Id: I92fe8e94c677f79951994d03c6cae6071f31592c
2021-09-17 15:29:36 +00:00
Bernardo Rufino
d9ba2df119 Merge "Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler" into sc-qpr1-dev 2021-09-17 15:15:48 +00:00
Miranda Kephart
082e54a5ba Merge "Fix direct share badges when sharing on work/personal profiles" into sc-qpr1-dev am: b51d58e6fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15839049

Change-Id: I1ac8b7840f29eaa7353b4c744452d428271d6e12
2021-09-16 14:03:53 +00:00
Miranda Kephart
63fe7d7343 Fix direct share badges when sharing on work/personal profiles
Use the passed-in user instead of the current user to determine
whether or not to add the work profile badge to direct share
target app icons, so that personal share targets do not have the
badge (even when sharing something from the work profile) and
work/managed share targets do have it (even when sharing something
from the personal profile).

Test: manual; tested appearance sharing from personal->work and
from work->personal
Bug: 197388251
Fix: 197388251

Change-Id: Ieee50d46e8058a92efa5be8aae9859447531c270
2021-09-15 15:20:14 -04:00
Bernardo Rufino
1538b7fda7 Remove sendCloseSystemDialogs() from PhoneFallbackEventHandler
Today's flow of events is like this: key goes to focused app
(ViewRootImpl::processKeyEvent), the view hierarchy does not handle the
event, so ViewRootImpl uses FallbackEventHandler to invoke the fallback
action for this key.

The problem is that for many keys the app itself is closing system
dialogs before taking the appropriate action (often launching an
activity, eg. dialer for KEYCODE_CALL), but this is now prohibited in S
due to abuse of said action.

The long-term plan is to return to InputDispatcher the fact that the key
wasn't handled by the app and have ID call out to the policy, which will
launch the appropriate action and adjust the UI as it sees fit (close
system dialogs).

However, we need to prevent apps from crashing because of this, hence
this change for S still. The unfortunate effect is that system dialogs
won't be hidden in these cases, but this livable with until we properly
implement the infrastructure.

Bug: 199173862
Test: Simulate code-paths with affected keys and make sure apps don't
      crash:
      1. adb shell input keyevent --longpress KEYCODE_CALL
      2. adb shell input keyevent --longpress KEYCODE_CAMERA
Change-Id: I44ad41ac1eac9acc8320298ceb4c1b21bde8af5d
2021-09-15 15:25:47 +01:00
Wu Ahan
d0b1d557e9 Merge "Add latency instrument point for ACTION_TURN_ON_SCREEN" into sc-v2-dev 2021-09-15 02:33:51 +00:00
Gaurav Bhola
9260cf2831 Merge "Move the NotificationAccessConfirmationActivity component name to resource config so that it can be overlayed." into sc-v2-dev 2021-09-14 19:25:04 +00:00
PETER LIANG
d596ae37f4 Merge "Fix the title of the HW "Edit shortcuts" menu is truncated when the device is folded." into sc-v2-dev 2021-09-14 03:58:38 +00:00
Ahan Wu
767bae370b Add latency instrument point for ACTION_TURN_ON_SCREEN
We missed LatencyTracker.ACTION_TURN_ON_SCREEN, add proper instrument
point.

Bug: 188626939
Test: atest
Change-Id: If366a8bcbda41087dd1255110f4f60a8970cca15
2021-09-13 11:57:46 -08:00
Pavel Grafov
d730a09568 Merge "Respect PASSWORD_QUALITY_MANAGED for biometrics" into sc-qpr1-dev am: a238881ee0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15778512

Change-Id: I44b1e9fa8d418ef84c1ab324306a00e47e5b4e9a
2021-09-13 14:08:56 +00:00
Pavel Grafov
a238881ee0 Merge "Respect PASSWORD_QUALITY_MANAGED for biometrics" into sc-qpr1-dev 2021-09-13 13:52:26 +00:00
Michael Wachenschwanz
04dcc9e512 Merge "Ref count isolated uid usage in BatteryStats" into sc-qpr1-dev am: b85b750561
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15756344

Change-Id: I6998822dfe23a513d5c52a0c931bb906eb6d59b2
2021-09-09 23:54:51 +00:00
Michael Wachenschwanz
b85b750561 Merge "Ref count isolated uid usage in BatteryStats" into sc-qpr1-dev 2021-09-09 23:35:40 +00:00