From 76ba0a328da7229cb123a9aa983a0b180c2c110e Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Mon, 10 Jun 2019 11:56:11 -0700 Subject: Saving instance state so that widget cache is updated properly before rebind List widgets use a static cache which is initialized as part of saveInstanceState. Calling this ensures that no extra binder calls are made on rotation Bug: 134707989 Change-Id: I8d4450134168bd412ba2911c57354a603868bc47 --- src/com/android/launcher3/Launcher.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 57a9b161f..9db2ec047 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -465,6 +465,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, reapplyUi(); mDragLayer.recreateControllers(); + // Calling onSaveInstanceState ensures that static cache used by listWidgets is + // initialized properly. + onSaveInstanceState(new Bundle()); // TODO: We can probably avoid rebind when only screen size changed. rebindModel(); } -- cgit v1.2.3