[Android] Synchronize client connection
Geoffrey Métais
git at videolan.org
Thu Jun 9 11:09:41 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun 9 11:08:41 2016 +0200| [1af07e5d2c33b10c065e9add5ef07eb554dc6f5a] | committer: Geoffrey Métais
Synchronize client connection
> https://code.videolan.org/videolan/vlc-android/commit/1af07e5d2c33b10c065e9add5ef07eb554dc6f5a
---
vlc-android/src/org/videolan/vlc/media/MediaUtils.java | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/media/MediaUtils.java b/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
index 5f71c17..8094bc8 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
@@ -238,7 +238,6 @@ public class MediaUtils {
private static class DialogCallback extends BaseCallBack {
private final ProgressDialog dialog;
private final Runnable mRunnable;
- private boolean performAction = true;
private interface Runnable {
void run(PlaybackService service);
@@ -256,23 +255,19 @@ public class MediaUtils {
@Override
public void onCancel(DialogInterface dialog) {
synchronized (this) {
- if (performAction)
- performAction = false;
- else
- mClient.disconnect();
+ mClient.disconnect();
}
}
});
- mClient.connect();
+ synchronized (this) {
+ mClient.connect();
+ }
}
@Override
public void onConnected(PlaybackService service) {
synchronized (this) {
- if (performAction) {
- performAction = false;
- mRunnable.run(service);
- }
+ mRunnable.run(service);
}
dialog.cancel();
}
More information about the Android
mailing list