mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Fix and suppress lint issue. RestrictedApi is for the usage of ShortcutInfoCompat.Builder.
This commit is contained in:
parent
eee418d1fd
commit
a2e8506600
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue