Update DirectoryAdapter.kt

This commit is contained in:
Tibor Kaputa 2021-12-05 23:29:28 +01:00 committed by GitHub
parent a83765705d
commit 8c0f047809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -541,6 +541,10 @@ class DirectoryAdapter(
} }
private fun tryCreateShortcut() { private fun tryCreateShortcut() {
if (!isOreoPlus()) {
return
}
activity.handleLockedFolderOpening(getFirstSelectedItemPath() ?: "") { success -> activity.handleLockedFolderOpening(getFirstSelectedItemPath() ?: "") { success ->
if (success) { if (success) {
createShortcut() createShortcut()
@ -549,9 +553,6 @@ class DirectoryAdapter(
} }
private fun createShortcut() { private fun createShortcut() {
if (!isOreoPlus()) {
return
}
val manager = activity.getSystemService(ShortcutManager::class.java) val manager = activity.getSystemService(ShortcutManager::class.java)
if (manager.isRequestPinShortcutSupported) { if (manager.isRequestPinShortcutSupported) {
val dir = getFirstSelectedItem() ?: return val dir = getFirstSelectedItem() ?: return