Always show all profiles

This commit is contained in:
MM20 2024-07-19 23:02:12 +02:00
parent 952225ca12
commit c3bafb7fb9
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
3 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,6 @@ data class Profile(
data class State( data class State(
val locked: Boolean = false, val locked: Boolean = false,
val hidden: Boolean = false,
) )
companion object { companion object {

View File

@ -48,7 +48,7 @@ class ProfileManager(
*/ */
val activeProfiles: Flow<List<Profile>> = profileStates.map { val activeProfiles: Flow<List<Profile>> = profileStates.map {
it.mapNotNull { it.mapNotNull {
if (it.state.hidden) null else it.profile if (it.state.locked) null else it.profile
} }
}.shareIn(scope, SharingStarted.WhileSubscribed(), replay = 1) }.shareIn(scope, SharingStarted.WhileSubscribed(), replay = 1)
@ -142,7 +142,6 @@ class ProfileManager(
private fun getProfileState(userHandle: UserHandle): Profile.State { private fun getProfileState(userHandle: UserHandle): Profile.State {
return Profile.State( return Profile.State(
locked = !userManager.isUserUnlocked(userHandle), locked = !userManager.isUserUnlocked(userHandle),
hidden = !userManager.isUserRunning(userHandle),
) )
} }

View File

@ -141,8 +141,10 @@ internal data class LauncherApp(
options options
) )
} catch (e: SecurityException) { } catch (e: SecurityException) {
Log.e("MM20", "Could not launch app", e)
return false return false
} catch (e: ActivityNotFoundException) { } catch (e: ActivityNotFoundException) {
Log.e("MM20", "Could not launch app", e)
return false return false
} }
return true return true