Create less number of dot-renderers at startup

Bug: 235568943
Test: Launcher starts and shows dots normally
Change-Id: I6958b9b98efb43aa280e6ce31af9c0c936610dea
This commit is contained in:
Sunny Goyal committed 2022-08-02 14:43:31 -07:00
1 parent ceb2aaa9e4
commit 65190aef37
3 files changed
+43 -12

No files matched your search

@@ -48,6 +48,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.content.res.ResourcesCompat;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.model.DeviceGridState;
import com.android.launcher3.provider.RestoreDbTask;
import com.android.launcher3.testing.shared.ResourceUtils;
@@ -396,10 +397,12 @@ public class InvariantDeviceProfile {
final List<DeviceProfile> localSupportedProfiles = new ArrayList<>();
defaultWallpaperSize = new Point(displayInfo.currentSize);
SparseArray<DotRenderer> dotRendererCache = new SparseArray<>();
for (WindowBounds bounds : displayInfo.supportedBounds) {
localSupportedProfiles.add(new DeviceProfile.Builder(context, this, displayInfo)
.setUseTwoPanels(deviceType == TYPE_MULTI_DISPLAY)
.setWindowBounds(bounds)
.setDotRendererCache(dotRendererCache)
.build());
// Wallpaper size should be the maximum of the all possible sizes Launcher expects