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
This commit is contained in:
Sunny Goyal
2024-01-05 09:29:06 -08:00
parent 3c52d93131
commit fdeb19e02c
7 changed files with 198 additions and 171 deletions

View File

@@ -1,7 +1,6 @@
package com.android.launcher3.widget;
import android.appwidget.AppWidgetHostView;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
@@ -117,7 +116,7 @@ public class WidgetHostViewLoader implements DragController.DragListener {
return;
}
AppWidgetHostView hostView = mLauncher.getAppWidgetHolder().createView(
(Context) mLauncher, mWidgetLoadingId, pInfo);
mWidgetLoadingId, pInfo);
mInfo.boundWidget = hostView;
// We used up the widget Id in binding the above view.