Since we have blur and zoom effect, the desaturation transition of
ImageWallpaper is no longer necessary, so we remove related logic.
Bug: 153511553
Test: Manually test
Test: atest com.android.systemui
Change-Id: Id88fd5931f9168b7c4821dfdbb84165523c7dfa9
This adds a notion of per caller wallpaper zoom, in order to support
simultaneous clients.
The shade might be pulled down while in overview, for example, and we
must coordinate between launcher and systemui.
Bug: 149792636
Bug: 146387434
Test: atest NotificationShadeWindowViewTest
Test: atest WallpaperControllerTests
Test: manual
Change-Id: I588ba56d3d2704845d033ea2a5890ce812b9ee07
ImageWallpaperTest was creating an Engine that was run on the main
thread. Instead, pass a mocked handler to the Engine so that the main
thread isn't unnecessarily doing work in a test which may cause other
tests to fail.
Test: atest SystemUITests
Bug: 149204632
Change-Id: Ifc5f52bc33cd661c2b7818ccf7e8dafedd60d6c9
We nullify mWorker right in ImageWallpaper#destroy(),
we might get NPE if postRender is invoked later.
Thus, we add null check to avoid NPE.
Bug: 144039509
Bug: 146167292
Test: atest com.android.systemui
Test: atest CtsMultiUserHostTestCases
Change-Id: Idff558cbdbfa96df3154eb726a36645ee847c0bd
Scale bitmap to fit display size leads to memory regression, this cl
removes the sacling logic and also disable wallpaper transitions when
the bitmap size is smaller than display size to avoid broken visual.
Bug: 147379974
Bug: 145897588
Bug: 124838911
Test: Manually
Test: atest com.android.systemui.ImageWallpaperTest
--rerun-until-failure 20
Test: atest com.android.systemui
Change-Id: I243274af54538fc89268c448aa2c5a95f63c7ae3
Check if the system wallpaper is wcg and request a wcg surface if yes.
Also take multiple display case into account.
Bug: 136338733
Bug: 74008618
Test: Manually
Change-Id: I830dca97be61401453dffb892a7beb8afc0a32f4
This adds providers for some of the system level objects that we rely
on as well.
A handful of calls for Dependency.get() have been removed in this
cl, (though others are added where necessary).
Bug: 142536902
Test: atest SystemUITests && manual
Change-Id: Id9cb62deba5229895d487803124dd115b7288466
Add some debug logs to trace black wallpaper issue.
Bug: 139487871
Test: Manually switch between app and home.
Test: Manually switch between aod and home.
Test: Observe log.
Change-Id: I8a81f2c4f4b368d6140227308080a7a5a65eb376
We only need support ambient mode on specified devices but we currently
enable this attribute on all devices, that means we need redraw every
time when ambient mode changes. However, we can just show / hide
wallpaper window on the devices which not support ambient transition.
In addition, always use portrait dimension as scissor area since we only
do transition in portrait.
Bug: 138021396
Bug: 137962047
Test: Manually test on F2, C1, B4, S4 and walleye.
Test: Set an image wallpaper, switch between home, aod and lockscreen.
Test: Also use finger print to unlock from aod to home directly.
Test: Rotate to landscape, set a new image wallpaper.
Test: Switch between home, aod and lockscreen.
Change-Id: I36dd49363e81df5a260b10695d90aa9d8c70a45a
There is a race condition between window visibility and wallpaper
transition, so wallpaper window might become visible before background
thread has done its rendering work and a flicker happens.
This solution just lets main thread wait for background thread to
synchronize window visibility and wallpaper transition.
Bug: 136643341
Test: atest SystemUITests
Test: Screen off Launcher/APP -> AOD : No extra transition by design,
The duration between press Power Key and AOD show should be same.
Test: Screen on AOD -> Launcher : Face unlock work without flickr
Test: Screen off Keyguard -> AOD : Either Panel or background transition without flickr
Test: Screen on AOD -> Keyguard : Either Panel or background transition without flickr
Test: Reach in AOD -> Keyguard : Either Panel or background transition without flickr
Test: Reach out Keyguard -> AOD : Either Panel or background transition without flickr
Test: Manually operate and observe log.
Change-Id: Iebfdac18972569864c047bc2c4a33d7791940896
Doing image wallpaper rendering works on main thread may cause other
animation in system ui janky, so move the drawing task of image
wallpaper to another thread. We also make draw low priority.
Bug: 135601062
Test: observe log and systrace
Change-Id: I7bda6a757cb63f97f6b03c4b035fedbf87f91c96
We do zoom in from lockscreen to aod1 and zoom out in reverse
transition.
Bug: 124822340
Bug: 133785684
Test: manually set image wallpaper.
Test: Press power key back and forth and observe.
Change-Id: I842f929c730d1234717faa77e32f733f131c6ca0
Add dump function to provide information in bug report.
Bug: 131822567
Test: adb bugreport and see the output.
Change-Id: If95a14c5c201093d099692629696851d4094bc67
We shouldn't use GLSurfaceView inside wallpaper so we just remove it.
I addition, we also addressed a memory regression bug so we try release
EGL context as possible to reduce memory usage.
Bug: 131822567
Bug: 124127996
Test: Set a image wallpaper and observe.
Test: adb shell dumpsys meminfo com.android.systemui
Change-Id: I99bc2b45d28f93d473c845f235e22c8e846ea4cc
We don't need the bitmap after we uploads it to texture so we nullify
the reference to get it can be gced.
We also need to release the graphic memory when user changes the wallpaper
or the graphic memory will increase dramatically.
Bug: 128897294
Test: Change wallpaper, observes android profiler
Change-Id: I207d67741e6a7643a13ba97fccdab355dd09e30c
We will always render image wallpaper with GLEngine so the
DrawableEnigne is no longer necessary.
Remove DrawableEngine and related code including tests makes the code
more clean.
Bug: 123617158
Test: Manually set wallpaper by Photos and rotate home
Test: runtest systemui
Change-Id: I630112e755b74217e44518ec93273c99fb173f24
We have to render image wallpaper with OpenGL ES to apply some amazing
visual effects.
Bug: 122803209
Bug: 124073420
Bug: 123616712
Bug: 123615467
Test: Manually.
Change-Id: I0123d4ba2acb5a84b709c0468910e006c8e49563
This reverts commit 9a8e260af1.
Bug: 118658627
Reason for revert:
I've received a few bug reports indicating that images were getting stretched, animations were gone and sometimes nothing would be rendered.
I'll revert the CL to have something for stable for Beta 1. We can then work on the fixes after the Taiwan team is back from vacation.
Change-Id: Id09ba3d7f372af9153c056a12e676c0227d19939
We have to render image wallpaper with OpenGL ES to apply some amazing
visual effects.
Bug: 122803209
Test: Manually.
Change-Id: I8d702a59211de58f912f2a18cb54b6e807c6e457
Keep surface size large enough to draw the image.
When we shrink for small image, we still maintain its aspect ratio.
Fix: 123108383
Test: atest ImageWallpaperTest
Test: manual verify aspect ratio not changed after rotate.
Test: manual put a small image as wallpaper and see surface size won't
grow too much.
Change-Id: Icf3bc4a3129d9aecba2b57c620f378b9d9d7374b
The wallpaper bitmap will be unloaded after a few seconds to
free memory, this means that onSurfaceRedrawNeeded would need
to synchronously load an image, which may delay app launches.
Test: manually rotate screen
Change-Id: Ib4987265e5a1dd113b7cd2c8ea7c9d8f8ce5a8f3
Fixes: 110732172
(on AndroidTV there is no need for wallpaper and RAM is wasted)
Bug: 74517029
Test: Push a low resolution wallpaper to the device (adb push new_wallpaper /data/system/users/0/wallpaper),
reboot and check the buffer size for com.android.systemui.ImageWallpaper (adb shell dumpsys SurfaceFlinger)
Change-Id: I992175997ed09360e8fc9c2cabf354fb4fabd1f9
Change-Id: Iaabd856faeb1215e8c945e900782bb1dd5a43f30
Fixes: 113105610
Test: set display cutout to hide, reboot phone, set cutout to default, verify wallpaper has no black bar
DisplayListCanvas, that draws Bitmaps on the Android framework,
has a bitmap size limit. Let's respect the limit to guarantee
that SystemUI won't crashloop when a bitmap is over 100MB
Test: manual, setting wallpaper
Change-Id: Iff91e73722a912efe095f80e263e160cc2456a11
Fixes: 111330638
Use mNeedsDrawAfterLoadingWallpaper to determine if redraw
is needed.
Test: manual: set different wallpapers, or use the sample
app in b/110432281
Change-Id: Ibd5639ce59e9b59869f067705b9db25f7de8b201
Fixes: 110432281
Bug: 110432281
Bug: 109972857
There's also no need to offload WallpaperManager#forgetLoadedBitmap
because Bitmap#recycle is asynchronous - and the whole method is
synchronized.
Fixes 77597550
Test: atest cts/tests/framework/base/activitymanager/src/android/server/am/ActivityManagerMultiDisplayTests.java
Change-Id: I88014e21bd05e10c2f524393bb637596708e4e63
Added logging to make it easier to debug and
re-route drawing problems.
Test: Set wallpaper, look at logs.
Test: Rotate screen, look at logs.
Bug: 70361780
Change-Id: I894bc6217b1ffd804a07f0f631f57d72b968dd63
Wallpaper would have the wrong placement during
first frame because it would be center aligned
in a surface that's not big enough.
Also removed old OpenGl implementation, in favor of new
hardware accelerated canvas.
Change-Id: Ic9c9eaa817e1f6494aa5431d8278f2c28b2c45a9
Fixes: 66926914
Test: set wallpapaer with different offsets, orientations and devices
Let's just wait until the current async task finishes,
the engine will be recreated if the bitmap changes.
Test: Set wallpaper, no black frame
Change-Id: Icad8c18095119e9e035efc04704bc6d2d35af6d9
Fixes: 63065764
Emulator can use host GPU for rendering and supports GLES 2 already.
The isEmulator() logic is not only unnecessary but also causes the
launcher to have black background.
BUG: 33788018
Change-Id: Ib6d942490e8808e202c444f96becec1b75953838
Forgetting the wallpaper requires holding the wallpaper
manager lock - which is also held when the bitmap is
read from disk. To prevent blocking the main thread,
we need to offload the forget operation to the background
too.
Change-Id: Ic20c4f5fd86b788efd5b77a417108383dda343b9
Fixes: 28769940
Test: manually change wallpaper, rotate screen
- Add tracing when drawing ImageWallpaper.
- Don't force a redraw in onSurfaceRedrawNeeded. This only adds
another unnecessary draw and doesn't do anything useful.
onSurfaceRedrawNeeded is only here so the client can block.
- Delay entrance animation by one frame so wallpaper can be drawn
before the transition is starting.
- Add some delay for animating the tasks up in recents to match that
delay (it wasn't matched before at all).
- Fix an issue where launchedFromHome was wrong while docking.
Bug: 28769940
Change-Id: I2b763ed40078541328a1e04ffecf5b0a520fe019
TRIM_MEMORY_UI_HIDDEN > TRIM_MEMORY_RUNNING constants, so we only
need to throw away the wallpaper if we are actually running low on
memory.
Bug: 28769940
Change-Id: I8aa27d081bbcc2eff553e9420b2b9b0920f3781f
Previously, the wallpaper would draw even when
the surface had been destroyed, leading to
crashes.
Change-Id: I6465e832abb3bfd92495bca9b60dac474b35f6d6
Fixes: 28329816
Fixes a bug where the image wallpaper size
would not correctly update. Suspected cause
is checking the to-be-requested size against
the current surface size instead of the
requested surface size.
Also removes an unused field.
Bug: 21148936
Change-Id: Ief4585bd5aed5922337709d7ae0ca0bf948649d0
Previously we fetched rotation and dimens separately
which had the potential to cause inconsistencies.
Bug: 21440533
Change-Id: Ic537dbc01fc27af14124b1d97d4babafb6bc15f8
[Preconditions]
open auto-rotate
[Procedures]
1.enter Contacts app, and rotate 90 degrees to the right
2.press power key to lock screen,and unlock
3.rotare 90 degrees to the left and exit Contacts app
4.the wallpaper will be black first,then show the really wallpaper