diff --git a/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt b/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt index feb77fbd..a2643ac5 100644 --- a/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt +++ b/applications/src/main/java/de/mm20/launcher2/search/data/AppSerialization.kt @@ -32,7 +32,7 @@ class LauncherAppDeserializer(val context: Context) : SearchableDeserializer { val launcherApps = context.getSystemService()!! val userManager = context.getSystemService()!! val userSerial = json.optLong("user") - val user = userManager.getUserForSerialNumber(userSerial) ?: Process.myUserHandle() + val user = userManager.getUserForSerialNumber(userSerial) ?: return null val pkg = json.getString("package") val intent = Intent().also { it.component = ComponentName(pkg, json.getString("activity")) diff --git a/appshortcuts/src/main/java/de/mm20/launcher2/appshortcuts/AppShortcutSerialization.kt b/appshortcuts/src/main/java/de/mm20/launcher2/appshortcuts/AppShortcutSerialization.kt index 7b118101..5a516dd1 100644 --- a/appshortcuts/src/main/java/de/mm20/launcher2/appshortcuts/AppShortcutSerialization.kt +++ b/appshortcuts/src/main/java/de/mm20/launcher2/appshortcuts/AppShortcutSerialization.kt @@ -55,7 +55,7 @@ class LauncherShortcutDeserializer( ) query.setShortcutIds(mutableListOf(id)) val userManager = context.getSystemService()!! - val user = userManager.getUserForSerialNumber(userSerial) ?: Process.myUserHandle() + val user = userManager.getUserForSerialNumber(userSerial) ?: return null val shortcuts = try { launcherApps.getShortcuts(query, user) } catch (e: IllegalStateException) {