Prevent NPE when init device profile

Fix: 198871283
Test: manual
Change-Id: Ie303ff4f3dc05f419e80038e41e195dc874ba40a
This commit is contained in:
Jerry Chang
2021-09-08 08:20:58 +08:00
parent b9e08f5773
commit bfac46a30c
+5 -3
View File
@@ -600,9 +600,11 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
private void initDeviceProfile(InvariantDeviceProfile idp) {
// Load configuration-specific DeviceProfile
mDeviceProfile = isInMultiWindowMode()
? mDeviceProfile.getMultiWindowProfile(this, getMultiWindowDisplaySize())
: idp.getDeviceProfile(this);
mDeviceProfile = idp.getDeviceProfile(this);
if (isInMultiWindowMode()) {
mDeviceProfile = mDeviceProfile.getMultiWindowProfile(
this, getMultiWindowDisplaySize());
}
onDeviceProfileInitiated();
mModelWriter = mModel.getWriter(getDeviceProfile().isVerticalBarLayout(), true, this);