Commit Graph

13093 Commits

Author SHA1 Message Date
Jason Chang
3ebd024a80 Merge "Fix tutorial background color not up-to-date occasionally" into sc-dev 2021-07-27 16:00:30 +00:00
Vadim Caen
ee08a68fd4 Merge "Do not draw icon background if it shouldn't be seen" into sc-dev 2021-07-27 10:05:17 +00:00
Jason Chang
f40204087c Fix tutorial background color not up-to-date occasionally
1. Fix bug in the legacy code flow
   - Obtain color from contextThemeWrapper Theme_DeviceDefault_DayNight
   - In OneHandedDisplayAreaOrganizer#finishOffset()
     Remove redundant call "cb.onStartTransition" due to
     ambugiuous.

2. Improve performance
   - Remove redundunt callbacks.
   - Avoid create/remove leash on each start/end cycle.
   - Dispatch Transaction to bkg leash through onAnimationUpdate()
     bkg leash apply the same Transaction of display area.
   - Adjust animation duration of Tutorial panel.
   - Move bkg leash depend on yPos value to reduce SF
     componsition overhead.

3. Improve code readibility
   - Code flow : Register -> onStart() -> show  background ->
     detach background -> Unregister -> remove leash.
   - Remove redundant synchronization due to wmshell already
     guarantee thread safe.
   - Move getTranslationFraction to SettingsUtil.
   - Move getTransitionDuration to SettingsUtil.

Bug: 194507756
Bug: 193589897

Test: Local verify when changing dark theme and wallpaper theme.
Test: atest WMShellUnitTests
Change-Id: Ib55753be9e9f4665c20ad34437f86bf80cc9f3b4
2021-07-27 15:20:19 +08:00
TreeHugger Robot
4422d05a6a Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-07-23 22:42:14 +00:00
Bill Yi
3c9f786cfe Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I326b034f3bacb172f66f1c2ddd76bb9f359bcfe5
2021-07-23 13:33:10 +00:00
Wei Sheng Shih
e2ff050fbb Merge "Fine tune splash screen icon generation algorithm" into sc-dev 2021-07-23 13:31:27 +00:00
Wei Sheng Shih
0793f65c95 Merge "Correcting the package name used on splash screen window." into sc-dev 2021-07-23 11:54:28 +00:00
Vadim Caen
496b4cbb86 Do not draw icon background if it shouldn't be seen
Test: atest CtsWindowManagerDeviceTestCases:SplashscreenTests
Bug: 193608336
Change-Id: I824137e67eaa0133337fcaf55c44fca46bac8010
2021-07-23 13:27:11 +02:00
wilsonshih
7a7722abe0 Correcting the package name used on splash screen window.
The top activity in TaskActivitiesReport can be filter out if the state
of top activity is INITIALIZING, this doesn't make sense for splash
screen, because the state of the top activity do can be INITIALIZING.
Create a filed targetActivityInfo in StartingWindowInfo to specify the
starting activity info.

Bug: 193459277
Test: atest SplashscreenTests StartingSurfaceDrawerTests
Change-Id: Ifec7aff644013a0426e0622162ab24f6b9fb3d8f
2021-07-23 16:50:01 +08:00
wilsonshih
331615ad61 Fine tune splash screen icon generation algorithm
Filter out the translucent pixels when compute the foreground colors
of an adaptive icon, which should make sense because the translucent
pixels on icon should only used for decoration, do not let it affect
the opaque pixels, also with this filter we won't drop down the
performance when using palette.

Bug: 193304878
Test: manual launch single color background apps.
Change-Id: Ia9873cf907d30bb7f30318a289a54159d0a51ee3
2021-07-23 12:44:43 +08:00
TreeHugger Robot
5cac66cb4e Merge "Skip operation on content overlay if task's vanished" into sc-dev 2021-07-22 23:20:20 +00:00
Winson Chung
d4dd12ee06 Merge "Skip animating out bubble screenshot if surface is not ready" into sc-dev 2021-07-22 22:10:46 +00:00
Hongwei Wang
1817bc47bd Skip operation on content overlay if task's vanished
The stack trace in b/194344478 and b/194280568 is actually from the
preceding ActivityThreadTest test, which does not fail but does crash
certain test cases after that.

Since we may set a start delay on the content overlay fading out
animation, there is chance that onTaskVanished happens before it is
actually started. It's also possible that onTaskVanished happens during
the content overlay fadeout. This CL should have addressed both cases.

