Always show all profiles
This commit is contained in:
parent
952225ca12
commit
c3bafb7fb9
@ -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 {
|
||||||
|
|||||||
@ -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),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user