Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
8c9029aa
Commit
8c9029aa
authored
May 30, 2016
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check service connection in dialog cancel
parent
9bf8e30f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
vlc-android/src/org/videolan/vlc/PlaybackService.java
vlc-android/src/org/videolan/vlc/PlaybackService.java
+1
-5
vlc-android/src/org/videolan/vlc/media/MediaUtils.java
vlc-android/src/org/videolan/vlc/media/MediaUtils.java
+14
-3
No files found.
vlc-android/src/org/videolan/vlc/PlaybackService.java
View file @
8c9029aa
...
...
@@ -2164,11 +2164,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
public
void
disconnect
()
{
if
(
mBound
)
{
mBound
=
false
;
try
{
mContext
.
unbindService
(
mServiceConnection
);
}
catch
(
IllegalArgumentException
e
)
{
//Safety catch
}
mContext
.
unbindService
(
mServiceConnection
);
}
}
...
...
vlc-android/src/org/videolan/vlc/media/MediaUtils.java
View file @
8c9029aa
...
...
@@ -237,7 +237,8 @@ public class MediaUtils {
private
static
class
DialogCallback
extends
BaseCallBack
{
private
final
ProgressDialog
dialog
;
final
private
Runnable
mRunnable
;
private
final
Runnable
mRunnable
;
private
boolean
performAction
=
true
;
private
interface
Runnable
{
void
run
(
PlaybackService
service
);
...
...
@@ -254,7 +255,12 @@ public class MediaUtils {
dialog
.
setOnCancelListener
(
new
DialogInterface
.
OnCancelListener
()
{
@Override
public
void
onCancel
(
DialogInterface
dialog
)
{
mClient
.
disconnect
();
synchronized
(
this
)
{
if
(
performAction
)
performAction
=
false
;
else
mClient
.
disconnect
();
}
}
});
mClient
.
connect
();
...
...
@@ -262,7 +268,12 @@ public class MediaUtils {
@Override
public
void
onConnected
(
PlaybackService
service
)
{
mRunnable
.
run
(
service
);
synchronized
(
this
)
{
if
(
performAction
)
{
performAction
=
false
;
mRunnable
.
run
(
service
);
}
}
dialog
.
cancel
();
}
...
...
Write
Preview
Markdown
is supported
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