Merge "Prevent NPE when init device profile" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-09-08 02:14:31 +00:00
committed by Android (Google) Code Review
+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);