Do not reload launcher when changing active display
> Updating IDP to use fixed bitmap sizes, so that the cache
stays valid
> Caching last known windowMetrices for non-active displays and
using estimation only when the cache is not available
> Only reloading model if IDP change could have affected the model
> Remove unnecessary listeners from IDP which are already controlled by
model lifecycle
Bug: 191657065
Test: Manual
Change-Id: Ia8e6dfafd0977e62aa3fcf367ad79f7a49b2df51
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 702b73a..8adbcd9 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -83,7 +83,11 @@
Log.v(Launcher.TAG, "LauncherAppState initiated");
Preconditions.assertUIThread();
- mInvariantDeviceProfile.addOnChangeListener(idp -> refreshAndReloadLauncher());
+ mInvariantDeviceProfile.addOnChangeListener(modelPropertiesChanged -> {
+ if (modelPropertiesChanged) {
+ refreshAndReloadLauncher();
+ }
+ });
mContext.getSystemService(LauncherApps.class).registerCallback(mModel);