Merge "Remove demo mode layout code" into main

This commit is contained in:
Treehugger Robot
2025-03-28 19:14:34 -07:00
committed by Android (Google) Code Review
3 changed files with 1 additions and 18 deletions

View File

@@ -171,7 +171,6 @@
<attr name="numGridColumns" format="integer"/>
<attr name="dbFile" />
<attr name="defaultLayoutId"/>
<attr name="demoModeLayoutId"/>
</declare-styleable>
<declare-styleable name="GridDisplayOption">
@@ -233,7 +232,6 @@
<attr name="dbFile" format="string" />
<attr name="defaultLayoutId" format="reference" />
<attr name="demoModeLayoutId" format="reference" />
<attr name="isScalable" format="boolean" />
<attr name="devicePaddingId" format="reference" />

View File

@@ -248,7 +248,6 @@ public class InvariantDeviceProfile {
public int gridType;
public String dbFile;
public int defaultLayoutId;
public int demoModeLayoutId;
public boolean[] inlineQsb = new boolean[COUNT_SIZES];
/**
@@ -376,7 +375,6 @@ public class InvariantDeviceProfile {
dbFile = closestProfile.dbFile;
gridType = closestProfile.gridType;
defaultLayoutId = closestProfile.defaultLayoutId;
demoModeLayoutId = closestProfile.demoModeLayoutId;
numFolderRows = closestProfile.numFolderRows;
numFolderColumns = closestProfile.numFolderColumns;
@@ -979,7 +977,6 @@ public class InvariantDeviceProfile {
private final String dbFile;
private final int defaultLayoutId;
private final int demoModeLayoutId;
private final boolean isScalable;
private final boolean mIsDualGrid;
@@ -1018,15 +1015,12 @@ public class InvariantDeviceProfile {
numRows = gridSize.mNumRows;
dbFile = gridSize.mDbFile;
defaultLayoutId = gridSize.mDefaultLayoutId;
demoModeLayoutId = gridSize.mDemoModeLayoutId;
} else {
numRows = a.getInt(R.styleable.GridDisplayOption_numRows, 0);
numColumns = a.getInt(R.styleable.GridDisplayOption_numColumns, 0);
dbFile = a.getString(R.styleable.GridDisplayOption_dbFile);
defaultLayoutId = a.getResourceId(
R.styleable.GridDisplayOption_defaultLayoutId, 0);
demoModeLayoutId = a.getResourceId(
R.styleable.GridDisplayOption_demoModeLayoutId, defaultLayoutId);
}
numSearchContainerColumns = a.getInt(
@@ -1209,8 +1203,6 @@ public class InvariantDeviceProfile {
final float mMinDeviceHeightPx;
final String mDbFile;
final int mDefaultLayoutId;
final int mDemoModeLayoutId;
GridSize(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GridSize);
@@ -1222,8 +1214,6 @@ public class InvariantDeviceProfile {
mDbFile = a.getString(R.styleable.GridSize_dbFile);
mDefaultLayoutId = a.getResourceId(
R.styleable.GridSize_defaultLayoutId, 0);
mDemoModeLayoutId = a.getResourceId(
R.styleable.GridSize_demoModeLayoutId, mDefaultLayoutId);
a.recycle();
}

View File

@@ -35,7 +35,6 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
import android.util.Log;
@@ -649,12 +648,8 @@ public class ModelDbController {
}
private DefaultLayoutParser getDefaultLayoutParser(LauncherWidgetHolder widgetHolder) {
int defaultLayout = mIdp.demoModeLayoutId != 0
&& mContext.getSystemService(UserManager.class).isDemoUser()
? mIdp.demoModeLayoutId : mIdp.defaultLayoutId;
return new DefaultLayoutParser(mContext, widgetHolder,
mOpenHelper, mContext.getResources(), defaultLayout);
mOpenHelper, mContext.getResources(), mIdp.defaultLayoutId);
}
private ConstantItem<Boolean> getEmptyDbCreatedKey() {