mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Fix crash in App Predictor
Signed-off-by: Till Kottmann <me@deletescape.ch>
This commit is contained in:
@@ -236,11 +236,13 @@ open class LawnchairEventPredictor(private val context: Context): CustomAppPredi
|
||||
System.currentTimeMillis(), MAX_PREDICTIONS * 2,
|
||||
arrayOf(ShortcutType.APP_COMPONENT))
|
||||
val user = Process.myUserHandle()
|
||||
val fullList = lst!!.mapNotNull { it.shortcut.componentName }
|
||||
.map { getComponentFromString(it) }
|
||||
.filterNot { it.componentKey.componentName == sesameComponent }
|
||||
.filterNot { isHiddenApp(context, it.componentKey) }
|
||||
.filter { mAppFilter.shouldShowApp(it.componentKey.componentName, user) }.toMutableList()
|
||||
val fullList = lst?.mapNotNull { it.shortcut.componentName }
|
||||
?.map { getComponentFromString(it) }
|
||||
?.filterNot { it.componentKey.componentName == sesameComponent }
|
||||
?.filterNot { isHiddenApp(context, it.componentKey) }
|
||||
?.filter {
|
||||
mAppFilter.shouldShowApp(it.componentKey.componentName, user)
|
||||
}?.toMutableList() ?: mutableListOf<ComponentKeyMapper>()
|
||||
if (fullList.size < MAX_PREDICTIONS) {
|
||||
fullList.addAll(
|
||||
PLACE_HOLDERS.mapNotNull { packageManager.getLaunchIntentForPackage(it)?.component }
|
||||
|
||||
Reference in New Issue
Block a user