Skip to content

Commit

Permalink
fix: Incorrect detection of special paths
Browse files Browse the repository at this point in the history
  • Loading branch information
XayahSuSuSu committed Jul 14, 2024
1 parent e3d35bb commit c6da17c
Showing 1 changed file with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,28 @@ internal class LibPickYouViewModel(
}

private suspend fun checkSpecialPath(context: Context, path: List<String>) {
if (PathUtil.underSpecialPathAndroidData(path)) {
emitIntentSuspend(IndexUiIntent.RequestSpecialDir(context, SpecialPathAndroidData.toPath(), DocumentUriAndroidData, path.toPath()))
} else if (PathUtil.underSpecialPathAndroidObb(path)) {
emitIntentSuspend(IndexUiIntent.RequestSpecialDir(context, SpecialPathAndroidObb.toPath(), DocumentUriAndroidObb, path.toPath()))
} else {
_documentUriState.value = null
if (PickYouLauncher.isRootMode.not() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (PathUtil.underSpecialPathAndroidData(path)) {
emitIntentSuspend(
IndexUiIntent.RequestSpecialDir(
context,
SpecialPathAndroidData.toPath(),
DocumentUriAndroidData,
path.toPath()
)
)
} else if (PathUtil.underSpecialPathAndroidObb(path)) {
emitIntentSuspend(
IndexUiIntent.RequestSpecialDir(
context,
SpecialPathAndroidObb.toPath(),
DocumentUriAndroidObb,
path.toPath()
)
)
} else {
_documentUriState.value = null
}
}
}

Expand Down

0 comments on commit c6da17c

Please sign in to comment.