LawnchairLauncher / lawnchair

No clever tagline needed.
https://lawnchair.app
Other
9.52k stars 1.23k forks source link

[BUG] App crashes when trying to change the icon on secondary profile on multiple devices #4105

Open TXort opened 9 months ago

TXort commented 9 months ago

Describe the bug

Problem: When trying to change the icon in a user profile, the app crashes.

Most GrapheneOS users use secondary profiles as a security and privacy feature, so they are the ones that are most affected by this bug, but it also appears on the other phones when using secondary profile. Tested on multiple phones with latest 12.1 alpha 4 version and Goooler's 14 version.

This issue was mentioned also here: https://github.com/LawnchairLauncher/lawnchair/issues/2914 https://github.com/LawnchairLauncher/lawnchair/issues/2464

But both are closed as stale.

Steps to reproduce

  1. Create a user profile and install Lawnchair on it
  2. Try to change any app icon manually

Expected behavior

Allow changing the icon

Screenshots

No response

Device information

Pixel with GrapheneOS and Samsung with LineageOS. Version 12.1 and 14 of the app.

Additional context

No response

MrSluffy commented 8 months ago

use latest lawnchair 14

TXort commented 8 months ago

No, the issue is still present, it's not fixed in the latest version... I can post logs here, but it is present on both phones again, with the latest version...

TXort commented 8 months ago

type: crash osVersion: google/shiba/shiba:14/AP1A.240305.019.A1/2024032100:user/release-keys package: app.lawnchair.debug:14 process: app.lawnchair.debug processUptime: 4342 + 51 ms installer: com.android.packageinstaller

