(refactor) refactor ProfileManager class

This commit is contained in:
MM20
2026-07-19 18:27:37 +02:00
parent 10516ef9a9
commit 3f4deead1b
7 changed files with 77 additions and 97 deletions

View File

@@ -52,7 +52,7 @@ internal class AppRepositoryImpl(
private val installedApps = MutableStateFlow<List<LauncherApp>>(emptyList())
private val profiles = profileManager.activeProfiles
private val profiles = profileManager.unlockedProfiles
private val mutex = Mutex()

View File

@@ -223,7 +223,7 @@ internal class AppShortcutRepositoryImpl(
val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
if (!launcherApps.hasShortcutHostPermission()) return emptyList()
val results = mutableListOf<AppShortcutConfigActivity>()
val profiles = profileManager.activeProfiles.first()
val profiles = profileManager.unlockedProfiles.first()
for (profile in profiles) {
val activities = launcherApps.getShortcutConfigActivityList(null, profile.userHandle)
results.addAll(

View File

@@ -28,7 +28,7 @@ class PrivateSpaceLockActionBuilder(
if (!isAtLeastApiLevel(35)) return null
val privateProfile = profileManager.getProfile(Profile.Type.Private) ?: return null
val profileState = profileManager.getProfileStateOnce(privateProfile) ?: return null
val profileState = profileManager.getCurrentProfileState(privateProfile) ?: return null
val keyword = context.getString(R.string.search_query_private_space).lowercase()
val score = ResultScore.from(