(refactor) refactor ProfileManager class
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user