Fix crash when restoring data from phone to tablet with responsive grid

This issue happens when restoring the data from a phone to a tablet or vice-versa. When Launcher is restoring the data, it allows the device to load a disabled or invalid grid temporarly for the migration. This leads to a crash when the responsive grid is enabled.
The hotseat spec has only WIDTH or HEIGHT specs in a certain posture. When the user restores the data from a phone to a tablet, the Launcher loads a handheld spec that doesn't have HEIGHT specs for the hotseat in landscape (spec_handheld_hotseat_[grid].xml). However, the tablet, in landscape, tries to retrieve the hotseat HEIGHT spec.

It also prevent crash when responsive grid is used with multi window mode. isVerticalBarLayout becomes false. Then, the responsive grid tries to load a hotseat spec that doesn't exist (using DimensionType.HEIGHT). Phones have hotseat specs only for DimensionType.WIDTH.

Bug: 315548992
Fix: 315069300
Fix: 315377544
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: v2/android-crystalball-eng/health/microbench/systemui/main/systemui-notification-3-jank-suite
Test: atest CtsWindowManagerDeviceDisplay:android.server.wm.display.MultiDisplaySystemDecorationTests#testSendPrimaryHomeIntentActivityOnDisplayWithDecorations -- --abi x86_64
Change-Id: Ibd6537e0528868da9a1b7672c43b5455fa6a8184
2 files changed