BlacklistViewModel: Move label check to extension
Let other classes take benefit of this check as well Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -236,7 +236,7 @@ object PackageUtil {
|
||||
Preferences.PREFERENCE_UPDATES_EXTENDED
|
||||
)
|
||||
|
||||
packageInfoList = packageInfoList.filter { it.isValidApp() }
|
||||
packageInfoList = packageInfoList.filter { it.isValidApp(packageManager) }
|
||||
|
||||
/*Filter google apps*/
|
||||
if (isGoogleFilterEnabled) {
|
||||
|
||||
@@ -58,11 +58,7 @@ class BlacklistViewModel @Inject constructor(
|
||||
supervisorScope {
|
||||
try {
|
||||
_packages.value = context.packageManager.getInstalledPackages(0)
|
||||
.filter { it.isValidApp() }
|
||||
.filter {
|
||||
// Most core AOSP system apps use their package name as label
|
||||
it.applicationInfo!!.loadLabel(context.packageManager) != it.packageName
|
||||
}
|
||||
.filter { it.isValidApp(context.packageManager) }
|
||||
.sortedBy {
|
||||
it.applicationInfo!!.loadLabel(context.packageManager).toString()
|
||||
.lowercase(Locale.getDefault())
|
||||
|
||||
Reference in New Issue
Block a user