Bug: 194344478
Bug: 194280568
Test: atest --iteration 5 \
      ActivityThreadTest#testHandlePictureInPictureRequested_overriddenToEnter \
      ScreenshotTests#testScreenshotSecureLayers \
      TaskStackChangedListenerTest#testTaskChangeCallBacks
Change-Id: I81c0622966df32e02db7cb5aa3cd42d7c4af735e
Merged-In: I81c0622966df32e02db7cb5aa3cd42d7c4af735e
2021-07-22 21:38:57 +00:00
TreeHugger Robot
ea52c87596 Merge changes from topic "native_hint" into sc-dev
* changes:
  Implement java PerformanceHintManager on top of native
  Switch HWUI to use native performance hint API
  Implement native PerformanceHint API
2021-07-22 21:15:04 +00:00
TreeHugger Robot
a08d1cb0f1 Merge "Apply theme color and fade-in transition effect at the top of One-handed mode" into sc-dev 2021-07-22 20:09:53 +00:00
Bo Liu
6a3fc60f43 Switch HWUI to use native performance hint API
Test: None
Bug: 194204196
Change-Id: I80dfdb5d56921c465406cc4534e82738c668d46d
2021-07-22 11:33:01 -04:00
Jason Chang
966382b0c9 Apply theme color and fade-in transition effect at
the top of One-handed mode

1. Implement the Dynamic color theme at the top Tutorial area
but the color should not be the same as the recents UI.

2. Do not translate Tutorial icon & text vertically, then provide
quick subtle fade-in effect for Tutorial window.

3. Apply new icon for tutorial.

Bug: 193126258
Bug: 193589897

Test: Local verify when changing dark theme and wallpaper theme.
Test: Local verify Tutorial icon & text fade-in effect.
Test: atest SystemUITests
Test: atest WMShellTests
Test: Perfetto check enter & exit performance
Change-Id: I60f4e7a709f3a27fe6c7f480f1012caccdbbe5ec
2021-07-22 23:00:06 +08:00
Wei Sheng Shih
61d71ccaae Merge "Using BaseIconFactory to draw legacy icon." into sc-dev 2021-07-22 10:06:34 +00:00
Winson Chung
b9b673fb4a Skip animating out bubble screenshot if surface is not ready
Bug: 193634894
Test: atest SystemUITests
Change-Id: Ifb2ba00be2e8dc497300feb39bacb88b9021df4a
2021-07-22 04:29:56 +00:00
wilsonshih
45abb0b357 Using BaseIconFactory to draw legacy icon.
Use the shared launcher library to draw legacy icon.

Bug: 193780874
Test: launch app which still using legacy icon from Launcher.
Change-Id: Id8ccb5b6c532880ff207526fd754e92fdd08e284
2021-07-21 21:25:51 +08:00
TreeHugger Robot
73ef335c0f Merge "Fix entering PiP transition in button navigation mode" into sc-dev 2021-07-21 02:48:29 +00:00
Hongwei Wang
33c3fcc671 Fix entering PiP transition in button navigation mode
Included in this CL
- when there is no source rect hint, use a content overlay during the transition
- otherwise, take account the display cutout to offset/inset the source
  rect hint

Test with following variants when entering PiP in button nav
- from 0 / 90 / 270 rotation
- with or without source rect hint
- display cutout mode set to default or shortEdge

Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cxk4vy8VenQPSv83vHEs22
Bug: 191310680
Test: manual, see the test cases listed and video above
Change-Id: Ie54a54de6e55397e25024373ea4e2855fde2d9f7
Merged-In: Ie54a54de6e55397e25024373ea4e2855fde2d9f7
2021-07-20 23:43:23 +00:00
Ben Lin
c312c6481b Merge "PiP: Allow customization of PiP minimum size." into sc-dev 2021-07-20 20:35:36 +00:00
TreeHugger Robot
ed889bb867 Merge "Fix One-handed tutorial looks janky on entering transition" into sc-dev 2021-07-18 17:31:34 +00:00
TreeHugger Robot
f560a753fd Merge "In VuklanManager make sure we have a valid semaphore context before destroying it." into sc-dev 2021-07-16 21:26:53 +00:00
Bill Lin
500e2b146d Fix One-handed tutorial looks janky on entering transition
According to systrace, one-handed-tutorial-overlay got
jank problem(SurfaceFlinger GPU Deadline Missed,
App Deadline Missed, Buffer stuffing).

