Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38a50749 authored by Maryam Dehaini's avatar Maryam Dehaini
Browse files

Add config to remove status bar input layer

Removing status bar input layer is not yet supported on desktop devices.
Add config to prevent changes from breaking device.

Bug: 441628172
Test: m
Flag: com.android.window.flags.enable_remove_status_bar_input_layer
Change-Id: Ib2177007325f2d539492d39bd7365285dac64623
parent adf48f86
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -191,4 +191,9 @@
    <string-array name="desktop_windowing_app_handle_education_allowlist_apps"></string-array>
    <!-- Apps that can trigger Desktop Windowing App-To-Web Education -->
    <string-array name="desktop_windowing_app_to_web_education_allowlist_apps"></string-array>

    <!-- Whether the status bar input layer should be removed.
         TODO: b/444730302 - remove config once status bar input layer can be removed for all
          devices. -->
    <bool name="config_removeStatusBarInputLayer">true</bool>
</resources>
+7 −3
Original line number Diff line number Diff line
@@ -100,12 +100,16 @@ class AppHandleViewHolder(
    // above the status bar. The purpose of this View is to receive input intended for
    // captionHandle.
    private var statusBarInputLayer: AdditionalSystemViewContainer? = null
    // TODO: b/444730302 - remove config once status bar input layer can be removed for all devices
    private val shouldAddStatusBarInputLayer =
        !DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue ||
            !context.resources.getBoolean(R.bool.config_removeStatusBarInputLayer)

    init {
        captionView.setOnTouchListener(onCaptionTouchListener)
        captionHandle.setOnTouchListener(onCaptionTouchListener)
        captionHandle.setOnClickListener(onCaptionButtonClickListener)
        if (DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue) {
        if (!shouldAddStatusBarInputLayer) {
            ViewCompat.replaceAccessibilityAction(
                captionHandle,
                AccessibilityActionCompat.ACTION_CLICK,
@@ -158,7 +162,7 @@ class AppHandleViewHolder(
        }
        this.taskInfo = taskInfo
        if (
            DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue &&
            !shouldAddStatusBarInputLayer &&
                DesktopExperienceFlags.ENABLE_APP_HANDLE_POSITION_REPORTING.isTrue
        ) {
            return
@@ -297,7 +301,7 @@ class AppHandleViewHolder(
    fun disposeStatusBarInputLayer() {
        if (
            !statusBarInputLayerExists ||
                (DesktopExperienceFlags.ENABLE_REMOVE_STATUS_BAR_INPUT_LAYER.isTrue &&
                (!shouldAddStatusBarInputLayer &&
                    DesktopExperienceFlags.ENABLE_APP_HANDLE_POSITION_REPORTING.isTrue)
        ) {
            return