diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 6a37816504..14a12a0534 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -296,6 +296,8 @@
+
+
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index c0e8b1c800..18821c7cb9 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -106,13 +106,14 @@ public class InvariantDeviceProfile {
"idp_non_fixed_landscape_grid_name";
@Retention(RetentionPolicy.SOURCE)
- @IntDef({TYPE_PHONE, TYPE_MULTI_DISPLAY, TYPE_TABLET})
+ @IntDef({TYPE_PHONE, TYPE_MULTI_DISPLAY, TYPE_TABLET, TYPE_DESKTOP})
public @interface DeviceType {
}
public static final int TYPE_PHONE = 0;
public static final int TYPE_MULTI_DISPLAY = 1;
public static final int TYPE_TABLET = 2;
+ public static final int TYPE_DESKTOP = 3;
private static final float ICON_SIZE_DEFINED_IN_APP_DP = 48;
@@ -1008,8 +1009,10 @@ public class InvariantDeviceProfile {
private static final int DEVICE_CATEGORY_PHONE = 1 << 0;
private static final int DEVICE_CATEGORY_TABLET = 1 << 1;
private static final int DEVICE_CATEGORY_MULTI_DISPLAY = 1 << 2;
+ private static final int DEVICE_CATEGORY_DESKTOP = 1 << 3;
private static final int DEVICE_CATEGORY_ANY =
- DEVICE_CATEGORY_PHONE | DEVICE_CATEGORY_TABLET | DEVICE_CATEGORY_MULTI_DISPLAY;
+ DEVICE_CATEGORY_PHONE | DEVICE_CATEGORY_TABLET | DEVICE_CATEGORY_MULTI_DISPLAY
+ | DEVICE_CATEGORY_DESKTOP;
private static final int INLINE_QSB_FOR_PORTRAIT = 1 << 0;
private static final int INLINE_QSB_FOR_LANDSCAPE = 1 << 1;
@@ -1234,6 +1237,9 @@ public class InvariantDeviceProfile {
case TYPE_MULTI_DISPLAY:
return (deviceCategory & DEVICE_CATEGORY_MULTI_DISPLAY)
== DEVICE_CATEGORY_MULTI_DISPLAY;
+ case TYPE_DESKTOP:
+ return (deviceCategory & DEVICE_CATEGORY_DESKTOP)
+ == DEVICE_CATEGORY_DESKTOP;
default:
return false;
}
diff --git a/src/com/android/launcher3/util/DisplayController.java b/src/com/android/launcher3/util/DisplayController.java
index 8e7933f78a..aee895a396 100644
--- a/src/com/android/launcher3/util/DisplayController.java
+++ b/src/com/android/launcher3/util/DisplayController.java
@@ -18,6 +18,8 @@ package com.android.launcher3.util;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
+import static com.android.launcher3.Flags.enableScalabilityForDesktopExperience;
+import static com.android.launcher3.InvariantDeviceProfile.TYPE_DESKTOP;
import static com.android.launcher3.InvariantDeviceProfile.TYPE_MULTI_DISPLAY;
import static com.android.launcher3.InvariantDeviceProfile.TYPE_PHONE;
import static com.android.launcher3.InvariantDeviceProfile.TYPE_TABLET;
@@ -53,6 +55,7 @@ import androidx.annotation.VisibleForTesting;
import com.android.launcher3.InvariantDeviceProfile.DeviceType;
import com.android.launcher3.LauncherPrefChangeListener;
import com.android.launcher3.LauncherPrefs;
+import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.dagger.ApplicationContext;
import com.android.launcher3.dagger.LauncherAppComponent;
@@ -507,6 +510,7 @@ public class DisplayController implements DesktopVisibilityListener {
private final boolean mShowLockedTaskbarOnHome;
private final boolean mIsHomeVisible;
+ private final boolean mIsDesktopFormFactor;
private final boolean mShowDesktopTaskbarForFreeformDisplay;
@@ -573,6 +577,8 @@ public class DisplayController implements DesktopVisibilityListener {
mShowDesktopTaskbarForFreeformDisplay = wmProxy.showDesktopTaskbarForFreeformDisplay(
displayInfoContext);
mIsHomeVisible = wmProxy.isHomeVisible();
+ mIsDesktopFormFactor = enableScalabilityForDesktopExperience()
+ && displayInfoContext.getResources().getBoolean(R.bool.desktop_form_factor);
}
/**
@@ -657,6 +663,10 @@ public class DisplayController implements DesktopVisibilityListener {
}
public @DeviceType int getDeviceType() {
+ if (mIsDesktopFormFactor) {
+ return TYPE_DESKTOP;
+ }
+
int flagPhone = 1 << 0;
int flagTablet = 1 << 1;