Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VariantManager API: Added new public method #5351

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@ interface VariantManager {
* @param variants Updated list of VariantConfig objects
*/
fun updateVariants(variants: List<VariantConfig>)

/**
* Checks if the user has been assigned the reinstall variant.
*
* @return True if the user is assigned the reinstall variant; false otherwise.
*/
fun isReinstallVariant(): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class VariantManagerImpl @Inject constructor(
updateUserVariant(activeVariants, currentVariantKey)
}

override fun isReinstallVariant(): Boolean = getVariantKey() == REINSTALL_VARIANT

private fun updateUserVariant(activeVariants: List<Variant>, currentVariantKey: String?) {
if (currentVariantKey == DEFAULT_VARIANT.key) {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3859,4 +3859,8 @@ internal class FakeVariantManager : VariantManager {
saveVariantsCallCounter++
variant = ""
}

override fun isReinstallVariant(): Boolean {
TODO("Not yet implemented")
}
}
Loading