Fix: Hide self from app list.

This commit is contained in:
HeCodes2Much
2024-05-11 19:27:00 +01:00
parent e6ec1837fb
commit d494284901
3 changed files with 7 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
package com.github.droidworksstudio.launcher
object Constants {
const val PACKAGE_NAME = "com.github.droidworksstudio.launcher"
const val PACKAGE_NAME = "app.easy.launcher"
const val PACKAGE_NAME_DEBUG = "$PACKAGE_NAME.debug"
const val PREFS_FILENAME = "EasyLauncher.pref"
const val FIRST_LAUNCH = "FIRST_LAUNCH"

View File

@@ -109,14 +109,14 @@ class AppInfoRepository @Inject constructor(
val launcherApps =
context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
val excludedPackageName = Constants.PACKAGE_NAME
val excludedPackageNames = mutableListOf(Constants.PACKAGE_NAME,Constants.PACKAGE_NAME_DEBUG)
val newAppList: List<AppInfo> = userManager.userProfiles
.flatMap { profile ->
launcherApps.getActivityList(null, profile)
.mapNotNull { app ->
val packageName = app.applicationInfo.packageName
if (packageName !in existingPackageNames && packageName != excludedPackageName) {
if (packageName !in existingPackageNames && packageName !in excludedPackageNames) {
AppInfo(
appName = app.label.toString(),
packageName = packageName,