Fixed the bug where Shortcut Dialog is not displaying correctly

_Thanks for submitting a pull request. Please include the following information._

**What I have done and why**

_Include a summary of what your pull request contains, and why you have made these changes._

Fixes #161

**How I'm testing it**

_Choose at least one:_

- Unit tests
- UI tests
- Screenshot tests
- N/A _(provide justification)_

**Do tests pass?**

- [ ] Run local tests on `DemoDebug` variant: `./gradlew testDemoDebug`
- [ ] Check formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`

Shortcut Dialog is not displaying correctly
https://github.com/JackEblan/Geto/blob/0a77dd35c190b830c84e0ac3c29210fdf4d00fa7/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsScreen.kt#L360

If you click the **Add Shortcut** button, a dialog will pop-up on which you can add your home screen shortcut, but when you save it and click the **Add Shortcut** button again, the **Add Shortcut** dialog is still there. It should have been **Update Dialog**. In order to fix this, you have to navigate back then open the selected application again and re-execute the GetShortcut() function.

./gradlew :feature:app-settings:testDebugUnitTest --tests "com.android.geto.feature.appsettings.AppSettingsScreenSnackbarScreenshotTest" --tests "com.android.geto.feature.appsettings.AppSettingsScreenScreenshotTest" --tests "com.android.geto.feature.appsettings.AppSettingsViewModelTest" :core:domain:testDebugUnitTest --tests "com.android.geto.core.domain.UpdateRequestPinShortcutUseCaseTest" --tests "com.android.geto.core.domain.GetShortcutUseCaseTest" --tests "com.android.geto.core.domain.RequestPinShortcutUseCaseTest"

diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml
index f2d18c282..58348ea13 100644
--- a/.idea/deploymentTargetSelector.xml
+++ b/.idea/deploymentTargetSelector.xml
@@ -8,13 +8,13 @@
       <SelectionState runConfigName="Generate Baseline Profile for app">
         <option name="selectionMode" value="DROPDOWN" />
       </SelectionState>
-      <SelectionState runConfigName="appsScreen_isDisplayed_whenNavigateBackFromSettingsScreen()">
+      <SelectionState runConfigName="AppSettingsScreenTest">
         <option name="selectionMode" value="DROPDOWN" />
       </SelectionState>
-      <SelectionState runConfigName="NavigationTest">
+      <SelectionState runConfigName="AppSettingsScreenSnackbarTest">
         <option name="selectionMode" value="DROPDOWN" />
       </SelectionState>
-      <SelectionState runConfigName="appsScreen_isDisplayed_whenStarted()">
+      <SelectionState runConfigName="AppSettingsScreenDialogsTest">
         <option name="selectionMode" value="DROPDOWN" />
       </SelectionState>
     </selectionStates>
diff --git a/core/domain/src/main/kotlin/com/android/geto/core/domain/GetPinnedShortcutUseCase.kt b/core/domain/src/main/kotlin/com/android/geto/core/domain/GetPinnedShortcutUseCase.kt
new file mode 100644
index 000000000..c9837adf4
--- /dev/null
+++ b/core/domain/src/main/kotlin/com/android/geto/core/domain/GetPinnedShortcutUseCase.kt
@@ -0,0 +1,40 @@
+/*
+ *
+ *   Copyright 2023 Einstein Blanco
+ *
+ *   Licensed under the GNU General Public License v3.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       https://www.gnu.org/licenses/gpl-3.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.geto.core.domain
+
+import com.android.geto.core.data.repository.ShortcutRepository
+import com.android.geto.core.model.MappedShortcutInfoCompat
+import javax.inject.Inject
+
+class GetPinnedShortcutUseCase @Inject constructor(private val shortcutRepository: ShortcutRepository) {
+    operator fun invoke(id: String): GetPinnedShortcutResult {
+        val mappedShortcutInfoCompat = shortcutRepository.getPinnedShortcut(id = id)
+
+        return if (mappedShortcutInfoCompat != null) {
+            GetPinnedShortcutResult.Success(mappedShortcutInfoCompat = mappedShortcutInfoCompat)
+        } else {
+            GetPinnedShortcutResult.Failure
+        }
+    }
+}
+
+sealed interface GetPinnedShortcutResult {
+    data class Success(val mappedShortcutInfoCompat: MappedShortcutInfoCompat) : GetPinnedShortcutResult
+
+    data object Failure : GetPinnedShortcutResult
+}
diff --git a/core/domain/src/main/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCase.kt b/core/domain/src/main/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCase.kt
index 40af40adf..ad80c146a 100644
--- a/core/domain/src/main/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCase.kt
+++ b/core/domain/src/main/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCase.kt
@@ -44,7 +44,7 @@ class UpdateRequestPinShortcutUseCase @Inject constructor(private val shortcutRe
             ) {
                 UpdateRequestPinShortcutResult.Success
             } else {
-                UpdateRequestPinShortcutResult.Failed
+                UpdateRequestPinShortcutResult.Failure
             }
         } catch (e: IllegalArgumentException) {
             UpdateRequestPinShortcutResult.UpdateImmutableShortcuts
@@ -57,7 +57,7 @@ sealed interface UpdateRequestPinShortcutResult {

     data object Success : UpdateRequestPinShortcutResult

-    data object Failed : UpdateRequestPinShortcutResult
+    data object Failure : UpdateRequestPinShortcutResult

     data object UpdateImmutableShortcuts : UpdateRequestPinShortcutResult
 }
diff --git a/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsScreen.kt b/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsScreen.kt
index 707d6d0cd..bee3d0efe 100644
--- a/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsScreen.kt
+++ b/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsScreen.kt
@@ -70,6 +70,7 @@ import com.android.geto.core.designsystem.icon.GetoIcons
 import com.android.geto.core.designsystem.theme.GetoTheme
 import com.android.geto.core.domain.ApplyAppSettingsResult
 import com.android.geto.core.domain.AutoLaunchResult
+import com.android.geto.core.domain.GetPinnedShortcutResult
 import com.android.geto.core.domain.RequestPinShortcutResult
 import com.android.geto.core.domain.RevertAppSettingsResult
 import com.android.geto.core.domain.UpdateRequestPinShortcutResult
@@ -117,8 +118,8 @@ internal fun AppSettingsRoute(

     val applicationIcon = viewModel.applicationIcon.collectAsStateWithLifecycle().value

-    val mappedShortcutInfoCompat =
-        viewModel.mappedShortcutInfoCompat.collectAsStateWithLifecycle().value
+    val getPinnedShortcutResult =
+        viewModel.getPinnedShortcutResult.collectAsStateWithLifecycle().value

     val setPrimaryClipResult = viewModel.setPrimaryClipResult.collectAsStateWithLifecycle().value

@@ -139,7 +140,6 @@ internal fun AppSettingsRoute(
         appSettingsUiState = appSettingsUiState,
         snackbarHostState = snackbarHostState,
         applicationIcon = applicationIcon,
-        mappedShortcutInfoCompat = mappedShortcutInfoCompat,
         secureSettings = secureSettings,
         permissionCommandText = viewModel.permissionCommandText,
         applyAppSettingsResult = applyAppSettingsResult,
@@ -147,10 +147,11 @@ internal fun AppSettingsRoute(
         autoLaunchResult = autoLaunchResult,
         requestPinShortcutResult = requestPinShortcutResult,
         updateRequestPinShortcutResult = updateRequestPinShortcutResult,
+        getPinnedShortcutResult = getPinnedShortcutResult,
         setPrimaryClipResult = setPrimaryClipResult,
         onNavigationIconClick = onNavigationIconClick,
         onRevertAppSettings = { viewModel.revertAppSettings(packageName = appSettingsRouteData.packageName) },
-        onGetShortcut = { viewModel.getShortcut(packageName = appSettingsRouteData.packageName) },
+        onGetPinnedShortcut = { viewModel.getPinnedShortcut(packageName = appSettingsRouteData.packageName) },
         onCheckAppSetting = viewModel::checkAppSetting,
         onDeleteAppSetting = viewModel::deleteAppSetting,
         onLaunchApp = { viewModel.applyAppSettings(packageName = appSettingsRouteData.packageName) },
@@ -160,7 +161,9 @@ internal fun AppSettingsRoute(
         onResetApplyAppSettingsResult = viewModel::resetApplyAppSettingsResult,
         onResetRevertAppSettingsResult = viewModel::resetRevertAppSettingsResult,
         onResetAutoLaunchResult = viewModel::resetAutoLaunchResult,
-        onResetShortcutResult = viewModel::resetShortcutResult,
+        onResetRequestPinShortcutResult = viewModel::resetRequestPinShortcutResult,
+        onResetUpdateRequestPinShortcutResult = viewModel::resetUpdateRequestPinShortcutResult,
+        onResetGetPinnedShortcutResult = viewModel::resetGetPinnedShortcutResult,
         onResetSetPrimaryClipResult = viewModel::resetSetPrimaryClipResult,
         onGetSecureSettingsByName = viewModel::getSecureSettingsByName,
         onAddAppSetting = viewModel::addAppSetting,
@@ -191,7 +194,6 @@ internal fun AppSettingsScreen(
     appSettingsUiState: AppSettingsUiState,
     snackbarHostState: SnackbarHostState,
     applicationIcon: Drawable?,
-    mappedShortcutInfoCompat: MappedShortcutInfoCompat?,
     secureSettings: List<SecureSetting>,
     permissionCommandText: String,
     applyAppSettingsResult: ApplyAppSettingsResult?,
@@ -199,10 +201,11 @@ internal fun AppSettingsScreen(
     autoLaunchResult: AutoLaunchResult?,
     requestPinShortcutResult: RequestPinShortcutResult?,
     updateRequestPinShortcutResult: UpdateRequestPinShortcutResult?,
+    getPinnedShortcutResult: GetPinnedShortcutResult?,
     setPrimaryClipResult: Boolean,
     onNavigationIconClick: () -> Unit,
     onRevertAppSettings: () -> Unit,
-    onGetShortcut: () -> Unit,
+    onGetPinnedShortcut: () -> Unit,
     onCheckAppSetting: (Boolean, AppSetting) -> Unit,
     onDeleteAppSetting: (AppSetting) -> Unit,
     onLaunchApp: () -> Unit,
@@ -212,7 +215,9 @@ internal fun AppSettingsScreen(
     onResetApplyAppSettingsResult: () -> Unit,
     onResetRevertAppSettingsResult: () -> Unit,
     onResetAutoLaunchResult: () -> Unit,
-    onResetShortcutResult: () -> Unit,
+    onResetRequestPinShortcutResult: () -> Unit,
+    onResetUpdateRequestPinShortcutResult: () -> Unit,
+    onResetGetPinnedShortcutResult: () -> Unit,
     onResetSetPrimaryClipResult: () -> Unit,
     onGetSecureSettingsByName: (SettingType, String) -> Unit,
     onAddAppSetting: (AppSetting) -> Unit,
@@ -242,15 +247,18 @@ internal fun AppSettingsScreen(
         autoLaunchResult = autoLaunchResult,
         requestPinShortcutResult = requestPinShortcutResult,
         updateRequestPinShortcutResult = updateRequestPinShortcutResult,
+        getPinnedShortcutResult = getPinnedShortcutResult,
         setPrimaryClipResult = setPrimaryClipResult,
         onUpdatePackageName = onUpdatePackageName,
         onAutoLaunchApp = onAutoLaunchApp,
         onGetApplicationIcon = onGetApplicationIcon,
-        onGetShortcut = onGetShortcut,
+        onGetPinnedShortcut = onGetPinnedShortcut,
         onResetApplyAppSettingsResult = onResetApplyAppSettingsResult,
         onResetRevertAppSettingsResult = onResetRevertAppSettingsResult,
         onResetAutoLaunchResult = onResetAutoLaunchResult,
-        onResetShortcutResult = onResetShortcutResult,
+        onResetRequestPinShortcutResult = onResetRequestPinShortcutResult,
+        onResetUpdateRequestPinShortcutResult = onResetUpdateRequestPinShortcutResult,
+        onResetGetPinnedShortcutResult = onResetGetPinnedShortcutResult,
         onResetSetPrimaryClipResult = onResetSetPrimaryClipResult,
         onGetSecureSettingsByName = onGetSecureSettingsByName,
     )
@@ -280,15 +288,7 @@ internal fun AppSettingsScreen(
                 onSettingsIconClick = {
                     appSettingDialogState.updateShowDialog(true)
                 },
-                onShortcutIconClick = {
-                    if (mappedShortcutInfoCompat != null) {
-                        updateShortcutDialogState.updateShortLabel(mappedShortcutInfoCompat.shortLabel)
-                        updateShortcutDialogState.updateLongLabel(mappedShortcutInfoCompat.longLabel)
-                        updateShortcutDialogState.updateShowDialog(true)
-                    } else {
-                        addShortcutDialogState.updateShowDialog(true)
-                    }
-                },
+                onShortcutIconClick = onGetPinnedShortcut,
                 onLaunchApp = onLaunchApp,
             )
         },
@@ -342,15 +342,18 @@ private fun AppSettingsLaunchedEffects(
     autoLaunchResult: AutoLaunchResult?,
     requestPinShortcutResult: RequestPinShortcutResult?,
     updateRequestPinShortcutResult: UpdateRequestPinShortcutResult?,
+    getPinnedShortcutResult: GetPinnedShortcutResult?,
     setPrimaryClipResult: Boolean,
     onUpdatePackageName: () -> Unit,
     onAutoLaunchApp: () -> Unit,
     onGetApplicationIcon: () -> Unit,
-    onGetShortcut: () -> Unit,
+    onGetPinnedShortcut: () -> Unit,
     onResetApplyAppSettingsResult: () -> Unit,
     onResetRevertAppSettingsResult: () -> Unit,
     onResetAutoLaunchResult: () -> Unit,
-    onResetShortcutResult: () -> Unit,
+    onResetRequestPinShortcutResult: () -> Unit,
+    onResetUpdateRequestPinShortcutResult: () -> Unit,
+    onResetGetPinnedShortcutResult: () -> Unit,
     onResetSetPrimaryClipResult: () -> Unit,
     onGetSecureSettingsByName: (SettingType, String) -> Unit,
 ) {
@@ -375,7 +378,7 @@ private fun AppSettingsLaunchedEffects(
         onUpdatePackageName()
         onAutoLaunchApp()
         onGetApplicationIcon()
-        onGetShortcut()
+        onGetPinnedShortcut()
     }

     LaunchedEffect(key1 = applyAppSettingsResult) {
@@ -446,12 +449,12 @@ private fun AppSettingsLaunchedEffects(
             null -> Unit
         }

-        onResetShortcutResult()
+        onResetRequestPinShortcutResult()
     }

     LaunchedEffect(key1 = updateRequestPinShortcutResult) {
         when (updateRequestPinShortcutResult) {
-            UpdateRequestPinShortcutResult.Failed -> snackbarHostState.showSnackbar(
+            UpdateRequestPinShortcutResult.Failure -> snackbarHostState.showSnackbar(
                 message = shortcutUpdateFailed,
             )

@@ -470,7 +473,25 @@ private fun AppSettingsLaunchedEffects(
             null -> Unit
         }

-        onResetShortcutResult()
+        onResetUpdateRequestPinShortcutResult()
+    }
+
+    LaunchedEffect(key1 = getPinnedShortcutResult) {
+        when (getPinnedShortcutResult) {
+            GetPinnedShortcutResult.Failure -> {
+                addShortcutDialogState.updateShowDialog(true)
+            }
+
+            is GetPinnedShortcutResult.Success -> {
+                updateShortcutDialogState.updateShortLabel(getPinnedShortcutResult.mappedShortcutInfoCompat.shortLabel)
+                updateShortcutDialogState.updateLongLabel(getPinnedShortcutResult.mappedShortcutInfoCompat.longLabel)
+                updateShortcutDialogState.updateShowDialog(true)
+            }
+
+            null -> Unit
+        }
+
+        onResetGetPinnedShortcutResult()
     }

     LaunchedEffect(key1 = setPrimaryClipResult) {
@@ -806,7 +827,6 @@ private fun AppSettingsScreenLoadingStatePreview() {
             appSettingsUiState = AppSettingsUiState.Loading,
             snackbarHostState = SnackbarHostState(),
             applicationIcon = null,
-            mappedShortcutInfoCompat = null,
             secureSettings = emptyList(),
             permissionCommandText = "",
             applyAppSettingsResult = null,
@@ -814,10 +834,11 @@ private fun AppSettingsScreenLoadingStatePreview() {
             autoLaunchResult = AutoLaunchResult.Ignore,
             requestPinShortcutResult = null,
             updateRequestPinShortcutResult = null,
+            getPinnedShortcutResult = null,
             setPrimaryClipResult = false,
             onNavigationIconClick = {},
             onRevertAppSettings = {},
-            onGetShortcut = {},
+            onGetPinnedShortcut = {},
             onCheckAppSetting = { _, _ -> },
             onDeleteAppSetting = {},
             onLaunchApp = {},
@@ -827,7 +848,9 @@ private fun AppSettingsScreenLoadingStatePreview() {
             onResetApplyAppSettingsResult = {},
             onResetRevertAppSettingsResult = {},
             onResetAutoLaunchResult = {},
-            onResetShortcutResult = {},
+            onResetRequestPinShortcutResult = {},
+            onResetUpdateRequestPinShortcutResult = {},
+            onResetGetPinnedShortcutResult = {},
             onResetSetPrimaryClipResult = {},
             onGetSecureSettingsByName = { _, _ -> },
             onAddAppSetting = {},
@@ -848,7 +871,6 @@ private fun AppSettingsScreenEmptyStatePreview() {
             appSettingsUiState = AppSettingsUiState.Success(emptyList()),
             snackbarHostState = SnackbarHostState(),
             applicationIcon = null,
-            mappedShortcutInfoCompat = null,
             secureSettings = emptyList(),
             permissionCommandText = "",
             applyAppSettingsResult = null,
@@ -856,10 +878,11 @@ private fun AppSettingsScreenEmptyStatePreview() {
             autoLaunchResult = AutoLaunchResult.Ignore,
             requestPinShortcutResult = null,
             updateRequestPinShortcutResult = null,
+            getPinnedShortcutResult = null,
             setPrimaryClipResult = false,
             onNavigationIconClick = {},
             onRevertAppSettings = {},
-            onGetShortcut = {},
+            onGetPinnedShortcut = {},
             onCheckAppSetting = { _, _ -> },
             onDeleteAppSetting = {},
             onLaunchApp = {},
@@ -869,7 +892,9 @@ private fun AppSettingsScreenEmptyStatePreview() {
             onResetApplyAppSettingsResult = {},
             onResetRevertAppSettingsResult = {},
             onResetAutoLaunchResult = {},
-            onResetShortcutResult = {},
+            onResetRequestPinShortcutResult = {},
+            onResetUpdateRequestPinShortcutResult = {},
+            onResetGetPinnedShortcutResult = {},
             onResetSetPrimaryClipResult = {},
             onGetSecureSettingsByName = { _, _ -> },
             onAddAppSetting = {},
@@ -892,7 +917,6 @@ private fun AppSettingsScreenSuccessStatePreview(
             appSettingsUiState = AppSettingsUiState.Success(appSettings),
             snackbarHostState = SnackbarHostState(),
             applicationIcon = null,
-            mappedShortcutInfoCompat = null,
             secureSettings = emptyList(),
             permissionCommandText = "",
             applyAppSettingsResult = null,
@@ -900,10 +924,11 @@ private fun AppSettingsScreenSuccessStatePreview(
             autoLaunchResult = AutoLaunchResult.Ignore,
             requestPinShortcutResult = null,
             updateRequestPinShortcutResult = null,
+            getPinnedShortcutResult = null,
             setPrimaryClipResult = false,
             onNavigationIconClick = {},
             onRevertAppSettings = {},
-            onGetShortcut = {},
+            onGetPinnedShortcut = {},
             onCheckAppSetting = { _, _ -> },
             onDeleteAppSetting = {},
             onLaunchApp = {},
@@ -913,7 +938,9 @@ private fun AppSettingsScreenSuccessStatePreview(
             onResetApplyAppSettingsResult = {},
             onResetRevertAppSettingsResult = {},
             onResetAutoLaunchResult = {},
-            onResetShortcutResult = {},
+            onResetRequestPinShortcutResult = {},
+            onResetUpdateRequestPinShortcutResult = {},
+            onResetGetPinnedShortcutResult = {},
             onResetSetPrimaryClipResult = {},
             onGetSecureSettingsByName = { _, _ -> },
             onAddAppSetting = {},
diff --git a/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModel.kt b/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModel.kt
index 4883cd54f..e96393292 100644
--- a/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModel.kt
+++ b/feature/app-settings/src/main/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModel.kt
@@ -24,11 +24,12 @@ import com.android.geto.core.data.repository.AppSettingsRepository
 import com.android.geto.core.data.repository.ClipboardRepository
 import com.android.geto.core.data.repository.PackageRepository
 import com.android.geto.core.data.repository.SecureSettingsRepository
-import com.android.geto.core.data.repository.ShortcutRepository
 import com.android.geto.core.domain.ApplyAppSettingsResult
 import com.android.geto.core.domain.ApplyAppSettingsUseCase
 import com.android.geto.core.domain.AutoLaunchResult
 import com.android.geto.core.domain.AutoLaunchUseCase
+import com.android.geto.core.domain.GetPinnedShortcutResult
+import com.android.geto.core.domain.GetPinnedShortcutUseCase
 import com.android.geto.core.domain.RequestPinShortcutResult
 import com.android.geto.core.domain.RequestPinShortcutUseCase
 import com.android.geto.core.domain.RevertAppSettingsResult
@@ -58,12 +59,12 @@ class AppSettingsViewModel @Inject constructor(
     private val packageRepository: PackageRepository,
     private val clipboardRepository: ClipboardRepository,
     private val secureSettingsRepository: SecureSettingsRepository,
-    private val shortcutRepository: ShortcutRepository,
     private val applyAppSettingsUseCase: ApplyAppSettingsUseCase,
     private val revertAppSettingsUseCase: RevertAppSettingsUseCase,
     private val autoLaunchUseCase: AutoLaunchUseCase,
     private val requestPinShortcutUseCase: RequestPinShortcutUseCase,
     private val updateRequestPinShortcutUseCase: UpdateRequestPinShortcutUseCase,
+    private val getPinnedShortcutUseCase: GetPinnedShortcutUseCase,
 ) : ViewModel() {
     private var _packageName = MutableStateFlow<String?>(null)
     val packageName = _packageName.asStateFlow()
@@ -74,9 +75,6 @@ class AppSettingsViewModel @Inject constructor(
     private var _applicationIcon = MutableStateFlow<Drawable?>(null)
     val applicationIcon = _applicationIcon.asStateFlow()

-    private val _mappedShortcutInfoCompat = MutableStateFlow<MappedShortcutInfoCompat?>(null)
-    val mappedShortcutInfoCompat = _mappedShortcutInfoCompat.asStateFlow()
-
     private val _applyAppSettingsResult = MutableStateFlow<ApplyAppSettingsResult?>(null)
     val applyAppSettingsResult = _applyAppSettingsResult.asStateFlow()

@@ -96,6 +94,10 @@ class AppSettingsViewModel @Inject constructor(
         MutableStateFlow<UpdateRequestPinShortcutResult?>(null)
     val updateRequestPinShortcutResult = _updateRequestPinShortcutResult.asStateFlow()

+    private val _getPinnedShortcutResult =
+        MutableStateFlow<GetPinnedShortcutResult?>(null)
+    val getPinnedShortcutResult = _getPinnedShortcutResult.asStateFlow()
+
     private val permissionCommandLabel = "Command"

     val permissionCommandText = "pm grant com.android.geto android.permission.WRITE_SECURE_SETTINGS"
@@ -158,10 +160,10 @@ class AppSettingsViewModel @Inject constructor(
         }
     }

-    fun getShortcut(packageName: String) {
+    fun getPinnedShortcut(packageName: String) {
         viewModelScope.launch {
-            _mappedShortcutInfoCompat.update {
-                shortcutRepository.getPinnedShortcut(id = packageName)
+            _getPinnedShortcutResult.update {
+                getPinnedShortcutUseCase(id = packageName)
             }
         }
     }
@@ -236,11 +238,18 @@ class AppSettingsViewModel @Inject constructor(
         _autoLaunchResult.update { null }
     }

-    fun resetShortcutResult() {
+    fun resetRequestPinShortcutResult() {
         _requestPinShortcutResult.update { null }
+    }
+
+    fun resetUpdateRequestPinShortcutResult() {
         _updateRequestPinShortcutResult.update { null }
     }

+    fun resetGetPinnedShortcutResult() {
+        _getPinnedShortcutResult.update { null }
+    }
+
     fun resetSetPrimaryClipResult() {
         _setPrimaryClipResult.update { false }
     }

diff --git a/core/domain/src/test/kotlin/com/android/geto/core/domain/GetShortcutUseCaseTest.kt b/core/domain/src/test/kotlin/com/android/geto/core/domain/GetShortcutUseCaseTest.kt
new file mode 100644
index 000000000..0e325798b
--- /dev/null
+++ b/core/domain/src/test/kotlin/com/android/geto/core/domain/GetShortcutUseCaseTest.kt
@@ -0,0 +1,58 @@
+/*
+ *
+ *   Copyright 2023 Einstein Blanco
+ *
+ *   Licensed under the GNU General Public License v3.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       https://www.gnu.org/licenses/gpl-3.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.geto.core.domain
+
+import com.android.geto.core.model.MappedShortcutInfoCompat
+import com.android.geto.core.testing.repository.TestShortcutRepository
+import kotlinx.coroutines.test.runTest
+import org.junit.Before
+import org.junit.Test
+import kotlin.test.assertIs
+
+class GetShortcutUseCaseTest {
+    private lateinit var getPinnedShortcutUseCase: GetPinnedShortcutUseCase
+
+    private lateinit var shortcutRepository: TestShortcutRepository
+
+    private val shortcuts = List(10) {
+        MappedShortcutInfoCompat(
+            id = "com.android.geto",
+            shortLabel = "Geto",
+            longLabel = "Geto",
+        )
+    }
+
+    @Before
+    fun setUp() {
+        shortcutRepository = TestShortcutRepository()
+
+        getPinnedShortcutUseCase = GetPinnedShortcutUseCase(shortcutRepository = shortcutRepository)
+
+        shortcutRepository.setShortcuts(shortcuts)
+    }
+
+    @Test
+    fun getShortcutUseCase_isSuccess() = runTest {
+        assertIs<GetPinnedShortcutResult.Success>(getPinnedShortcutUseCase("com.android.geto"))
+    }
+
+    @Test
+    fun getShortcutUseCase_isFailure() = runTest {
+        assertIs<GetPinnedShortcutResult.Failure>(getPinnedShortcutUseCase(""))
+    }
+}
diff --git a/core/domain/src/test/kotlin/com/android/geto/core/domain/RequestPinShortcutUseCaseTest.kt b/core/domain/src/test/kotlin/com/android/geto/core/domain/RequestPinShortcutUseCaseTest.kt
index 05b4745de..2a3518f7d 100644
--- a/core/domain/src/test/kotlin/com/android/geto/core/domain/RequestPinShortcutUseCaseTest.kt
+++ b/core/domain/src/test/kotlin/com/android/geto/core/domain/RequestPinShortcutUseCaseTest.kt
@@ -39,7 +39,7 @@ class RequestPinShortcutUseCaseTest {
     }

     @Test
-    fun requestPinShortcutUseCase_isSupportedLauncher_whenRequestPinShortcut() = runTest {
+    fun requestPinShortcutUseCase_isSupportedLauncher() = runTest {
         shortcutRepository.setRequestPinShortcutSupported(true)

         assertIs<RequestPinShortcutResult.SupportedLauncher>(
@@ -56,7 +56,7 @@ class RequestPinShortcutUseCaseTest {
     }

     @Test
-    fun requestPinShortcutUseCase_isUnSupportedLauncher_whenRequestPinShortcut() = runTest {
+    fun requestPinShortcutUseCase_isUnSupportedLauncher() = runTest {
         shortcutRepository.setRequestPinShortcutSupported(false)

         assertIs<RequestPinShortcutResult.UnSupportedLauncher>(
diff --git a/core/domain/src/test/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCaseTest.kt b/core/domain/src/test/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCaseTest.kt
index 539994c81..47ae8ab40 100644
--- a/core/domain/src/test/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCaseTest.kt
+++ b/core/domain/src/test/kotlin/com/android/geto/core/domain/UpdateRequestPinShortcutUseCaseTest.kt
@@ -39,7 +39,7 @@ class UpdateRequestPinShortcutUseCaseTest {
     }

     @Test
-    fun updateRequestPinShortcutUseCase_isIDNotFound_whenUpdateRequestPinShortcut() = runTest {
+    fun updateRequestPinShortcutUseCase_isIDNotFound() = runTest {
         val shortcuts = List(2) {
             MappedShortcutInfoCompat(
                 id = "com.android.geto",
@@ -68,7 +68,7 @@ class UpdateRequestPinShortcutUseCaseTest {
     }

     @Test
-    fun updateRequestPinShortcutUseCase_isUpdateImmutableShortcuts_whenUpdateRequestPinShortcut() =
+    fun updateRequestPinShortcutUseCase_isUpdateImmutableShortcuts() =
         runTest {
             val shortcuts = List(2) {
                 MappedShortcutInfoCompat(
@@ -98,7 +98,7 @@ class UpdateRequestPinShortcutUseCaseTest {
         }

     @Test
-    fun updateRequestPinShortcutUseCase_isSuccess_whenUpdateRequestPinShortcut() = runTest {
+    fun updateRequestPinShortcutUseCase_isSuccess() = runTest {
         val shortcuts = List(2) {
             MappedShortcutInfoCompat(
                 id = "com.android.geto",
diff --git a/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenDialogsTest.kt b/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenDialogsTest.kt
index b5274e858..c80c64c94 100644
--- a/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenDialogsTest.kt
+++ b/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenDialogsTest.kt
@@ -36,6 +36,7 @@ import androidx.compose.ui.test.performClick
 import androidx.compose.ui.test.performTextInput
 import com.android.geto.core.domain.ApplyAppSettingsResult
 import com.android.geto.core.domain.AutoLaunchResult
+import com.android.geto.core.domain.GetPinnedShortcutResult
 import com.android.geto.core.domain.RevertAppSettingsResult
 import com.android.geto.core.model.MappedShortcutInfoCompat
 import org.junit.Rule
@@ -54,7 +55,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -62,10 +62,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -75,7 +76,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -107,7 +110,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = ApplyAppSettingsResult.SecurityException,
@@ -115,10 +117,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -128,7 +131,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -156,7 +161,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -164,10 +168,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -177,7 +182,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -205,7 +212,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -213,10 +219,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = AutoLaunchResult.SecurityException,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -226,7 +233,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -246,7 +255,7 @@ class AppSettingsScreenDialogsTest {
     }

     @Test
-    fun addShortcutDialog_isDisplayed_whenMappedShortcutInfoCompat_isNull_thenDismissed() {
+    fun addShortcutDialog_isDisplayed_whenGetPinnedShortcutResult_isFailure_thenDismissed() {
         composeTestRule.setContent {
             AppSettingsScreen(
                 packageName = "com.android.geto",
@@ -254,7 +263,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -262,10 +270,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = GetPinnedShortcutResult.Failure,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -275,7 +284,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -298,7 +309,7 @@ class AppSettingsScreenDialogsTest {
     }

     @Test
-    fun updateShortcutDialog_isDisplayed_whenMappedShortcutInfoCompat_isNotNull_thenDismissed() {
+    fun updateShortcutDialog_isDisplayed_whenGetPinnedShortcutResult_isSuccess_thenDismissed() {
         composeTestRule.setContent {
             AppSettingsScreen(
                 packageName = "com.android.geto",
@@ -306,11 +317,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = MappedShortcutInfoCompat(
-                    id = "0",
-                    shortLabel = "Geto",
-                    longLabel = "Geto",
-                ),
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -318,10 +324,17 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = GetPinnedShortcutResult.Success(
+                    MappedShortcutInfoCompat(
+                        id = "com.android.geto",
+                        shortLabel = "Geto",
+                        longLabel = "Geto",
+                    ),
+                ),
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -331,7 +344,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -365,7 +380,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -373,10 +387,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -386,7 +401,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -465,7 +482,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -473,10 +489,11 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = GetPinnedShortcutResult.Failure,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -486,7 +503,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -538,11 +557,6 @@ class AppSettingsScreenDialogsTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = MappedShortcutInfoCompat(
-                    id = "0",
-                    shortLabel = "Geto",
-                    longLabel = "Geto",
-                ),
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -550,10 +564,17 @@ class AppSettingsScreenDialogsTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = GetPinnedShortcutResult.Success(
+                    MappedShortcutInfoCompat(
+                        id = "com.android.geto",
+                        shortLabel = "Geto",
+                        longLabel = "Geto",
+                    ),
+                ),
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -563,7 +584,9 @@ class AppSettingsScreenDialogsTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
diff --git a/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarTest.kt b/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarTest.kt
index bd19797d0..b0042eaf3 100644
--- a/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarTest.kt
+++ b/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarTest.kt
@@ -41,7 +41,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = ApplyAppSettingsResult.DisabledAppSettings,
@@ -49,10 +48,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -62,7 +62,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -84,7 +86,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = ApplyAppSettingsResult.EmptyAppSettings,
@@ -92,10 +93,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -105,7 +107,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -127,7 +131,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = ApplyAppSettingsResult.Failure,
@@ -135,10 +138,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -148,7 +152,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -170,7 +176,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = ApplyAppSettingsResult.IllegalArgumentException,
@@ -178,10 +183,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -191,7 +197,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -213,7 +221,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -221,10 +228,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -234,7 +242,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -256,7 +266,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -264,10 +273,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -277,7 +287,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -299,7 +311,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -307,10 +318,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -320,7 +332,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -342,7 +356,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -350,10 +363,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -363,7 +377,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -385,7 +401,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -393,10 +408,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = RequestPinShortcutResult.SupportedLauncher,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -406,7 +422,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -428,7 +446,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -436,10 +453,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = RequestPinShortcutResult.UnSupportedLauncher,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -449,7 +467,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -463,7 +483,7 @@ class AppSettingsScreenSnackbarTest {
     }

     @Test
-    fun snackbar_isShown_whenUpdateRequestPinShortcutResult_isUnSupportedLauncher() {
+    fun snackbar_isShown_whenUpdateRequestPinShortcutResult_isFailure() {
         composeTestRule.setContent {
             AppSettingsScreen(
                 packageName = "com.android.geto",
@@ -471,18 +491,18 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
                 revertAppSettingsResult = null,
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
-                updateRequestPinShortcutResult = UpdateRequestPinShortcutResult.Failed,
+                updateRequestPinShortcutResult = UpdateRequestPinShortcutResult.Failure,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -492,7 +512,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -514,7 +536,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -522,10 +543,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = UpdateRequestPinShortcutResult.IDNotFound,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -535,7 +557,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -557,7 +581,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -565,10 +588,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = UpdateRequestPinShortcutResult.Success,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -578,7 +602,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -600,7 +626,6 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -608,10 +633,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = UpdateRequestPinShortcutResult.UpdateImmutableShortcuts,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -621,7 +647,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -643,7 +671,7 @@ class AppSettingsScreenSnackbarTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
+
                 secureSettings = emptyList(),
                 permissionCommandText = "permission command text",
                 applyAppSettingsResult = null,
@@ -651,10 +679,11 @@ class AppSettingsScreenSnackbarTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = true,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -664,7 +693,9 @@ class AppSettingsScreenSnackbarTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
diff --git a/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenTest.kt b/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenTest.kt
index f32b136e5..a62635160 100644
--- a/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenTest.kt
+++ b/feature/app-settings/src/androidTest/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenTest.kt
@@ -54,7 +54,6 @@ class AppSettingsScreenTest {
                 appSettingsUiState = AppSettingsUiState.Loading,
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -62,10 +61,11 @@ class AppSettingsScreenTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -75,7 +75,9 @@ class AppSettingsScreenTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -97,7 +99,6 @@ class AppSettingsScreenTest {
                 appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -105,10 +106,11 @@ class AppSettingsScreenTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -118,7 +120,9 @@ class AppSettingsScreenTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
@@ -140,7 +144,6 @@ class AppSettingsScreenTest {
                 appSettingsUiState = AppSettingsUiState.Success(appSettings),
                 snackbarHostState = SnackbarHostState(),
                 applicationIcon = null,
-                mappedShortcutInfoCompat = null,
                 secureSettings = emptyList(),
                 permissionCommandText = "",
                 applyAppSettingsResult = null,
@@ -148,10 +151,11 @@ class AppSettingsScreenTest {
                 autoLaunchResult = null,
                 requestPinShortcutResult = null,
                 updateRequestPinShortcutResult = null,
+                getPinnedShortcutResult = null,
                 setPrimaryClipResult = false,
                 onNavigationIconClick = {},
                 onRevertAppSettings = {},
-                onGetShortcut = {},
+                onGetPinnedShortcut = {},
                 onCheckAppSetting = { _, _ -> },
                 onDeleteAppSetting = {},
                 onLaunchApp = {},
@@ -161,7 +165,9 @@ class AppSettingsScreenTest {
                 onResetApplyAppSettingsResult = {},
                 onResetRevertAppSettingsResult = {},
                 onResetAutoLaunchResult = {},
-                onResetShortcutResult = {},
+                onResetRequestPinShortcutResult = {},
+                onResetUpdateRequestPinShortcutResult = {},
+                onResetGetPinnedShortcutResult = {},
                 onResetSetPrimaryClipResult = {},
                 onGetSecureSettingsByName = { _, _ -> },
                 onAddAppSetting = {},
diff --git a/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenScreenshotTest.kt b/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenScreenshotTest.kt
index 667e00df0..d79539ff6 100644
--- a/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenScreenshotTest.kt
+++ b/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenScreenshotTest.kt
@@ -68,7 +68,6 @@ class AppSettingsScreenScreenshotTest {
                     appSettingsUiState = AppSettingsUiState.Success(appSettings),
                     snackbarHostState = SnackbarHostState(),
                     applicationIcon = null,
-                    mappedShortcutInfoCompat = null,
                     secureSettings = emptyList(),
                     permissionCommandText = "",
                     applyAppSettingsResult = null,
@@ -76,10 +75,11 @@ class AppSettingsScreenScreenshotTest {
                     autoLaunchResult = null,
                     requestPinShortcutResult = null,
                     updateRequestPinShortcutResult = null,
+                    getPinnedShortcutResult = null,
                     setPrimaryClipResult = false,
                     onNavigationIconClick = {},
                     onRevertAppSettings = {},
-                    onGetShortcut = {},
+                    onGetPinnedShortcut = {},
                     onCheckAppSetting = { _, _ -> },
                     onDeleteAppSetting = {},
                     onLaunchApp = {},
@@ -89,7 +89,9 @@ class AppSettingsScreenScreenshotTest {
                     onResetApplyAppSettingsResult = {},
                     onResetRevertAppSettingsResult = {},
                     onResetAutoLaunchResult = {},
-                    onResetShortcutResult = {},
+                    onResetRequestPinShortcutResult = {},
+                    onResetUpdateRequestPinShortcutResult = {},
+                    onResetGetPinnedShortcutResult = {},
                     onResetSetPrimaryClipResult = {},
                     onGetSecureSettingsByName = { _, _ -> },
                     onAddAppSetting = {},
@@ -111,7 +113,6 @@ class AppSettingsScreenScreenshotTest {
                     appSettingsUiState = AppSettingsUiState.Loading,
                     snackbarHostState = SnackbarHostState(),
                     applicationIcon = null,
-                    mappedShortcutInfoCompat = null,
                     secureSettings = emptyList(),
                     permissionCommandText = "",
                     applyAppSettingsResult = null,
@@ -119,10 +120,11 @@ class AppSettingsScreenScreenshotTest {
                     autoLaunchResult = null,
                     requestPinShortcutResult = null,
                     updateRequestPinShortcutResult = null,
+                    getPinnedShortcutResult = null,
                     setPrimaryClipResult = false,
                     onNavigationIconClick = {},
                     onRevertAppSettings = {},
-                    onGetShortcut = {},
+                    onGetPinnedShortcut = {},
                     onCheckAppSetting = { _, _ -> },
                     onDeleteAppSetting = {},
                     onLaunchApp = {},
@@ -132,7 +134,9 @@ class AppSettingsScreenScreenshotTest {
                     onResetApplyAppSettingsResult = {},
                     onResetRevertAppSettingsResult = {},
                     onResetAutoLaunchResult = {},
-                    onResetShortcutResult = {},
+                    onResetRequestPinShortcutResult = {},
+                    onResetUpdateRequestPinShortcutResult = {},
+                    onResetGetPinnedShortcutResult = {},
                     onResetSetPrimaryClipResult = {},
                     onGetSecureSettingsByName = { _, _ -> },
                     onAddAppSetting = {},
@@ -154,7 +158,6 @@ class AppSettingsScreenScreenshotTest {
                     appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                     snackbarHostState = SnackbarHostState(),
                     applicationIcon = null,
-                    mappedShortcutInfoCompat = null,
                     secureSettings = emptyList(),
                     permissionCommandText = "",
                     applyAppSettingsResult = null,
@@ -162,10 +165,11 @@ class AppSettingsScreenScreenshotTest {
                     autoLaunchResult = null,
                     requestPinShortcutResult = null,
                     updateRequestPinShortcutResult = null,
+                    getPinnedShortcutResult = null,
                     setPrimaryClipResult = false,
                     onNavigationIconClick = {},
                     onRevertAppSettings = {},
-                    onGetShortcut = {},
+                    onGetPinnedShortcut = {},
                     onCheckAppSetting = { _, _ -> },
                     onDeleteAppSetting = {},
                     onLaunchApp = {},
@@ -175,7 +179,9 @@ class AppSettingsScreenScreenshotTest {
                     onResetApplyAppSettingsResult = {},
                     onResetRevertAppSettingsResult = {},
                     onResetAutoLaunchResult = {},
-                    onResetShortcutResult = {},
+                    onResetRequestPinShortcutResult = {},
+                    onResetUpdateRequestPinShortcutResult = {},
+                    onResetGetPinnedShortcutResult = {},
                     onResetSetPrimaryClipResult = {},
                     onGetSecureSettingsByName = { _, _ -> },
                     onAddAppSetting = {},
@@ -203,7 +209,6 @@ class AppSettingsScreenScreenshotTest {
                         appSettingsUiState = AppSettingsUiState.Success(appSettings),
                         snackbarHostState = SnackbarHostState(),
                         applicationIcon = null,
-                        mappedShortcutInfoCompat = null,
                         secureSettings = emptyList(),
                         permissionCommandText = "",
                         applyAppSettingsResult = null,
@@ -211,10 +216,11 @@ class AppSettingsScreenScreenshotTest {
                         autoLaunchResult = null,
                         requestPinShortcutResult = null,
                         updateRequestPinShortcutResult = null,
+                        getPinnedShortcutResult = null,
                         setPrimaryClipResult = false,
                         onNavigationIconClick = {},
                         onRevertAppSettings = {},
-                        onGetShortcut = {},
+                        onGetPinnedShortcut = {},
                         onCheckAppSetting = { _, _ -> },
                         onDeleteAppSetting = {},
                         onLaunchApp = {},
@@ -224,7 +230,9 @@ class AppSettingsScreenScreenshotTest {
                         onResetApplyAppSettingsResult = {},
                         onResetRevertAppSettingsResult = {},
                         onResetAutoLaunchResult = {},
-                        onResetShortcutResult = {},
+                        onResetRequestPinShortcutResult = {},
+                        onResetUpdateRequestPinShortcutResult = {},
+                        onResetGetPinnedShortcutResult = {},
                         onResetSetPrimaryClipResult = {},
                         onGetSecureSettingsByName = { _, _ -> },
                         onAddAppSetting = {},
@@ -253,7 +261,6 @@ class AppSettingsScreenScreenshotTest {
                         appSettingsUiState = AppSettingsUiState.Loading,
                         snackbarHostState = SnackbarHostState(),
                         applicationIcon = null,
-                        mappedShortcutInfoCompat = null,
                         secureSettings = emptyList(),
                         permissionCommandText = "",
                         applyAppSettingsResult = null,
@@ -261,10 +268,11 @@ class AppSettingsScreenScreenshotTest {
                         autoLaunchResult = null,
                         requestPinShortcutResult = null,
                         updateRequestPinShortcutResult = null,
+                        getPinnedShortcutResult = null,
                         setPrimaryClipResult = false,
                         onNavigationIconClick = {},
                         onRevertAppSettings = {},
-                        onGetShortcut = {},
+                        onGetPinnedShortcut = {},
                         onCheckAppSetting = { _, _ -> },
                         onDeleteAppSetting = {},
                         onLaunchApp = {},
@@ -274,7 +282,9 @@ class AppSettingsScreenScreenshotTest {
                         onResetApplyAppSettingsResult = {},
                         onResetRevertAppSettingsResult = {},
                         onResetAutoLaunchResult = {},
-                        onResetShortcutResult = {},
+                        onResetRequestPinShortcutResult = {},
+                        onResetUpdateRequestPinShortcutResult = {},
+                        onResetGetPinnedShortcutResult = {},
                         onResetSetPrimaryClipResult = {},
                         onGetSecureSettingsByName = { _, _ -> },
                         onAddAppSetting = {},
@@ -303,7 +313,6 @@ class AppSettingsScreenScreenshotTest {
                         appSettingsUiState = AppSettingsUiState.Success(emptyList()),
                         snackbarHostState = SnackbarHostState(),
                         applicationIcon = null,
-                        mappedShortcutInfoCompat = null,
                         secureSettings = emptyList(),
                         permissionCommandText = "",
                         applyAppSettingsResult = null,
@@ -311,10 +320,11 @@ class AppSettingsScreenScreenshotTest {
                         autoLaunchResult = null,
                         requestPinShortcutResult = null,
                         updateRequestPinShortcutResult = null,
+                        getPinnedShortcutResult = null,
                         setPrimaryClipResult = false,
                         onNavigationIconClick = {},
                         onRevertAppSettings = {},
-                        onGetShortcut = {},
+                        onGetPinnedShortcut = {},
                         onCheckAppSetting = { _, _ -> },
                         onDeleteAppSetting = {},
                         onLaunchApp = {},
@@ -324,7 +334,9 @@ class AppSettingsScreenScreenshotTest {
                         onResetApplyAppSettingsResult = {},
                         onResetRevertAppSettingsResult = {},
                         onResetAutoLaunchResult = {},
-                        onResetShortcutResult = {},
+                        onResetRequestPinShortcutResult = {},
+                        onResetUpdateRequestPinShortcutResult = {},
+                        onResetGetPinnedShortcutResult = {},
                         onResetSetPrimaryClipResult = {},
                         onGetSecureSettingsByName = { _, _ -> },
                         onAddAppSetting = {},
diff --git a/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarScreenshotTest.kt b/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarScreenshotTest.kt
index b8681d518..b48fb2498 100644
--- a/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarScreenshotTest.kt
+++ b/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsScreenSnackbarScreenshotTest.kt
@@ -77,7 +77,6 @@ class AppSettingsScreenSnackbarScreenshotTest {
                     appSettingsUiState = AppSettingsUiState.Success(appSettings),
                     snackbarHostState = snackbarHostState,
                     applicationIcon = null,
-                    mappedShortcutInfoCompat = null,
                     secureSettings = emptyList(),
                     permissionCommandText = "",
                     applyAppSettingsResult = null,
@@ -85,10 +84,11 @@ class AppSettingsScreenSnackbarScreenshotTest {
                     autoLaunchResult = null,
                     requestPinShortcutResult = null,
                     updateRequestPinShortcutResult = null,
+                    getPinnedShortcutResult = null,
                     setPrimaryClipResult = false,
                     onNavigationIconClick = {},
                     onRevertAppSettings = {},
-                    onGetShortcut = {},
+                    onGetPinnedShortcut = {},
                     onCheckAppSetting = { _, _ -> },
                     onDeleteAppSetting = {},
                     onLaunchApp = {},
@@ -98,7 +98,9 @@ class AppSettingsScreenSnackbarScreenshotTest {
                     onResetApplyAppSettingsResult = {},
                     onResetRevertAppSettingsResult = {},
                     onResetAutoLaunchResult = {},
-                    onResetShortcutResult = {},
+                    onResetRequestPinShortcutResult = {},
+                    onResetUpdateRequestPinShortcutResult = {},
+                    onResetGetPinnedShortcutResult = {},
                     onResetSetPrimaryClipResult = {},
                     onGetSecureSettingsByName = { _, _ -> },
                     onAddAppSetting = {},
diff --git a/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModelTest.kt b/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModelTest.kt
index c64c7e821..088bbd4d6 100644
--- a/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModelTest.kt
+++ b/feature/app-settings/src/test/kotlin/com/android/geto/feature/appsettings/AppSettingsViewModelTest.kt
@@ -20,6 +20,8 @@ package com.android.geto.feature.appsettings
 import com.android.geto.core.domain.ApplyAppSettingsResult
 import com.android.geto.core.domain.ApplyAppSettingsUseCase
 import com.android.geto.core.domain.AutoLaunchUseCase
+import com.android.geto.core.domain.GetPinnedShortcutResult
+import com.android.geto.core.domain.GetPinnedShortcutUseCase
 import com.android.geto.core.domain.RequestPinShortcutResult
 import com.android.geto.core.domain.RequestPinShortcutUseCase
 import com.android.geto.core.domain.RevertAppSettingsResult
@@ -80,6 +82,8 @@ class AppSettingsViewModelTest {

     private lateinit var updateRequestPinShortcutUseCase: UpdateRequestPinShortcutUseCase

+    private lateinit var getPinnedShortcutUseCase: GetPinnedShortcutUseCase
+
     private lateinit var viewModel: AppSettingsViewModel

     private val packageName = "com.android.geto"
@@ -125,17 +129,19 @@ class AppSettingsViewModelTest {
         updateRequestPinShortcutUseCase =
             UpdateRequestPinShortcutUseCase(shortcutRepository = shortcutRepository)

+        getPinnedShortcutUseCase = GetPinnedShortcutUseCase(shortcutRepository = shortcutRepository)
+
         viewModel = AppSettingsViewModel(
             appSettingsRepository = appSettingsRepository,
             packageRepository = packageRepository,
             clipboardRepository = clipboardRepository,
             secureSettingsRepository = secureSettingsRepository,
-            shortcutRepository = shortcutRepository,
             applyAppSettingsUseCase = applyAppSettingsUseCase,
             revertAppSettingsUseCase = revertAppSettingsUseCase,
             autoLaunchUseCase = autoLaunchUseCase,
             requestPinShortcutUseCase = requestPinShortcutUseCase,
             updateRequestPinShortcutUseCase = updateRequestPinShortcutUseCase,
+            getPinnedShortcutUseCase = getPinnedShortcutUseCase,
         )
     }

@@ -185,8 +191,8 @@ class AppSettingsViewModelTest {
     }

     @Test
-    fun mappedShortcutInfoCompat_isNull_whenStarted() {
-        assertNull(viewModel.mappedShortcutInfoCompat.value)
+    fun getPinnedShortcutResult_isNull_whenStarted() {
+        assertNull(viewModel.getPinnedShortcutResult.value)
     }

     @Test
@@ -694,7 +700,7 @@ class AppSettingsViewModelTest {
     }

     @Test
-    fun mappedShortcutInfoCompat_isNotNull_whenGetShortcut() = runTest {
+    fun getPinnedShortcutResult_isSuccess_whenGetShortcut() = runTest {
         val shortcuts = List(2) {
             MappedShortcutInfoCompat(
                 id = "com.android.geto",
@@ -705,13 +711,13 @@ class AppSettingsViewModelTest {

         shortcutRepository.setShortcuts(shortcuts)

-        viewModel.getShortcut(packageName = packageName)
+        viewModel.getPinnedShortcut(packageName = packageName)

-        assertNotNull(viewModel.mappedShortcutInfoCompat.value)
+        assertIs<GetPinnedShortcutResult.Success>(viewModel.getPinnedShortcutResult.value)
     }

     @Test
-    fun mappedShortcutInfoCompat_isNull_whenGetShortcut() = runTest {
+    fun getPinnedShortcutResult_isFailure_whenGetShortcut() = runTest {
         val shortcuts = List(2) {
             MappedShortcutInfoCompat(
                 id = "com.android.geto",
@@ -722,9 +728,9 @@ class AppSettingsViewModelTest {

         shortcutRepository.setShortcuts(shortcuts)

-        viewModel.getShortcut("")
+        viewModel.getPinnedShortcut("")

-        assertNull(viewModel.mappedShortcutInfoCompat.value)
+        assertIs<GetPinnedShortcutResult.Failure>(viewModel.getPinnedShortcutResult.value)
     }

     @Test


Make sup/subscript more strict

Fixes #1628

Markdown rending subtext

Markdown rending subtext
### Jerboa Version

0.0.71

### Android Version + Phone

N/a

### Describe The Bug

![image](https://github.com/user-attachments/assets/aeaf4604-ecf5-4d67-b5b9-d1064359c7e7)

![image](https://github.com/user-attachments/assets/0b185986-5cb5-4299-bdea-2435197ea0ef)

This should not be formatted as subtext. But it is following the current spec in Jerboa. Which is any text between a tilde that is uninterrupted by a linebreak becomes subscript.

There doesn't seem to be a commonmark spec to follow?

What does Lemmy UI do?

### To Reproduce

- this text

```
Been driving an EV for 6 years now. Tesla model X (range ~ 260kms) first, now a model Y LR (range ~ 480kms)
```

### In the case of a crash or when relevant include the logs

_No response_

Part of that `ScriptRewriteSupportPlugin`. We need to look at how other markwon projects are adding super / subscript support.

[Here's a sample](https://github.com/noties/Markwon/blob/master/app-sample/src/main/java/io/noties/markwon/app/samples/parser/RedditSuperscriptSample.kt)
We just need a better definition. I don't if lemmy follows an exact spec for sup/subscript. Noties follows the \<sub> syntax which is the most popular way.
Here's everything we try to support: https://join-lemmy.org/docs/users/02-media.html?highlight=markdown#text

I think we're following reddits style of super / subscript.
I can make the subscript definition more strict to prevent the above example for being picked up. By not allowing whitespace.

The definition becomes:

Any text between a tilde that is not interrupted by a linebreak where the starting or ending text can't be a whitespace character.

According to this https://www.markdownguide.org/tools/reddit/

reddit does not support subscript. Lots of markdown implementations use \~text\~ instead for strikethrough like Github.

./gradlew :app:testDebugUnitTest --tests "com.jerboa.util.markwon.ScriptRewriteSupportPluginTest"

diff --git a/app/src/main/java/com/jerboa/util/markwon/ScriptRewriteSupportPlugin.kt b/app/src/main/java/com/jerboa/util/markwon/ScriptRewriteSupportPlugin.kt
index 49a00dab4..9862a46a6 100644
--- a/app/src/main/java/com/jerboa/util/markwon/ScriptRewriteSupportPlugin.kt
+++ b/app/src/main/java/com/jerboa/util/markwon/ScriptRewriteSupportPlugin.kt
@@ -13,8 +13,20 @@ class ScriptRewriteSupportPlugin : AbstractMarkwonPlugin() {
         )

     companion object {
-        val SUPERSCRIPT_RGX = Regex("""\^([^\n^]+)\^""")
-        val SUBSCRIPT_RGX = Regex("""(?<!~)~([^\n~]+)~""")
+        /*
+         * Superscript has the definition:
+         * Any text between a '^' that is not interrupted by a linebreak where the starting
+         * or ending text can't be a whitespace character.
+         */
+        val SUPERSCRIPT_RGX = Regex("""\^(?!\s)([^\n^]+)(?<!\s)\^""")
+
+        /*
+         * Subscript has the definition:
+         * Any text between a tilde that is not interrupted by a linebreak where the starting
+         * or ending text can't be a whitespace character. And where the starting the tilde is not prefixed
+         * by another tilde. (To prevent matching with strikethrough)
+         */
+        val SUBSCRIPT_RGX = Regex("""(?<!~)~(?!\s)([^\n~]+)(?<!\s)~""")

         fun rewriteLemmyScriptToMarkwonScript(text: String): String =
             text

diff --git a/app/src/test/java/com/jerboa/util/markwon/ScriptRewriteSupportPluginTest.kt b/app/src/test/java/com/jerboa/util/markwon/ScriptRewriteSupportPluginTest.kt
index 0164bacf4..eebd3639a 100644
--- a/app/src/test/java/com/jerboa/util/markwon/ScriptRewriteSupportPluginTest.kt
+++ b/app/src/test/java/com/jerboa/util/markwon/ScriptRewriteSupportPluginTest.kt
@@ -39,5 +39,22 @@ class ScriptRewriteSupportPluginTest {
             listOf("~~text~~", "~~text~~"),
             // Intended to fail, else it will increase the complexity of the regex by a huge margin
             listOf("~~text~", "~~text~"),
+            listOf("~text~~", "text~"),
+            listOf(
+                "Tesla model X (range ~ 260kms) first, now a model Y LR (range ~ 480kms)",
+                "Tesla model X (range ~ 260kms) first, now a model Y LR (range ~ 480kms)",
+            ),
+            listOf("~ 5 ~ 6 ~", "~ 5 ~ 6 ~"),
+            listOf("^ ^", "^ ^"),
+            listOf("^", "^"),
+            listOf("~", "~"),
+            listOf("~~", "~~"),
+            listOf("~~~", "~~~"),
+            listOf("^ 99 ^", "^ 99 ^"),
+            listOf("^ 99^", "^ 99^"),
+            listOf("^99 ^", "^99 ^"),
+            listOf("~ 99 ~", "~ 99 ~"),
+            listOf("~ 99~", "~ 99~"),
+            listOf("~99 ~", "~99 ~"),
         )
 }