Loading packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepositoryTest.kt +1 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepository.kt +16 −28 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 } Loading @@ -180,11 +173,6 @@ constructor( } else { inputGesturesMatchingKeyGestureType.firstOrNull() } } else { return customInputGesturesRepository.retrieveCustomInputGestures().firstOrNull { it.action.keyGestureType() == keyGestureTypeForShortcutBeingDeleted } } } suspend fun confirmAndSetShortcutCurrentlyBeingCustomized(): Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -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" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepositoryTest.kt +1 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepository.kt +16 −28 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 } Loading @@ -180,11 +173,6 @@ constructor( } else { inputGesturesMatchingKeyGestureType.firstOrNull() } } else { return customInputGesturesRepository.retrieveCustomInputGestures().firstOrNull { it.action.keyGestureType() == keyGestureTypeForShortcutBeingDeleted } } } suspend fun confirmAndSetShortcutCurrentlyBeingCustomized(): Loading