Commit Graph

8 Commits

Author SHA1 Message Date
Sunny Goyal
fdeb19e02c Simplifying pending widget inflation path
Instead of adding a PendingView in appWidgetHost, attaching a
listener in PendingView for widget-updates.

This moves the view inflation as the last stage of widget
binding. Eventually we can separate the model update and view
inflation to different threads

Bug: 318539160
Test: atest TaplBinderTests
Flag: None
Change-Id: I124edaa9622fa367302b80969036d128a978396e
2024-01-08 15:52:50 -08:00
Sunny Goyal
4df719a1e6 Removing ENABLE_CACHED_WIDGET since we now have always listenign widget
> Also using PendingWidgetView for deferred widget view

Bug: 270395008
Flag: LEGACY ENABLE_CACHED_WIDGET enabled
Test: Exising widgets tests pass.
      Verified UI by forcefully rendering deferred widget

Change-Id: Id34f89d778f9f993c1b7ad13f66e57fda9843417
2024-01-04 09:26:10 -08:00
Sunny Goyal
b02dafc1d4 Removing explicit target SDK for launcher
> It will automatically target the latest SDK it was compiled with

Bug: 284349887
Test: Presubmit and manual
Flag: N/A
Change-Id: I32629b0dd710c3c04d8f70f988b7279e7cae6731
2023-06-26 10:15:14 -07:00
Pinyao Ting
bd638e7b41 Retains cached widget in launcher process
Currently cached widget are retained in LauncherWidgetHolder which is
released when Launcher activity is recreated. This CL moves the cached
widget into LauncherAppState to keep the cache alive.

Bug: 268189435
Test: steps below
1. Add multiple widgets (Calendar / Weather ... e.t.c) to Home Screen
2. Open Google Map, start navigation to any place
3. Google Map enters navigation mode and changes resolution
4. Swipe up to exit Google Map and go to Home Screen
5. Verify you don't see deferred widget host view.

Change-Id: I8b56167313780cd1be2a5da88517114acc6d44af
2023-03-21 11:04:31 -07:00
Sihua Ma
cdb3c0af1a Use app widget host instead of holder to get rid of deleteHost
Also putting the calls to destroy() in try-finally blocks.

Test: N/A
Fix: 272535886
Change-Id: I57ecd90e412b3b8b59b4ed755a5d4191b05fd9b3
2023-03-09 11:19:18 -08:00
Sunny Goyal
a13cc8167f Deferred widget update
Maintaing a list of pending updates while the host
is not listening, so that these can be applied when
host starts listening again

Bug: 267351283
Test: Manual
Change-Id: I38423862a3461724b36f17ffe44e44c55fee06de
2023-02-13 14:54:25 -08:00
Sihua Ma
1db8bc2467 Add QuickstepWidgetHolder for widget handling
Fix: 235358918
Test: Manual
1. Rebooted the device and verified that widgets are still updating properly
2. Changed the theme from dark to daylight, then from daylight back to dark and verified that widgets are working
3. Kept the device on for several days and verified that widgets are still updating
4. Turn on auto-rotate for the launcher, open any app then exit, verified that widgets will not vanish and reappear
5. Add & remove widgets from the screen, added widgets are still updating

Change-Id: I98ee902f7d16b47bd77626201a4fefc897ba17a0
2022-12-16 11:56:36 -08:00
Sihua Ma
8bbfcb6581 Move LauncherWidgetHolder to widget package
Making LauncherAppWidgetHost package-private as well

Bug: 235358918
Test: N/A
Change-Id: If022ec8d429579a972991872b2dc11db76719341
2022-11-16 14:31:14 -08:00