Skip to content

Commit 41eaa00

Browse files
Use native Bundle.toString() implementation
1 parent 47299c9 commit 41eaa00

2 files changed

Lines changed: 3 additions & 17 deletions

File tree

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 java.io.Serializable
77
inline fun <reified T : Serializable> Bundle.serializable(key: String?): T? {
88
return BundleCompat.getSerializable(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/player/PlayerService.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector;
3939

40-
import org.schabi.newpipe.ktx.BundleKt;
4140
import org.schabi.newpipe.player.mediabrowser.MediaBrowserImpl;
4241
import org.schabi.newpipe.player.mediabrowser.MediaBrowserPlaybackPreparer;
4342
import org.schabi.newpipe.player.mediasession.MediaSessionPlayerUi;
@@ -127,8 +126,8 @@ public void onCreate() {
127126
public int onStartCommand(final Intent intent, final int flags, final int startId) {
128127
if (DEBUG) {
129128
Log.d(TAG, "onStartCommand() called with: intent = [" + intent
130-
+ "], extras = [" + BundleKt.toDebugString(intent.getExtras())
131-
+ "], flags = [" + flags + "], startId = [" + startId + "]");
129+
+ "], extras = [" + intent.getExtras() + "], flags = [" + flags
130+
+ "], startId = [" + startId + "]");
132131
}
133132

134133
// All internal NewPipe intents used to interact with the player, that are sent to the
@@ -270,7 +269,7 @@ protected void attachBaseContext(final Context base) {
270269
public IBinder onBind(final Intent intent) {
271270
if (DEBUG) {
272271
Log.d(TAG, "onBind() called with: intent = [" + intent
273-
+ "], extras = [" + BundleKt.toDebugString(intent.getExtras()) + "]");
272+
+ "], extras = [" + intent.getExtras() + "]");
274273
}
275274

276275
if (BIND_PLAYER_HOLDER_ACTION.equals(intent.getAction())) {

0 commit comments

Comments
 (0)