Revert "Add cloned profile support"
This reverts commit 1d2798ba4f.
Reopen #1364
This commit is contained in:
@@ -37,11 +37,6 @@ data class Profile(
|
||||
* The private space profile (Android 15+)
|
||||
*/
|
||||
Private,
|
||||
|
||||
/**
|
||||
* Cloned apps profile
|
||||
*/
|
||||
Cloned,
|
||||
}
|
||||
|
||||
data class State(
|
||||
|
||||
@@ -43,16 +43,15 @@ class ProfileManager(
|
||||
private val scope = CoroutineScope(Dispatchers.Default + Job())
|
||||
|
||||
/**
|
||||
* An array of exactly 4 profiles with their states.
|
||||
* An array of exactly 3 profiles with their states.
|
||||
* - Index 0: Personal profile
|
||||
* - Index 1: Work profile
|
||||
* - Index 2: Private profile
|
||||
* - Index 3: Cloned profile
|
||||
*
|
||||
* Profiles that don't exist are null.
|
||||
*/
|
||||
private val profileStates: MutableStateFlow<Array<ProfileWithState?>> =
|
||||
MutableStateFlow(arrayOf(null, null, null, null))
|
||||
MutableStateFlow(arrayOf(null, null, null))
|
||||
|
||||
/**
|
||||
* List of profiles that are active and unlocked.
|
||||
@@ -117,7 +116,6 @@ class ProfileManager(
|
||||
Profile.Type.Personal -> 0
|
||||
Profile.Type.Work -> 1
|
||||
Profile.Type.Private -> 2
|
||||
Profile.Type.Cloned -> 3
|
||||
}
|
||||
|
||||
if (profiles[index] == null) {
|
||||
@@ -153,7 +151,6 @@ class ProfileManager(
|
||||
return when (launcherUserInfo?.userType) {
|
||||
UserManager.USER_TYPE_PROFILE_PRIVATE -> Profile.Type.Private
|
||||
UserManager.USER_TYPE_PROFILE_MANAGED -> Profile.Type.Work
|
||||
UserManager.USER_TYPE_PROFILE_CLONE -> Profile.Type.Cloned
|
||||
else -> Profile.Type.Personal
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package de.mm20.launcher2.badges.providers
|
||||
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.ContentCopy
|
||||
import androidx.compose.material.icons.rounded.Lock
|
||||
import androidx.compose.material.icons.rounded.Work
|
||||
import de.mm20.launcher2.badges.Badge
|
||||
@@ -34,7 +33,6 @@ class ProfileBadgeProvider : BadgeProvider, KoinComponent {
|
||||
when(it?.type) {
|
||||
Profile.Type.Work -> WorkProfile
|
||||
Profile.Type.Private -> PrivateProfile
|
||||
Profile.Type.Cloned -> ClonedProfile
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
@@ -52,9 +50,5 @@ class ProfileBadgeProvider : BadgeProvider, KoinComponent {
|
||||
private val PrivateProfile = Badge(
|
||||
icon = BadgeIcon(Icons.Rounded.PrivateSpace)
|
||||
)
|
||||
|
||||
private val ClonedProfile = Badge(
|
||||
icon = BadgeIcon(Icons.Rounded.ContentCopy)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,6 @@ internal class SearchServiceImpl(
|
||||
val standardProfile = profiles.find { it.type == Profile.Type.Personal }
|
||||
val workProfile = profiles.find { it.type == Profile.Type.Work }
|
||||
val privateSpace = profiles.find { it.type == Profile.Type.Private }
|
||||
val clonedProfile = profiles.find { it.type == Profile.Type.Cloned }
|
||||
appRepository.search("", false)
|
||||
.withCustomLabels(customAttributesRepository)
|
||||
.map { apps ->
|
||||
@@ -288,9 +287,6 @@ internal class SearchServiceImpl(
|
||||
standardProfile != null && app.user == standardProfile.userHandle -> standardProfileApps.add(
|
||||
app
|
||||
)
|
||||
clonedProfile != null && app.user == clonedProfile.userHandle -> standardProfileApps.add(
|
||||
app
|
||||
)
|
||||
|
||||
workProfile != null && app.user == workProfile.userHandle -> workProfileApps.add(
|
||||
app
|
||||
|
||||
Reference in New Issue
Block a user