Revert "Revert "Moving DeviceProfile properties into DevicePrope..."

Revert submission 33716851-revert-33672643-DataDeviceProfile1-XHYRAPLEBK

Reason for revert: Error is fixed

Reverted changes: /q/submissionid:33716851-revert-33672643-DataDeviceProfile1-XHYRAPLEBK

Change-Id: Ib86824134955903c11e51e52dbfd6368aba1cd50
This commit is contained in:
Sebastián Franco authored and Sebastian Franco committed 2025-05-23 14:08:11 -07:00
1 parent 1bec329180
commit e1d31e5406
128 files changed
+727 -597

No files matched your search

+10 -8
View File
@@ -677,9 +677,9 @@ public class Launcher extends StatefulActivity<LauncherState>
// When the flag oneGridSpecs is on we want to disable ALLOW_ROTATION which is replaced
// by FIXED_LANDSCAPE_MODE, ALLOW_ROTATION will only be used on Tablets and foldables
// afterwards.
if (getDeviceProfile().isPhone) {
if (getDeviceProfile().getDeviceProperties().isPhone()) {
LauncherPrefs.get(this).put(LauncherPrefs.ALLOW_ROTATION, false);
} else if (getDeviceProfile().isTablet) {
} else if (getDeviceProfile().getDeviceProperties().isTablet()) {
// Tablet do not use fixed landscape mode, make sure it can't be activated by mistake
LauncherPrefs.get(this).put(FIXED_LANDSCAPE_MODE, false);
}
@@ -708,7 +708,7 @@ public class Launcher extends StatefulActivity<LauncherState>
this, getMultiWindowDisplaySize());
}
if (FOLDABLE_SINGLE_PAGE.get() && mDeviceProfile.isTwoPanels) {
if (FOLDABLE_SINGLE_PAGE.get() && mDeviceProfile.getDeviceProperties().isTwoPanels()) {
mCellPosMapper = new TwoPanelCellPosMapper(mDeviceProfile.inv.numColumns);
} else {
mCellPosMapper = new CellPosMapper(mDeviceProfile.isVerticalBarLayout(),
@@ -1883,13 +1883,15 @@ public class Launcher extends StatefulActivity<LauncherState>
public void updateOpenFolderPosition(int[] inOutPosition, Rect bounds, int width, int height) {
int left = inOutPosition[0];
int top = inOutPosition[1];
DeviceProfile grid = getDeviceProfile();
DeviceProfile deviceProfile = getDeviceProfile();
int distFromEdgeOfScreen = getWorkspace().getPaddingLeft();
if (grid.isPhone && (grid.availableWidthPx - width) < 4 * distFromEdgeOfScreen) {
final int availableWidth = deviceProfile.getDeviceProperties().getAvailableWidthPx();
if (deviceProfile.getDeviceProperties().isPhone()
&& (availableWidth - width) < 4 * distFromEdgeOfScreen) {
// Center the folder if it is very close to being centered anyway, by virtue of
// filling the majority of the viewport. ie. remove it from the uncanny valley
// of centeredness.
left = (grid.availableWidthPx - width) / 2;
left = (availableWidth - width) / 2;
} else if (width >= bounds.width()) {
// If the folder doesn't fit within the bounds, center it about the desired bounds
left = bounds.left + (bounds.width() - width) / 2;
@@ -1900,7 +1902,7 @@ public class Launcher extends StatefulActivity<LauncherState>
} else {
// Folder height is less than page height, so bound it to the absolute open folder
// bounds if necessary
Rect folderBounds = grid.getAbsoluteOpenFolderBounds();
Rect folderBounds = deviceProfile.getAbsoluteOpenFolderBounds();
left = Math.max(folderBounds.left, Math.min(left, folderBounds.right - width));
top = Math.max(folderBounds.top, Math.min(top, folderBounds.bottom - height));
}
@@ -2540,7 +2542,7 @@ public class Launcher extends StatefulActivity<LauncherState>
if (BuildCompat.isAtLeastV()
&& Flags.enableDesktopWindowingMode()
&& !Flags.enableDesktopWindowingWallpaperActivity()
&& mDeviceProfile.isTablet) {
&& mDeviceProfile.getDeviceProperties().isTablet()) {
// TODO(b/333533253): Clean up after desktop wallpaper activity flag is rolled out
return;
}