[Android] Unbind playbackservice sooner on Android P
Geoffrey Métais
git at videolan.org
Tue Jul 24 13:14:52 CEST 2018
vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jul 24 13:13:45 2018 +0200| [7e9ece6d12160f794de62fbff2f09e76bd58174b] | committer: Geoffrey Métais
Unbind playbackservice sooner on Android P
> https://code.videolan.org/videolan/vlc-android/commit/7e9ece6d12160f794de62fbff2f09e76bd58174b
---
.../org/videolan/vlc/gui/AudioPlayerContainerActivity.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
index c201e7454..4a4696aa4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
@@ -49,6 +49,7 @@ import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
+import org.videolan.libvlc.util.AndroidUtil;
import org.videolan.vlc.BuildConfig;
import org.videolan.vlc.ExternalMonitor;
import org.videolan.vlc.MediaParsingService;
@@ -142,7 +143,7 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
LocalBroadcastManager.getInstance(this).registerReceiver(messageReceiver, progressFilter);
// super.onStart must be called after receiver registration
super.onStart();
- mHelper.onStart();
+ if (!AndroidUtil.isPOrLater) mHelper.onStart();
}
@Override
@@ -158,6 +159,13 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
updateContainerPadding(true);
applyMarginToProgressBar(mBottomSheetBehavior.getPeekHeight());
}
+ if (AndroidUtil.isPOrLater) mHelper.onStart();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if (AndroidUtil.isPOrLater) mHelper.onStop();
}
@Override
@@ -166,7 +174,7 @@ public class AudioPlayerContainerActivity extends BaseActivity implements Playba
ExternalMonitor.unsubscribeStorageCb(this);
unregisterReceiver(messageReceiver);
LocalBroadcastManager.getInstance(this).unregisterReceiver(messageReceiver);
- mHelper.onStop();
+ if (!AndroidUtil.isPOrLater) mHelper.onStop();
}
@Override
More information about the Android
mailing list