diff options
author | 2024-12-03 15:02:59 +0000 | |
---|---|---|
committer | 2024-12-03 15:02:59 +0000 | |
commit | ec6bcb96eb371262f47551dffd70d24d5420c446 (patch) | |
tree | c2b0e50770ab4af513c1b6a91b860da1d803cd9d | |
parent | 681890767d1c570b4e7aec460b6593274e1bb26b (diff) |
Revert "Enable app handle on foldables"
This reverts commit 681890767d1c570b4e7aec460b6593274e1bb26b.
Reason for revert: <Potential culprit for b/382032271 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.>
Change-Id: I2184f217cee9bad318b0dfe4e02a30604acd049f
5 files changed, 10 insertions, 68 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 2caa058522c8..0d13ca83ec59 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -7195,6 +7195,10 @@ screen. --> <bool name="config_dragToMaximizeInDesktopMode">false</bool> + <!-- Whether showing the app handle is supported on this device. + If config_isDesktopModeSupported, then this has no effect --> + <bool name="config_enableAppHandle">false</bool> + <!-- Frame rate compatibility value for Wallpaper FRAME_RATE_COMPATIBILITY_MIN (102) is used by default for lower power consumption --> <integer name="config_wallpaperFrameRateCompatibility">102</integer> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index de1f85475a72..4f029cdcacc9 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -5737,6 +5737,9 @@ screen. --> <java-symbol type="bool" name="config_dragToMaximizeInDesktopMode" /> + <!-- Whether showing the app handle is supported on this device --> + <java-symbol type="bool" name="config_enableAppHandle" /> + <!-- Frame rate compatibility value for Wallpaper --> <java-symbol type="integer" name="config_wallpaperFrameRateCompatibility" /> diff --git a/libs/WindowManager/Shell/shared/Android.bp b/libs/WindowManager/Shell/shared/Android.bp index 5bbda95c466f..5113d980fb7d 100644 --- a/libs/WindowManager/Shell/shared/Android.bp +++ b/libs/WindowManager/Shell/shared/Android.bp @@ -26,7 +26,6 @@ filegroup { name: "wm_shell-shared-utils", srcs: [ "src/com/android/wm/shell/shared/TransitionUtil.java", - "src/com/android/wm/shell/shared/Utils.java", ], } @@ -72,7 +71,6 @@ java_library { srcs: [ "**/desktopmode/*.java", "**/desktopmode/*.kt", - ":wm_shell-shared-utils", ], static_libs: [ "com.android.window.flags.window-aconfig-java", diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/Utils.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/Utils.java deleted file mode 100644 index f5e6ddd9774d..000000000000 --- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/Utils.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.wm.shell.shared; - -import android.annotation.NonNull; - -import java.util.function.Supplier; - -/** - * This class provides generic utility methods and classes for shell - */ -public class Utils { - - /** - * Lazily returns object from a supplier with caching - * @param <T> type of object to get - */ - public static class Lazy<T> { - private T mInstance; - - /** - * @param supplier the supplier that defines the return value if not defined already - * @return the cached value or the value from the supplier - */ - public final T get(@NonNull Supplier<T> supplier) { - if (mInstance == null) { - mInstance = supplier.get(); - } - return mInstance; - } - } -} diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java index 4c6ef9329314..04c17e54d11f 100644 --- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java @@ -16,19 +16,14 @@ package com.android.wm.shell.shared.desktopmode; -import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY; -import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY; - import android.annotation.NonNull; import android.content.Context; -import android.hardware.devicestate.DeviceStateManager; import android.os.SystemProperties; import android.window.DesktopModeFlags; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; import com.android.window.flags.Flags; -import com.android.wm.shell.shared.Utils.Lazy; import java.io.PrintWriter; @@ -40,8 +35,6 @@ public class DesktopModeStatus { private static final String TAG = "DesktopModeStatus"; - private static Lazy<Boolean> sIsFoldableDevice = new Lazy<>(); - /** * Flag to indicate whether task resizing is veiled. */ @@ -202,7 +195,8 @@ public class DesktopModeStatus { * necessarily enabling desktop mode */ public static boolean overridesShowAppHandle(@NonNull Context context) { - return Flags.showAppHandleLargeScreens() && isDeviceFoldable(context); + return Flags.showAppHandleLargeScreens() + && context.getResources().getBoolean(R.bool.config_enableAppHandle); } /** @@ -250,17 +244,6 @@ public class DesktopModeStatus { } /** - * @return {@code true} if this is a foldable device - */ - private static boolean isDeviceFoldable(@NonNull Context context) { - return sIsFoldableDevice.get(() -> context.getSystemService(DeviceStateManager.class) - .getSupportedDeviceStates().stream().anyMatch(state -> - state.hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY) - || state.hasProperty( - PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY))); - } - - /** * Return {@code true} if a display should enter desktop mode by default when the windowing mode * of the display's root [TaskDisplayArea] is set to WINDOWING_MODE_FREEFORM. */ @@ -300,6 +283,6 @@ public class DesktopModeStatus { pw.println(maxTaskLimitHandle == null ? "null" : maxTaskLimitHandle.getInt(/* def= */ -1)); pw.print(innerPrefix); pw.print("showAppHandle config override="); - pw.print(overridesShowAppHandle(context)); + pw.print(context.getResources().getBoolean(R.bool.config_enableAppHandle)); } } |