1.setLayerType(LAYER_TYPE_HARDWARE) when create targetViewContainer
  setLayerType(LAYER_TYPE_NONE) when removeTutorialFromWindowManager
2.Rename isShowing() to isAttached()
3.Remove redundant float casting
4.Remove redundant increment param

Test: manual trigger OHM
Test: atest WMShellUnitTests
Bug: 193589897
Change-Id: Ieec397795b46dee9ca04375bfc26b09441688d08
2021-07-16 19:21:15 +08:00
John Reck
53c02ec9fd Merge "Adjust declared usage for createHardwareBitmapFromRenderNode" into sc-dev 2021-07-15 23:32:01 +00:00
Ben Lin
f75fffdc20 PiP: Allow customization of PiP minimum size.
Bug: 171596717
Test: None.
Change-Id: I9bb6f2740d25fce99a436f938e7b3cca819ffa98
2021-07-15 12:21:30 -07:00
Greg Daniel
e8dc397bfd In VuklanManager make sure we have a valid semaphore context before destroying it.
If errors occured during finishFrame that caused us to not have a
semaphore or possibly destroy the semaphore early we will end up
with a null mDestroySemaphoreContext in swapBuffers which we tried
to destroy unconditionally.

I haven't repro'd the connected bug, but based on the crash stack
this seems like the likely cause.

Test: manual code inspection and build.
Bug: 191950033
Change-Id: I0fbd33edff3552b91b980da9e3b2c45bc52a2dd0
2021-07-15 13:38:44 -04:00
John Reck
6c213067c9 Adjust declared usage for createHardwareBitmapFromRenderNode
Fixes: 182901940
Test: make && atest CtsUiRenderingTestCases
Change-Id: I0f911463bcf819ef2350e95eaeef099d9edfa866
2021-07-15 16:44:52 +00:00
John Reck
6a84070852 Merge "Always submit after texture uploads" into sc-dev 2021-07-15 15:27:50 +00:00
John Reck
cf1170fbda Always submit after texture uploads
Ensure GrContext::submit() is always called after either
Bitmap#prepareToDraw() or if DrawFrameTask skipped drawing.

In either case texture uploads & deletions will be scheduled,
but without the submit they won't actually be performed. This
can end up running out of RAM.

Bug: 189393671
Test: manual test app
Change-Id: I57477c64457558487e9e5ec0a979ad9099a8cb2c
2021-07-14 17:06:28 -04:00
John Reck
0f284da923 Avoid sampling outside BQ crop rect
The region outside of the BQ crop rect is potentially
garbage. Avoid sampling from it.

Fixes: 189656466
Test: CTS PixelCopyTests & DecodeAccuracyTest
Change-Id: I2910d93471f08aaf807ac9f87fdf84cf29cf4143
2021-07-14 14:26:14 -04:00
Wei Sheng Shih
a9a861134d Merge "Get starting window background color directly." into sc-dev 2021-07-14 01:28:39 +00:00
wilsonshih
3be521ad48 Get starting window background color directly.
SystemUI does not need to re-calculate background color of starting
window because Shell library is bound to SystemUI, so status bar can
get background color directly, also this can support to get the
background color from snapshot starting window.

Also fix the starting window listener did not receiveing background
color successful because makeSplashScreenContentView is execute on
another background thread, so there should block the splash screen
thread until the background color is estimated.

Bug: 192213918
Bug: 192659309
Test: manual launch apps from Notification and Launcher, ensure the
color is correctly send to SystemUI or Launcher.

Change-Id: I626cb23d7aebfe4e032fad285bfad374c0e11cea
2021-07-13 18:53:19 +08:00
TreeHugger Robot
2c522a3910 Merge "Remove unnecessary log in CursorWindow.create" into sc-dev 2021-07-12 19:39:09 +00:00
TreeHugger Robot
1e67f86165 Merge "Properly protect mFrameMetricsReporter" into sc-dev 2021-07-11 08:30:13 +00:00
Bill Lin
5ad4a8093c Merge "Redesign One-haned tutorial UX behavior" into sc-dev 2021-07-10 01:05:11 +00:00
Bill Lin
1334cfb90d Merge "Improve SystemUIBootiming_StartServices_avg" into sc-dev 2021-07-10 01:03:56 +00:00
Bill Lin
80b340a9aa Improve SystemUIBootiming_StartServices_avg
Previously, we tried to tuning boottime of SysUI
See go/systemuiboottiming_ohm
- Reduce access setting provide at SysUI start-up
- Remove unused obervers
  1. Timeout
  2. TapAppExit
