Skip to content

Commit f48e6e6

Browse files
committed
Make PlayerHolder.bound private
1 parent 86fcd4b commit f48e6e6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ protected void initListeners() {
685685
});
686686

687687
setupBottomPlayer();
688-
if (!playerHolder.bound) {
688+
if (!playerHolder.isBound()) {
689689
setHeightThumbnail();
690690
} else {
691691
playerHolder.startService(false, this);
@@ -1434,7 +1434,7 @@ public void onReceive(final Context context, final Intent intent) {
14341434
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
14351435
}
14361436
// Rebound to the service if it was closed via notification or mini player
1437-
if (!playerHolder.bound) {
1437+
if (!playerHolder.isBound()) {
14381438
playerHolder.startService(
14391439
false, VideoDetailFragment.this);
14401440
}

app/src/main/java/org/schabi/newpipe/player/helper/PlayerHolder.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static synchronized PlayerHolder getInstance() {
4141
private PlayerServiceExtendedEventListener listener;
4242

4343
private final PlayerServiceConnection serviceConnection = new PlayerServiceConnection();
44-
public boolean bound;
44+
private boolean bound;
4545
private MainPlayer playerService;
4646
private Player player;
4747

@@ -70,6 +70,10 @@ public boolean isPlayerOpen() {
7070
return player != null;
7171
}
7272

73+
public boolean isBound() {
74+
return bound;
75+
}
76+
7377
public int getQueueSize() {
7478
return isPlayerOpen() ? player.getPlayQueue().size() : 0;
7579
}

0 commit comments

Comments
 (0)