lets not list Simple Launcher at the apps

This commit is contained in:
tibbi 2022-09-25 17:05:15 +02:00
parent 32cdd98534
commit eaa9d091c3

View file

@ -346,11 +346,16 @@ class MainActivity : SimpleActivity(), FlingListener {
val intent = Intent(Intent.ACTION_MAIN, null)
intent.addCategory(Intent.CATEGORY_LAUNCHER)
val simpleLauncher = applicationContext.packageName
val list = packageManager.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED)
for (info in list) {
val componentInfo = info.activityInfo.applicationInfo
val label = info.loadLabel(packageManager).toString()
val packageName = componentInfo.packageName
if (packageName == simpleLauncher) {
continue
}
val drawable = getDrawableForPackageName(packageName) ?: continue
val placeholderColor = calculateAverageColor(drawable.toBitmap())