Commit Graph

16728 Commits

Author SHA1 Message Date
Steve Elliott
654c615cf9 Defer MessagingGroup#recycle until bind completes
There is a "race condition" where a MessagingGroup is recycled while the
contents of that group are being used elsewhere in the
ConversationLayout, namely in the "image message container" used to show
the most recent image message in the collapsed state.

This state isn't cleared until later in the bind() process, which
unfortunately depends on the groups being updated. For that reason, we
defer all synchronous calls to recycle() until the end of bind(), which
will ensure that the old groups are still around as long as necessary.

Fixes: 216202070
Test: manual
Change-Id: Idef815d54690544615512bd2bd1006f172403e18
(cherry picked from commit 2a68270c76)
2022-03-10 20:19:43 +00:00
Jeff Chang
f36b7b9f80 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is
able to be tapped through, which can trick the user into starting a
harmful activity.

The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for
the activity to prevent the tapjacking/overlay attack.

Bug: 205595291
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
(cherry picked from commit a04b3666b8)
2022-01-28 04:46:20 +00:00
TreeHugger Robot
67e26d7469 Merge "Enable nested scrolling for locale picker" into sc-v2-dev 2022-01-19 14:46:19 +00:00
Kalesh Singh
17a6606ec1 Add system_server to readtracefs group
This allows system_server to search/read tracefs entries. It is needed
for attaching cpu timeinstate bpf programs to tracepoints.

Bug: 208892266
Bug: 209513178
Bug: 214061655
Test: libtimeinstate_test
Change-Id: I4139605eb7c5277887092b3d6a3fb26bf4f8f171
Merged-In: I4139605eb7c5277887092b3d6a3fb26bf4f8f171
2022-01-14 18:50:40 +00:00
Mill Chen
fa861a6b5d Enable nested scrolling for locale picker
This change is to make the locale picker list enable the nested
scrolling feature. It is necessay to enable this feature to be able to
work with CollapsingToolbarLayout.

Fixes: 207318265
Fixes: 213036789
Test: manual test
1. Verify the locale picker works with Activity
2. Verify the locale picker works with SettingsBaseActivity

Change-Id: Iaf90211da640cd265fc2b23dd34b3149c4406891
2022-01-14 09:25:49 +00:00
Winson Chung
64f486017f Notify sysui of side swipe gestures that will show the bars transiently
- This won't be needed in T when immersive mode gestures are moved
  to SysUI (b/161689946)

Bug: 208886351
Test: atest SystemUITests
Test: In both 3button/gestural (all orientations), swipe from bar
      areas, swipe from sides show entry point only when swiping over
      bars
Change-Id: Ie8f15a5fbd3248bc86a50ffcd1fc73cd08c4e214
2022-01-06 17:41:58 +00:00
Miranda Kephart
bf4096c6f9 Merge "Update sharesheet for large devices" into sc-v2-dev 2021-12-10 16:17:51 +00:00
Miranda Kephart
39746bcec7 Update sharesheet for large devices
Switches to a wrapped sharesheet (instead of filling the screen)
and 6 columns instead of 8 for large screens. Also fixes some
small details with the appearance (see
https://docs.google.com/presentation/d/1WDbmWx6uXaFi8jos7Sp6ZUmBh24Y5Bj5G7dW78LxE40/edit#slide=id.gb836e06a0c_0_0)

Bug: 195102471
Test: manual (visual changes)
Merged-In: I5d84dce0aea7657a50dc3376be9d8b5e41b907db
Change-Id: I5d84dce0aea7657a50dc3376be9d8b5e41b907db
2021-12-10 03:18:26 +00:00
Chris Li
e40ee51d37 Use the current dimensions instead of relying on onConfigurationChanged
There are some cases when the View will not receive
onConfigurationChanged event (such as DialogFragment). Always use the
current dimensions instead.

Fix: 205251075
Test: test with Settings app
Change-Id: If626fe597c02efcb480c05ca88cffbfae1b21a89
2021-11-30 17:39:00 +08:00
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