Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
5287e7f9
Commit
5287e7f9
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Fix external devices detection
(cherry picked from commit a4163ba89ad299b39628df889a7de9f8e737023b)
parent
6c981992
No related branches found
No related tags found
No related merge requests found
Pipeline
#7152
passed with stage
in 3 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+3
-5
3 additions, 5 deletions
vlc-android/src/org/videolan/vlc/MediaParsingService.kt
with
3 additions
and
5 deletions
vlc-android/src/org/videolan/vlc/MediaParsingService.kt
+
3
−
5
View file @
5287e7f9
...
...
@@ -130,7 +130,7 @@ class MediaParsingService : Service(), DevicesDiscoveryCb, CoroutineScope {
ACTION_FORCE_RELOAD
->
actions
.
offer
(
ForceReload
)
ACTION_DISCOVER
->
discover
(
intent
.
getStringExtra
(
EXTRA_PATH
))
ACTION_DISCOVER_DEVICE
->
discoverStorage
(
intent
.
getStringExtra
(
EXTRA_PATH
))
ACTION_CHECK_STORAGES
->
if
(
s
canActivated
)
actions
.
offer
(
UpdateStorages
)
else
exitCommand
()
ACTION_CHECK_STORAGES
->
if
(
s
ettings
.
getInt
(
KEY_MEDIALIBRARY_SCAN
,
-
1
)
!=
ML_SCAN_OFF
)
actions
.
offer
(
UpdateStorages
)
else
exitCommand
()
else
->
{
exitCommand
()
return
Service
.
START_NOT_STICKY
...
...
@@ -248,11 +248,9 @@ class MediaParsingService : Service(), DevicesDiscoveryCb, CoroutineScope {
private
suspend
fun
updateStorages
()
{
serviceLock
=
true
val
ctx
=
applicationContext
val
(
sharedPreferences
,
devices
,
knownDevices
)
=
withContext
(
Dispatchers
.
IO
)
{
val
sharedPreferences
=
Settings
.
getInstance
(
ctx
)
val
(
devices
,
knownDevices
)
=
withContext
(
Dispatchers
.
IO
)
{
val
devices
=
AndroidDevices
.
getExternalStorageDirectories
()
Triple
(
sharedPreferences
,
devices
,
medialibrary
.
devices
)
Pair
(
devices
,
medialibrary
.
devices
)
}
val
missingDevices
=
Util
.
arrayToArrayList
(
knownDevices
)
missingDevices
.
remove
(
"file://${AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY}"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment