Skip to content

Commit

Permalink
Don't show assistant app suggestion on L, show on M (#3646)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
jpelgrom authored Jul 9, 2023
1 parent 8bf32b3 commit f17a9d3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f17a9d3

Please sign in to comment.