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

Commit f54d636b authored by Josh's avatar Josh Committed by Joshua Mokut
Browse files

Removing app shortcut removal fix flag

Test: CustomShortcutCategoriesRepositoryTest
Flag: EXEMPT Flag cleanup
Fix: 413803763
Change-Id: Id9b5c59b61251775dbdfbb1e56c16c14cd69c0c5
parent b740d38c
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -2001,16 +2001,6 @@ flag {
    bug: "402759931"
}

flag {
    name: "app_shortcut_removal_fix"
    namespace: "systemui"
    description: "During custom app shortcut removal, use custom shortcut command as key to find the right InputGestureData to be deleted"
    bug: "405058325"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
   name: "skip_cancelling_huns_for_guts"
   namespace: "systemui"
+1 −2
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import android.view.KeyEvent.META_META_ON
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.hardware.input.Flags.FLAG_ENABLE_CUSTOMIZABLE_INPUT_GESTURES
import com.android.systemui.Flags.FLAG_APP_SHORTCUT_REMOVAL_FIX
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.keyboard.shared.model.ShortcutCustomizationRequestResult
@@ -320,7 +319,7 @@ class CustomShortcutCategoriesRepositoryTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(FLAG_ENABLE_CUSTOMIZABLE_INPUT_GESTURES, FLAG_APP_SHORTCUT_REMOVAL_FIX)
    @EnableFlags(FLAG_ENABLE_CUSTOMIZABLE_INPUT_GESTURES)
    fun removeAppCategoryShortcut_successfullyRetrievesGestureDataAndDeletesTheCorrectShortcut() {
        testScope.runTest {
            // We are collecting this because the flow is a cold flow but we need its value as a
+16 −28
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.hardware.input.KeyGestureEvent.KeyGestureType
import android.hardware.input.KeyGlyphMap
import android.util.Log
import androidx.annotation.VisibleForTesting
import com.android.systemui.Flags.appShortcutRemovalFix
import com.android.systemui.Flags.shortcutHelperKeyGlyph
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
@@ -153,21 +152,15 @@ constructor(

    private fun retrieveInputGestureDataForShortcutBeingDeleted(): InputGestureData? {
        val keyGestureTypeForShortcutBeingDeleted = getKeyGestureTypeForShortcutBeingCustomized()
        if (appShortcutRemovalFix()) {
        val inputGesturesMatchingKeyGestureType =
            customInputGesturesRepository.retrieveCustomInputGestures().filter {
                it.action.keyGestureType() == keyGestureTypeForShortcutBeingDeleted
            }

            return if (
                keyGestureTypeForShortcutBeingDeleted == KEY_GESTURE_TYPE_LAUNCH_APPLICATION
            ) {
        return if (keyGestureTypeForShortcutBeingDeleted == KEY_GESTURE_TYPE_LAUNCH_APPLICATION) {
            val shortcutBeingDeleted = getShortcutBeingCustomized() as Delete
            if (shortcutBeingDeleted.customShortcutCommand == null) {
                    Log.w(
                        TAG,
                        "Requested to delete custom shortcut but customShortcutCommand was null",
                    )
                Log.w(TAG, "Requested to delete custom shortcut but customShortcutCommand was null")
                return null
            }

@@ -180,11 +173,6 @@ constructor(
        } else {
            inputGesturesMatchingKeyGestureType.firstOrNull()
        }
        } else {
            return customInputGesturesRepository.retrieveCustomInputGestures().firstOrNull {
                it.action.keyGestureType() == keyGestureTypeForShortcutBeingDeleted
            }
        }
    }

    suspend fun confirmAndSetShortcutCurrentlyBeingCustomized():