Skip to content

Commit

Permalink
Tweaked logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Waboodoo committed May 19, 2024
1 parent fb0dc77 commit 3643215
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ constructor(
rank: Int = 0,
trigger: ShortcutTriggerType,
): ShortcutInfo {
logInfo("Creating shortcut info. icon = ${launcherShortcut.icon}")
val icon = IconUtil.getIcon(context, launcherShortcut.icon, adaptive = true)
val label = launcherShortcut.name.ifEmpty { "-" }
return ShortcutInfo.Builder(context, createShortcutInfoId(launcherShortcut.id))
Expand Down Expand Up @@ -139,6 +138,7 @@ constructor(

fun pinShortcut(shortcut: LauncherShortcut) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
logInfo("Pinning shortcut")
val shortcutInfo = createShortcutInfo(shortcut, trigger = ShortcutTriggerType.HOME_SCREEN_SHORTCUT)
shortcutManager.requestPinShortcut(shortcutInfo, null)
}
Expand All @@ -154,6 +154,7 @@ constructor(

fun updatePinnedShortcut(shortcut: LauncherShortcut) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
logInfo("Updating pinned shortcut")
val shortcutInfo = createShortcutInfo(shortcut, trigger = ShortcutTriggerType.HOME_SCREEN_SHORTCUT)
shortcutManager.updateShortcuts(listOf(shortcutInfo))
}
Expand Down

0 comments on commit 3643215

Please sign in to comment.