diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-10-04 16:50:57 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-10-05 09:58:13 -0700 |
commit | ba47faae6a84231e01af3f5147ddf05a2dabe216 (patch) | |
tree | ef89277c3c378d01a026fc064e6a9c45a9e20be4 /src/com/android/launcher3/Launcher.java | |
parent | 0474222c2545f448ceb9dc116240e1ea1bc543b3 (diff) | |
download | android_packages_apps_Trebuchet-ba47faae6a84231e01af3f5147ddf05a2dabe216.tar.gz android_packages_apps_Trebuchet-ba47faae6a84231e01af3f5147ddf05a2dabe216.tar.bz2 android_packages_apps_Trebuchet-ba47faae6a84231e01af3f5147ddf05a2dabe216.zip |
Moving widget reinflation to push model
Instead of checking every widget, a widget which needs reinflation
would post a callback on launcher avoiding unnecessary loops in onResume
Bug: 67305604
Change-Id: I53e08d6f4795f7b716a9debca5c0c68dd25a7afe
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 9d31492da..7688b9d09 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -908,14 +908,6 @@ public class Launcher extends BaseActivity mWaitingForResume.setStayPressed(false); } - // It is possible that widgets can receive updates while launcher is not in the foreground. - // Consequently, the widgets will be inflated in the orientation of the foreground activity - // (framework issue). On resuming, we ensure that any widgets are inflated for the current - // orientation. - if (!isWorkspaceLoading()) { - getWorkspace().reinflateWidgetsIfNecessary(); - } - updateInteraction(Workspace.State.NORMAL, mWorkspace.getState()); mWorkspace.onResume(); @@ -3257,7 +3249,10 @@ public class Launcher extends BaseActivity info.pendingItemInfo = null; } - mWorkspace.reinflateWidgetsIfNecessary(); + if (((PendingAppWidgetHostView) view).isReinflateIfNeeded()) { + view.reinflate(); + } + getModelWriter().updateItemInDatabase(info); return info; } |