diff --git a/app/src/main/java/io/github/muntashirakon/AppManager/compat/PackageManagerCompat.java b/app/src/main/java/io/github/muntashirakon/AppManager/compat/PackageManagerCompat.java index 2f61df8016f..68bbfab624f 100644 --- a/app/src/main/java/io/github/muntashirakon/AppManager/compat/PackageManagerCompat.java +++ b/app/src/main/java/io/github/muntashirakon/AppManager/compat/PackageManagerCompat.java @@ -341,8 +341,13 @@ public static Intent getLaunchIntentForPackage(@NonNull String packageName, @Use return null; } LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); - if (!launcherApps.isPackageEnabled(packageName, userHandle)) { - // Package not enabled + try { + if (!launcherApps.isPackageEnabled(packageName, userHandle)) { + // Package not enabled + return null; + } + } catch (SecurityException e) { + Log.w(TAG, "Could not retrieve enable state of " + packageName + " for user " + userHandle, e); return null; } List activityInfoList = launcherApps.getActivityList(packageName, userHandle);