1
0
Fork 0

Reformatting to simplify use of .any construct as suggested in review

master
bswe 2019-10-13 11:14:17 -07:00
parent 6bc5d96f92
commit a570b910c2
1 changed files with 4 additions and 5 deletions

View File

@ -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
}