fix: Disable all Android desktop features

Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
Pun Butrach
2026-02-04 00:13:41 +07:00
parent 4369274d4a
commit d18d2c41b2
6 changed files with 47 additions and 66 deletions

View File

@@ -58,7 +58,6 @@ Compatibility list:
* [Lawnchair] Crash when tapping on launcher preview
* [Launcher] Actually fix app drawer alphabetical listing when loading icon in bulk
* [Launcher] Mark home bounce as seen when user actually opens All Apps
* [Launcher] Correct detect QPR1 build and enable features for them accordingly
### 🥞 Development 4 Release 1 (Snapshot 10)

View File

@@ -30,8 +30,8 @@ class DesksUtils {
@JvmStatic
fun areMultiDesksFlagsEnabled() =
if (Utilities.ATLEAST_BAKLAVA_1) {
// LC-Ignored: Lawnchair-TODO: Intentional unless we can find a way to detect QPR1 build or skip to Android 17
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue &&
DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_FRONTEND.isTrue
} else {

View File

@@ -142,8 +142,8 @@ public class CheckLongPressHelper {
private void triggerLongPress() {
boolean showHomeBehindDesktop;
if (Utilities.ATLEAST_BAKLAVA_1) {
// LC-Ignored
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
showHomeBehindDesktop = Flags.showHomeBehindDesktop();
} else {
showHomeBehindDesktop = false;

View File

@@ -51,7 +51,6 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Build.VERSION_CODES;
import android.os.Build.VERSION_CODES_FULL;
import android.os.DeadObjectException;
import android.os.Handler;
import android.os.Message;
@@ -160,7 +159,7 @@ public final class Utilities {
@ChecksSdkIntAtLeast(api = 36, codename = "BAKLAVA_1")
public static final boolean ATLEAST_BAKLAVA_1 =
(Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001);
&& (Build.VERSION.SDK_INT_FULL >= 3600001); // pE-TODO(): Why Build.VERSION_CODES_FULL.BAKLAVA_1 failed?
/**
* Set on a motion event dispatched from the nav bar. See {@link MotionEvent#setEdgeFlags(int)}.

View File

@@ -22,9 +22,6 @@ import static com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper.enabl
import android.content.res.Resources.NotFoundException;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Build.VERSION_CODES_FULL;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.content.Context;
@@ -150,8 +147,8 @@ public class DesktopModeStatus {
*/
public static boolean canEnterDesktopMode(@NonNull Context context) {
boolean ENABLED_PROJECTED_DISPLAY_DESKTOP_MODE;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
ENABLED_PROJECTED_DISPLAY_DESKTOP_MODE = DesktopExperienceFlags.ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE.isTrue();
} else {
ENABLED_PROJECTED_DISPLAY_DESKTOP_MODE = false;
@@ -161,8 +158,8 @@ public class DesktopModeStatus {
|| canInternalDisplayHostDesktops(context));
boolean ENABLE_DESKTOP_WINDOWING_MODE;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
ENABLE_DESKTOP_WINDOWING_MODE = DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_MODE.isTrue();
} else {
ENABLE_DESKTOP_WINDOWING_MODE = false;
@@ -177,9 +174,8 @@ public class DesktopModeStatus {
*/
private static boolean isDesktopModeEnabledByDevOption(@NonNull Context context) {
boolean isDesktopModeForcedEnabled;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
// LC-Ignored
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
isDesktopModeForcedEnabled = DesktopModeFlags.isDesktopModeForcedEnabled();
} else {
isDesktopModeForcedEnabled = false;
@@ -204,8 +200,8 @@ public class DesktopModeStatus {
}
boolean ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT = DesktopExperienceFlags.ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue();
} else {
ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT = false;
@@ -228,8 +224,8 @@ public class DesktopModeStatus {
boolean ENABLE_MULTIPLE_DESKTOPS_FRONTEND;
boolean ENABLE_MULTIPLE_DESKTOPS_BACKEND;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
ENABLE_MULTIPLE_DESKTOPS_FRONTEND = DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_FRONTEND.isTrue();
ENABLE_MULTIPLE_DESKTOPS_BACKEND = DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue();
} else {
@@ -250,8 +246,8 @@ public class DesktopModeStatus {
boolean ENABLE_MULTIPLE_DESKTOPS_FRONTEND;
boolean ENABLE_MULTIPLE_DESKTOPS_BACKEND;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
ENABLE_MULTIPLE_DESKTOPS_FRONTEND = DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_FRONTEND.isTrue();
ENABLE_MULTIPLE_DESKTOPS_BACKEND = DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue();
} else {
@@ -289,8 +285,8 @@ public class DesktopModeStatus {
return true;
}
final boolean enableDesktopModeThroughDevOption;
if ((VERSION.SDK_INT >= VERSION_CODES.BAKLAVA)
&& (VERSION.SDK_INT_FULL >= 3600001)) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
enableDesktopModeThroughDevOption = Flags.enableDesktopModeThroughDevOption();
} else {
enableDesktopModeThroughDevOption = false;

View File

@@ -72,18 +72,16 @@ class DesktopStateImpl(context: Context) : DesktopState {
}
override val canShowDesktopModeDevOption: Boolean =
isDeviceEligibleForDesktopModeDevOption && if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
isDeviceEligibleForDesktopModeDevOption && if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
Flags.showDesktopWindowingDevOption()
} else {
false
}
private val isDesktopModeEnabledByDevOption =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopModeFlags.isDesktopModeForcedEnabled()
} else {
false
@@ -92,17 +90,15 @@ class DesktopStateImpl(context: Context) : DesktopState {
override val canEnterDesktopMode: Boolean = run {
val isEligibleForDesktopMode =
isDeviceEligibleForDesktopMode &&
(if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
(if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE.isTrue
} else {
false
} || canInternalDisplayHostDesktops)
val desktopModeEnabled =
isEligibleForDesktopMode && if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
isEligibleForDesktopMode && if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_MODE.isTrue
} else { false}
desktopModeEnabled || isDesktopModeEnabledByDevOption
@@ -112,18 +108,16 @@ class DesktopStateImpl(context: Context) : DesktopState {
!enforceDeviceRestrictions || isDesktopModeSupported || isDesktopModeDevOptionSupported
override val canShowDesktopExperienceDevOption: Boolean =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
Flags.showDesktopExperienceDevOption()
} else {
false
} && isDeviceEligibleForDesktopExperienceDevOption
override val enterDesktopByDefaultOnFreeformDisplay: Boolean =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_DESKTOP_FIRST_BASED_DEFAULT_TO_DESKTOP_BUGFIX.isTrue ||
DesktopExperienceFlags.ENTER_DESKTOP_BY_DEFAULT_ON_FREEFORM_DISPLAYS.isTrue &&
SystemProperties.getBoolean(
@@ -140,9 +134,8 @@ class DesktopStateImpl(context: Context) : DesktopState {
get() {
if (!enforceDeviceRestrictions) return true
val desktopModeSupportedByDevOptions =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
Flags.enableDesktopModeThroughDevOption()
} else {
false
@@ -151,9 +144,8 @@ class DesktopStateImpl(context: Context) : DesktopState {
}
override val enableMultipleDesktops: Boolean =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue
&& DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_FRONTEND.isTrue
} else {
@@ -161,9 +153,8 @@ class DesktopStateImpl(context: Context) : DesktopState {
} && canEnterDesktopMode
override fun isMultipleDesktopFrontendEnabledOnDisplay(display: Display): Boolean =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_FRONTEND.isTrue
&& DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue
} else {
@@ -181,9 +172,8 @@ class DesktopStateImpl(context: Context) : DesktopState {
if (!canEnterDesktopMode) return false
if (!enforceDeviceRestrictions) return true
if (display.type == Display.TYPE_INTERNAL) return canInternalDisplayHostDesktops
if (!if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (!if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT.isTrue
} else {false}
) return false
@@ -191,9 +181,8 @@ class DesktopStateImpl(context: Context) : DesktopState {
}
override fun isProjectedMode(): Boolean {
if (!if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (!if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
DesktopExperienceFlags.ENABLE_PROJECTED_DISPLAY_DESKTOP_MODE.isTrue
} else {
false
@@ -223,9 +212,8 @@ class DesktopStateImpl(context: Context) : DesktopState {
}
override val overridesShowAppHandle: Boolean =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
(Flags.showAppHandleLargeScreens() ||
BubbleAnythingFlagHelper.enableBubbleToFullscreen()) && deviceHasLargeScreen
} else {
@@ -238,16 +226,15 @@ class DesktopStateImpl(context: Context) : DesktopState {
Settings.Global.getInt(
context.getContentResolver(),
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT,
0,
0
) != 0
override val isFreeformEnabled: Boolean = hasFreeformFeature || hasFreeformDevOption
override val shouldShowHomeBehindDesktop: Boolean =
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA)
&& (Build.VERSION.SDK_INT_FULL >= 3600001)
) {
if (false) {
// LC-Ignored: Intentional, all Android desktop flags are disabled
Flags.showHomeBehindDesktop() && context.resources.getBoolean(
R.bool.config_showHomeBehindDesktop,
R.bool.config_showHomeBehindDesktop
)
} else {
false