Skip to content

Commit

Permalink
Fix browser detection once and for all!
Browse files Browse the repository at this point in the history
  • Loading branch information
mopsalarm committed Sep 10, 2017
1 parent 0009a77 commit 03f3958
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/pr0gramm/app/util/BrowserHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ object BrowserHelper {
}
}

private val firefoxFocusPackage by memorize<Context, String?> { context ->
return@memorize listOf("org.mozilla.klar", "org.mozilla.focus").firstOrNull {
private fun firefoxFocusPackage(context: Context): String? {
return listOf("org.mozilla.klar", "org.mozilla.focus").firstOrNull { packageName ->
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"))
intent.`package` = "org.mozilla.focus"
intent.`package` = packageName
context.packageManager.queryIntentActivities(intent, 0).size > 0
}
}
Expand Down

0 comments on commit 03f3958

Please sign in to comment.