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
13
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
eed91233
Commit
eed91233
authored
5 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Ext. devices: remove deprecated devices filtering
Medialibrary correctly indicates if device is new now
parent
25b9327f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/StoragesMonitor.kt
+1
-5
1 addition, 5 deletions
vlc-android/src/org/videolan/vlc/StoragesMonitor.kt
with
1 addition
and
5 deletions
vlc-android/src/org/videolan/vlc/StoragesMonitor.kt
+
1
−
5
View file @
eed91233
...
...
@@ -7,7 +7,6 @@ import android.content.Intent
import
android.content.pm.PackageManager
import
android.net.Uri
import
android.text.TextUtils
import
android.util.Log
import
androidx.lifecycle.Lifecycle
import
androidx.lifecycle.ProcessLifecycleOwner
import
kotlinx.coroutines.channels.Channel
...
...
@@ -25,7 +24,6 @@ private const val TAG = "VLC/StoragesMonitor"
class
StoragesMonitor
:
BroadcastReceiver
()
{
override
fun
onReceive
(
context
:
Context
,
intent
:
Intent
)
{
Log
.
d
(
TAG
,
"onReceive ${intent.action}"
)
val
action
=
intent
.
action
?:
return
if
(
ProcessLifecycleOwner
.
get
().
lifecycle
.
currentState
.
isAtLeast
(
Lifecycle
.
State
.
STARTED
))
return
when
(
action
)
{
...
...
@@ -40,9 +38,7 @@ class StoragesMonitor : BroadcastReceiver() {
is
Mount
->
{
if
(
TextUtils
.
isEmpty
(
action
.
uuid
))
return
@actor
if
(
action
.
path
.
scanAllowed
())
{
val
knownDevices
=
action
.
ctx
.
getFromMl
{
devices
}
val
ml
=
Medialibrary
.
getInstance
()
val
isNew
=
!
containsDevice
(
knownDevices
,
action
.
path
)
&&
ml
.
addDevice
(
action
.
uuid
,
action
.
path
,
true
)
val
isNew
=
action
.
ctx
.
getFromMl
{
addDevice
(
action
.
uuid
,
action
.
path
,
true
)
}
if
(
isNew
)
{
val
intent
=
Intent
(
action
.
ctx
,
DialogActivity
::
class
.
java
).
apply
{
setAction
(
DialogActivity
.
KEY_DEVICE
)
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
6f6fb37d
·
5 years ago
mentioned in commit
6f6fb37d
mentioned in commit 6f6fb37d4f4ce867332fd4217d84740b3adab033
Toggle commit list
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