Reformatting to simplify use of .any construct as suggested in review
This commit is contained in:
parent
6bc5d96f92
commit
a570b910c2
|
@ -26,11 +26,10 @@ object PrivateShortcutCreateManager {
|
|||
fun doesPrivateBrowsingPinnedShortcutExist(context: Context): Boolean {
|
||||
return if (SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||
val pinnedShortcuts = context.getSystemService(ShortcutManager::class.java).pinnedShortcuts
|
||||
if (pinnedShortcuts.any {
|
||||
it.intent?.extras?.getString(HomeActivity.OPEN_TO_SEARCH) ==
|
||||
StartSearchIntentProcessor.PRIVATE_BROWSING_PINNED_SHORTCUT })
|
||||
return true
|
||||
false
|
||||
pinnedShortcuts.any {
|
||||
it.intent?.extras?.getString(HomeActivity.OPEN_TO_SEARCH) ==
|
||||
StartSearchIntentProcessor.PRIVATE_BROWSING_PINNED_SHORTCUT
|
||||
}
|
||||
} else
|
||||
false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user