From a2e85066006e0a1fe0c156597e3538f9540a382a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 28 Jul 2022 19:03:05 +0200 Subject: [PATCH] Fix and suppress lint issue. RestrictedApi is for the usage of ShortcutInfoCompat.Builder. --- .../main/java/im/vector/app/features/home/ShortcutsHandler.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt b/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt index db0d7e07bc..3a72907467 100644 --- a/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt +++ b/vector/src/main/java/im/vector/app/features/home/ShortcutsHandler.kt @@ -16,6 +16,7 @@ package im.vector.app.features.home +import android.annotation.SuppressLint import android.content.Context import android.content.SharedPreferences import android.content.pm.ShortcutManager @@ -96,7 +97,9 @@ class ShortcutsHandler @Inject constructor( .launchIn(coroutineScope) } + @SuppressLint("RestrictedApi") fun updateShortcutsWithPreviousIntent() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) return // Check if it's been already done if (sharedPreferences.getBoolean(SHARED_PREF_KEY, false)) return ShortcutManagerCompat.getShortcuts(context, ShortcutManagerCompat.FLAG_MATCH_PINNED)