- Update mShortcutEnabled state at ctor

Test: manual enable OHM shortcut, rebot
      make sure shortcut function works
Test: atest WMShellUnitTests
Test: asit/perf/boottime_test
Bug: 193225130
Change-Id: I2753f8b1e47622c00b9c6d2f4cd319c6e43634ea
2021-07-09 21:31:05 +08:00
Bill Lin
477c88a7d5 Redesign One-haned tutorial UX behavior
- Always show tutorial for user to know device state
  is in One-handed mode.
- Clean the redundant params from ctor

Test: manual trigger OHM
Test: atest WMShellUnitTests
Bug: 192648901
Change-Id: I10c3f3f29190b672fb88471df3cf374a994cdaa7
2021-07-09 19:05:05 +08:00
Jason Chang
97b75f09ed Add metrics log for One-handed mode Shortcut toggle switch
To write metrics log for One-handed mode Shortcut toggle switch state.

Bug: 192641587

Test: Local add logs to verify before writing metrics logs API call
Test: atest SystemUITests
Test: atest WMShellTests
Change-Id: I02fda724bf2960355d78f1a26ac6d65225687176
2021-07-09 03:24:58 +00:00
Bill Lin
7f162ddaf0 Merge "Improve SystemUIBootTiming performance in OneHandedController" into sc-dev 2021-07-09 02:00:33 +00:00
Siarhei Vishniakou
07d35cb7dc Properly protect mFrameMetricsReporter
This field actually requires a special lock, mFrameMetricsReporterMutex.
But there isn't a GUARDED_BY annotation for it. And even if there was,
the compiler feature of -Wthread-safety was not active in this code, so
this error would not have been caught.

To fix this, enable the compiler annotation and add GUARDED_BY
annotation to mFrameMetricsReporter.
And finally, use this lock to properly protect this field.

Bug: 192330836
Test: atest hwui_unit_tests
Change-Id: I76950bfa01bbd7ccdc54c4e8c114430b5aeddf1a
2021-07-09 00:32:29 +00:00
Chris Li
a23a2bb5db Revert "Revert "Not show size compat UI when task is not visible""
This reverts commit 76370b6fe6.

Reason for revert: Fix the merge break in ShellTaskOrganizerTests.java

Fix: 193069342
Test: atest WMShellUnitTests:ShellTaskOrganizerTests
Change-Id: I02c4bddc407eaac0ebb7cd5abb0b394f242d4d6e
2021-07-08 12:09:40 -07:00
Chris Li
e7ed99bfc2 Merge "Remove TaskInfo#topActivityToken usage in size compat for security" into sc-dev 2021-07-08 18:05:40 +00:00
John Reck
a8bb119574 Merge "Reduce number of weakrefs per frame" into sc-dev 2021-07-08 15:04:16 +00:00
Leon Jeng
76370b6fe6 Revert "Not show size compat UI when task is not visible"
This reverts commit adb92508c0.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=coral-userdebug&lkgb=7530814&lkbb=7530923&fkbb=7530923, bug b/193105445

Bug: 193105445
Change-Id: I697229da6986d6466d7f13872e9ae7a727b80838
2021-07-08 09:48:10 +00:00
Bill Lin
3aafe19994 Improve SystemUIBootTiming performance in OneHandedController
Fix race condition in SystemUIBootTiming issue.

1. Avoid updateOneHandedEnabled() called twice during init
   a. [O] come from setOneHandedEnabled()
   b. [X] come from setSwipeToNotificationEnabled()
2. Passively waiting shortcut enabled changed callback, and then
         query setting ACCESSIBILITY_BUTTON_TARGETS status.
3. Add a new flag isShortcutEnabled to cache shortcut enabled
   state.
4. By new OHM Settings UX design setSwipeToNotificationEnabled()
   should NOT setEnabledGesturalOverlay().
5. Remove redundant auto enabled Toast and print in log instead.
   (In general case, user is not able to see the Toast)

Test: atest google/perf/boottime/boottime-test
Test: atest SystemUITests
Test: atest WMShellTests
Test: manual factory reboot, OHM should disabled by default
Bug: 192612924
Change-Id: I8b24c99bc8bd5bfb17c73a6bb8494109d9a8170d
2021-07-08 14:14:25 +08:00
Chris Li
927c644bfa Merge "Not show size compat UI when task is not visible" into sc-dev 2021-07-08 05:53:15 +00:00