Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
f32739cf
Commit
f32739cf
authored
Apr 04, 2018
by
Geoffrey Métais
Browse files
Delay storages check
Ensure app is foreground when we start service
parent
54e4a066
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc-android/src/org/videolan/vlc/ExternalMonitor.java
View file @
f32739cf
...
...
@@ -76,13 +76,17 @@ public class ExternalMonitor extends BroadcastReceiver {
storageFilter
.
addDataScheme
(
"file"
);
ctx
.
registerReceiver
(
instance
,
networkFilter
);
ctx
.
registerReceiver
(
instance
,
storageFilter
);
if
(
AndroidUtil
.
isICSOrLater
)
checkNewStorages
(
ctx
);
checkNewStorages
(
ctx
);
}
private
static
void
checkNewStorages
(
final
Context
ctx
)
{
if
(
VLCApplication
.
getMLInstance
().
isInitiated
())
ctx
.
startService
(
new
Intent
(
Constants
.
ACTION_CHECK_STORAGES
,
null
,
ctx
,
MediaParsingService
.
class
));
if
(
AndroidUtil
.
isICSOrLater
&&
VLCApplication
.
getMLInstance
().
isInitiated
())
new
Handler
(
Looper
.
getMainLooper
()).
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
ctx
.
startService
(
new
Intent
(
Constants
.
ACTION_CHECK_STORAGES
,
null
,
ctx
,
MediaParsingService
.
class
));
}
});
}
static
void
unregister
(
Context
ctx
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment