All apps visible for android 11-12

Reformat some code
This commit is contained in:
LooKeR 2021-10-10 22:31:20 +05:30
parent 9f8f5cdb7a
commit d4d55b3c21
2 changed files with 12 additions and 7 deletions

View File

@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<application
android:name="com.looker.droidify.MainApplication"

View File

@ -208,8 +208,9 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
Intent.CATEGORY_LAUNCHER
), 0
)
.asSequence().mapNotNull { it.activityInfo }
.filter { it.packageName == packageName }
.asSequence()
.mapNotNull { resolveInfo -> resolveInfo.activityInfo }
.filter { activityInfo -> activityInfo.packageName == packageName }
.mapNotNull { activityInfo ->
val label = try {
activityInfo.loadLabel(packageManager).toString()
@ -217,7 +218,12 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
e.printStackTrace()
null
}
label?.let { Pair(activityInfo.name, it) }
label?.let { labelName ->
Pair(
activityInfo.name,
labelName
)
}
}
.toList()
}
@ -399,8 +405,7 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
productRepository.second,
release
)
}
Unit
} else Unit
}
ProductAdapter.Action.LAUNCH -> {
val launcherActivities = installed?.launcherActivities.orEmpty()
@ -432,8 +437,7 @@ class ProductFragment() : ScreenFragment(), ProductAdapter.Callbacks {
val binder = downloadConnection.binder
if (downloading && binder != null) {
binder.cancel(packageName)
}
Unit
} else Unit
}
}::class
}