Skip to content

Commit 96f24f4

Browse files
Revert "Merge pull request TeamNewPipe#12044 from TeamNewPipe/android-auto"
This reverts commit ddb318a.
1 parent b171a26 commit 96f24f4

27 files changed

+115
-1202
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@
6565
<intent-filter>
6666
<action android:name="android.intent.action.MEDIA_BUTTON" />
6767
</intent-filter>
68-
<intent-filter>
69-
<action android:name="android.media.browse.MediaBrowserService"/>
70-
</intent-filter>
7168
</service>
7269

7370
<activity
@@ -358,10 +355,5 @@
358355
<meta-data
359356
android:name="com.samsung.android.multidisplay.keep_process_alive"
360357
android:value="true" />
361-
<!-- Android Auto -->
362-
<meta-data android:name="com.google.android.gms.car.application"
363-
android:resource="@xml/automotive_app_desc" />
364-
<meta-data android:name="com.google.android.gms.car.notification.SmallIcon"
365-
android:resource="@mipmap/ic_launcher" />
366358
</application>
367359
</manifest>

app/src/main/java/org/schabi/newpipe/MainActivity.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,7 @@ private void openMiniPlayerUponPlayerStarted() {
878878
@Override
879879
public void onReceive(final Context context, final Intent intent) {
880880
if (Objects.equals(intent.getAction(),
881-
VideoDetailFragment.ACTION_PLAYER_STARTED)
882-
&& PlayerHolder.getInstance().isPlayerOpen()) {
881+
VideoDetailFragment.ACTION_PLAYER_STARTED)) {
883882
openMiniPlayerIfMissing();
884883
// At this point the player is added 100%, we can unregister. Other actions
885884
// are useless since the fragment will not be removed after that.
@@ -891,10 +890,6 @@ public void onReceive(final Context context, final Intent intent) {
891890
final IntentFilter intentFilter = new IntentFilter();
892891
intentFilter.addAction(VideoDetailFragment.ACTION_PLAYER_STARTED);
893892
registerReceiver(broadcastReceiver, intentFilter);
894-
895-
// If the PlayerHolder is not bound yet, but the service is running, try to bind to it.
896-
// Once the connection is established, the ACTION_PLAYER_STARTED will be sent.
897-
PlayerHolder.getInstance().tryBindIfNeeded(this);
898893
}
899894
}
900895

app/src/main/java/org/schabi/newpipe/database/history/model/StreamHistoryEntry.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package org.schabi.newpipe.database.history.model
33
import androidx.room.ColumnInfo
44
import androidx.room.Embedded
55
import org.schabi.newpipe.database.stream.model.StreamEntity
6-
import org.schabi.newpipe.extractor.stream.StreamInfoItem
7-
import org.schabi.newpipe.util.image.ImageStrategy
86
import java.time.OffsetDateTime
97

108
data class StreamHistoryEntry(
@@ -29,17 +27,4 @@ data class StreamHistoryEntry(
2927
return this.streamEntity.uid == other.streamEntity.uid && streamId == other.streamId &&
3028
accessDate.isEqual(other.accessDate)
3129
}
32-
33-
fun toStreamInfoItem(): StreamInfoItem =
34-
StreamInfoItem(
35-
streamEntity.serviceId,
36-
streamEntity.url,
37-
streamEntity.title,
38-
streamEntity.streamType,
39-
).apply {
40-
duration = streamEntity.duration
41-
uploaderName = streamEntity.uploader
42-
uploaderUrl = streamEntity.uploaderUrl
43-
thumbnails = ImageStrategy.dbUrlToImageList(streamEntity.thumbnailUrl)
44-
}
4530
}
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.schabi.newpipe.database.playlist;
22

3-
import androidx.annotation.Nullable;
4-
53
import org.schabi.newpipe.database.LocalItem;
64

75
public interface PlaylistLocalItem extends LocalItem {
@@ -12,7 +10,4 @@ public interface PlaylistLocalItem extends LocalItem {
1210
long getUid();
1311

1412
void setDisplayIndex(long displayIndex);
15-
16-
@Nullable
17-
String getThumbnailUrl();
1813
}

app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistMetadataEntry.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_THUMBNAIL_STREAM_ID;
1010
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_THUMBNAIL_URL;
1111

12-
import androidx.annotation.Nullable;
13-
1412
public class PlaylistMetadataEntry implements PlaylistLocalItem {
1513
public static final String PLAYLIST_STREAM_COUNT = "streamCount";
1614

@@ -73,10 +71,4 @@ public long getUid() {
7371
public void setDisplayIndex(final long displayIndex) {
7472
this.displayIndex = displayIndex;
7573
}
76-
77-
@Nullable
78-
@Override
79-
public String getThumbnailUrl() {
80-
return thumbnailUrl;
81-
}
8274
}

app/src/main/java/org/schabi/newpipe/database/playlist/dao/PlaylistRemoteDAO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface PlaylistRemoteDAO extends BasicDAO<PlaylistRemoteEntity> {
3434

3535
@Query("SELECT * FROM " + REMOTE_PLAYLIST_TABLE + " WHERE "
3636
+ REMOTE_PLAYLIST_ID + " = :playlistId")
37-
Flowable<PlaylistRemoteEntity> getPlaylist(long playlistId);
37+
Flowable<List<PlaylistRemoteEntity>> getPlaylist(long playlistId);
3838

3939
@Query("SELECT * FROM " + REMOTE_PLAYLIST_TABLE + " WHERE "
4040
+ REMOTE_PLAYLIST_URL + " = :url AND " + REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")

app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.text.TextUtils;
44

5-
import androidx.annotation.Nullable;
65
import androidx.room.ColumnInfo;
76
import androidx.room.Entity;
87
import androidx.room.Ignore;
@@ -135,8 +134,6 @@ public void setName(final String name) {
135134
this.name = name;
136135
}
137136

138-
@Nullable
139-
@Override
140137
public String getThumbnailUrl() {
141138
return thumbnailUrl;
142139
}

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

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,11 @@ private void onSharedPreferencesChanged(final SharedPreferences sharedPreference
261261
// Service management
262262
//////////////////////////////////////////////////////////////////////////*/
263263
@Override
264-
public void onServiceConnected(@NonNull final PlayerService connectedPlayerService) {
265-
playerService = connectedPlayerService;
266-
}
267-
268-
@Override
269-
public void onPlayerConnected(@NonNull final Player connectedPlayer,
270-
final boolean playAfterConnect) {
264+
public void onServiceConnected(final Player connectedPlayer,
265+
final PlayerService connectedPlayerService,
266+
final boolean playAfterConnect) {
271267
player = connectedPlayer;
268+
playerService = connectedPlayerService;
272269

273270
// It will do nothing if the player is not in fullscreen mode
274271
hideSystemUiIfNeeded();
@@ -300,18 +297,11 @@ && isAutoplayEnabled()
300297
updateOverlayPlayQueueButtonVisibility();
301298
}
302299

303-
@Override
304-
public void onPlayerDisconnected() {
305-
player = null;
306-
// the binding could be null at this point, if the app is finishing
307-
if (binding != null) {
308-
restoreDefaultBrightness();
309-
}
310-
}
311-
312300
@Override
313301
public void onServiceDisconnected() {
314302
playerService = null;
303+
player = null;
304+
restoreDefaultBrightness();
315305
}
316306

317307

@@ -2008,16 +1998,13 @@ public void onPlayerError(final PlaybackException error, final boolean isCatchab
20081998

20091999
@Override
20102000
public void onServiceStopped() {
2011-
// the binding could be null at this point, if the app is finishing
2012-
if (binding != null) {
2013-
setOverlayPlayPauseImage(false);
2014-
if (currentInfo != null) {
2015-
updateOverlayData(currentInfo.getName(),
2016-
currentInfo.getUploaderName(),
2017-
currentInfo.getThumbnails());
2018-
}
2019-
updateOverlayPlayQueueButtonVisibility();
2001+
setOverlayPlayPauseImage(false);
2002+
if (currentInfo != null) {
2003+
updateOverlayData(currentInfo.getName(),
2004+
currentInfo.getUploaderName(),
2005+
currentInfo.getThumbnails());
20202006
}
2007+
updateOverlayPlayQueueButtonVisibility();
20212008
}
20222009

20232010
@Override

app/src/main/java/org/schabi/newpipe/ktx/Bundle.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,3 @@ import androidx.core.os.BundleCompat
77
inline fun <reified T : Parcelable> Bundle.parcelableArrayList(key: String?): ArrayList<T>? {
88
return BundleCompat.getParcelableArrayList(this, key, T::class.java)
99
}
10-
11-
fun Bundle?.toDebugString(): String {
12-
if (this == null) {
13-
return "null"
14-
}
15-
val string = StringBuilder("Bundle{")
16-
for (key in this.keySet()) {
17-
@Suppress("DEPRECATION") // we want this[key] to return items of any type
18-
string.append(" ").append(key).append(" => ").append(this[key]).append(";")
19-
}
20-
string.append(" }")
21-
return string.toString()
22-
}

app/src/main/java/org/schabi/newpipe/local/playlist/RemotePlaylistManager.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ public Flowable<List<PlaylistRemoteEntity>> getPlaylists() {
2626
return playlistRemoteTable.getPlaylists().subscribeOn(Schedulers.io());
2727
}
2828

29-
public Flowable<PlaylistRemoteEntity> getPlaylist(final long playlistId) {
30-
return playlistRemoteTable.getPlaylist(playlistId).subscribeOn(Schedulers.io());
31-
}
32-
3329
public Flowable<List<PlaylistRemoteEntity>> getPlaylist(final PlaylistInfo info) {
3430
return playlistRemoteTable.getPlaylist(info.getServiceId(), info.getUrl())
3531
.subscribeOn(Schedulers.io());

0 commit comments

Comments
 (0)