Skip to content

Commit

Permalink
Fix: Sesame: Launch default assistant if Google App isn't enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Till Kottmann <[email protected]>
  • Loading branch information
nyancrimew committed Dec 3, 2019
1 parent b0f8ac3 commit d46d9eb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class SesameSearchProvider(context: Context) : SearchProvider(context), Lawnchai

override fun startVoiceSearch(callback: (intent: Intent) -> Unit) = startAssistant(callback)

override fun startAssistant(callback: (intent: Intent) -> Unit) = callback(Intent(Intent.ACTION_VOICE_COMMAND).setPackage(GoogleSearchProvider.PACKAGE))
override fun startAssistant(callback: (intent: Intent) -> Unit) = if (PackageManagerHelper.isAppEnabled(context.packageManager, GoogleSearchProvider.PACKAGE, 0)) {
callback(Intent(Intent.ACTION_VOICE_COMMAND).setPackage(GoogleSearchProvider.PACKAGE))
} else callback(Intent(Intent.ACTION_ASSIST))

private var iconCache: Drawable? = null

Expand Down

0 comments on commit d46d9eb

Please sign in to comment.