mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Don't show assistant app suggestion on L, show on M (#3646)
- Don't suggest setting HA as the assistant app on Android L as this setting doesn't exist yet - Allow suggesting setting HA as the assistant app on Android M as this setting was added in M
This commit is contained in:
parent
8bf32b30e9
commit
f17a9d338d
|
@ -241,9 +241,11 @@ class SettingsPresenterImpl @Inject constructor(
|
|||
if (assistantSuggestion && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
val roleManager = context.getSystemService<RoleManager>()
|
||||
assistantSuggestion = roleManager?.isRoleAvailable(RoleManager.ROLE_ASSISTANT) == true && !roleManager.isRoleHeld(RoleManager.ROLE_ASSISTANT)
|
||||
} else if (assistantSuggestion && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
} else if (assistantSuggestion && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
val defaultApp: String? = Settings.Secure.getString(context.contentResolver, "assistant")
|
||||
assistantSuggestion = defaultApp?.contains(BuildConfig.APPLICATION_ID) == false
|
||||
} else {
|
||||
assistantSuggestion = false
|
||||
}
|
||||
if (assistantSuggestion) {
|
||||
suggestions += SettingsHomeSuggestion(
|
||||
|
|
Loading…
Reference in a new issue