java.lang.SecurityException: Cannot resolve activity for unrelated profile 0 at android.os.Parcel.createExceptionOrNull(Parcel.java:3191) at android.os.Parcel.createException(Parcel.java:3175) at android.os.Parcel.readException(Parcel.java:3151) at android.os.Parcel.readException(Parcel.java:3093) at android.content.pm.ILauncherApps$Stub$Proxy.resolveLauncherActivityInternal(ILauncherApps.java:969) at android.content.pm.LauncherApps.resolveActivity(LauncherApps.java:885) at app.lawnchair.ui.preferences.destinations.SelectIconPreferenceKt.SelectIconPreference(SelectIconPreference.kt:58) at app.lawnchair.ui.preferences.destinations.ComposableSingletons$SelectIconPreferenceKt$lambda-1$1.invoke(SelectIconPreference.kt:47) at app.lawnchair.ui.preferences.destinations.ComposableSingletons$SelectIconPreferenceKt$lambda-1$1.invoke(SelectIconPreference.kt:42) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.navigation.compose.NavHostKt$NavHost$14$1.invoke(NavHost.kt:308) at androidx.navigation.compose.NavHostKt$NavHost$14$1.invoke(NavHost.kt:306) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:250) at androidx.compose.runtime.saveable.SaveableStateHolderImpl.SaveableStateProvider(SaveableStateHolder.kt:84) at androidx.navigation.compose.NavBackStackEntryProviderKt.SaveableStateProvider(NavBackStackEntryProvider.kt:65) at androidx.navigation.compose.NavBackStackEntryProviderKt.access$SaveableStateProvider(NavBackStackEntryProvider.kt:1) at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:52) at androidx.navigation.compose.NavBackStackEntryProviderKt$LocalOwnersProvider$1.invoke(NavBackStackEntryProvider.kt:51) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:229) at androidx.navigation.compose.NavBackStackEntryProviderKt.LocalOwnersProvider(NavBackStackEntryProvider.kt:47) at androidx.navigation.compose.NavHostKt$NavHost$14.invoke(NavHost.kt:306) at androidx.navigation.compose.NavHostKt$NavHost$14.invoke(NavHost.kt:295) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1$5.invoke(AnimatedContent.kt:755) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1$5.invoke(AnimatedContent.kt:744) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.animation.AnimatedVisibilityKt.AnimatedEnterExitImpl(AnimatedVisibility.kt:819) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1.invoke(AnimatedContent.kt:726) at androidx.compose.animation.AnimatedContentKt$AnimatedContent$6$1.invoke(AnimatedContent.kt:709) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.animation.AnimatedContentKt.AnimatedContent(AnimatedContent.kt:768) at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:273) at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:128) at app.lawnchair.ui.preferences.PreferencesKt$Preferences$1$1$1.invoke(Preferences.kt:107) at app.lawnchair.ui.preferences.PreferencesKt$Preferences$1$1$1.invoke(Preferences.kt:106) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:229) at app.lawnchair.ui.preferences.PreferencesKt$Preferences$1$1.invoke(Preferences.kt:103) at app.lawnchair.ui.preferences.PreferencesKt$Preferences$1$1.invoke(Preferences.kt:102) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:133) at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:114) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:229) at androidx.compose.material3.SurfaceKt.Surface-T9BRK9s(Surface.kt:111) at app.lawnchair.ui.preferences.PreferencesKt$Preferences$1.invoke(Preferences.kt:102) at app.lawnchair.ui.preferences.PreferencesKt$Preferences$1.invoke(Preferences.kt:101) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at app.lawnchair.ui.preferences.PreferencesKt$Providers$1$1$1.invoke(Preferences.kt:151) at app.lawnchair.ui.preferences.PreferencesKt$Providers$1$1$1.invoke(Preferences.kt:150) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at app.lawnchair.ui.util.ProvideBottomSheetHandlerKt$ProvideBottomSheetHandler$1.invoke(ProvideBottomSheetHandler.kt:81) at app.lawnchair.ui.util.ProvideBottomSheetHandlerKt$ProvideBottomSheetHandler$1.invoke(ProvideBottomSheetHandler.kt:80) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:250) at app.lawnchair.ui.util.ProvideBottomSheetHandlerKt.ProvideBottomSheetHandler(ProvideBottomSheetHandler.kt:80) at app.lawnchair.ui.preferences.PreferencesKt$Providers$1$1.invoke(Preferences.kt:150) at app.lawnchair.ui.preferences.PreferencesKt$Providers$1$1.invoke(Preferences.kt:149) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at app.lawnchair.util.LifecycleKt$ProvideLifecycleState$1.invoke(Lifecycle.kt:28) at app.lawnchair.util.LifecycleKt$ProvideLifecycleState$1.invoke(Lifecycle.kt:27) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:250) at app.lawnchair.util.LifecycleKt.ProvideLifecycleState(Lifecycle.kt:27) at app.lawnchair.ui.preferences.PreferencesKt$Providers$1.invoke(Preferences.kt:149) at app.lawnchair.ui.preferences.PreferencesKt$Providers$1.invoke(Preferences.kt:148) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:250) at app.lawnchair.ui.preferences.PreferencesKt.Providers(Preferences.kt:148) at app.lawnchair.ui.preferences.PreferencesKt.Preferences(Preferences.kt:101) at app.lawnchair.ui.preferences.PreferenceActivity$onCreate$1$2.invoke(PreferenceActivity.kt:58) at app.lawnchair.ui.preferences.PreferenceActivity$onCreate$1$2.invoke(PreferenceActivity.kt:57) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:250) at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:352) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:70) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:69) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:229) at androidx.compose.material3.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:61) at app.lawnchair.ui.theme.ThemeKt.LawnchairTheme(Theme.kt:45) at app.lawnchair.ui.preferences.PreferenceActivity$onCreate$1.invoke(PreferenceActivity.kt:57) at app.lawnchair.ui.preferences.PreferenceActivity$onCreate$1.invoke(PreferenceActivity.kt:39) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:428) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:229) at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:205) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:129) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:128) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:229) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:119) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:155) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:154) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:250) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:154) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:133) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:95) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3531) at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3458) at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:743) at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1112) at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:649) at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:635) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:133) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:124) at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1544) at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:124) at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:180) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.jvm.kt:198) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:124) at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1625) at android.view.View.dispatchAttachedToWindow(View.java:22257) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3494) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3501) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3501) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3501) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3501) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3501) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3501) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3207) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2659) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9789) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1399) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1408) at android.view.Choreographer.doCallbacks(Choreographer.java:1008) at android.view.Choreographer.doFrame(Choreographer.java:938) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1382) at android.os.Handler.handleCallback(Handler.java:959) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.app.ActivityThread.main(ActivityThread.java:8532) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:894) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.pm.UserManagerService$LocalService.isProfileAccessible(UserManagerService.java:7282) at com.android.server.pm.LauncherAppsService$LauncherAppsImpl.canAccessProfile(LauncherAppsService.java:464) at com.android.server.pm.LauncherAppsService$LauncherAppsImpl.canAccessProfile(LauncherAppsService.java:440) at com.android.server.pm.LauncherAppsService$LauncherAppsImpl.resolveLauncherActivityInternal(LauncherAppsService.java:684) at android.content.pm.ILauncherApps$Stub.onTransact(ILauncherApps.java:400)

BrilliantTrees commented 7 months ago

Can confirm this also happens on an unrooted Pixel 8 with Shelter installed as the Personal/Work Profile splitter

JackDropHammer commented 6 months ago

This bug probably also affects many other roms too, I also have the same issue on MIUI

slhale commented 1 month ago

I am also experiencing this issue. I am running Lawnchair beta3 via obtanium.