Skip to content

Commit c93d3e6

Browse files
committed
Migrate everything to media3's Log
To consistently allow apps to intercept logs and just be generally consistent in the project.
1 parent a4ec294 commit c93d3e6

File tree

20 files changed

+30
-40
lines changed

20 files changed

+30
-40
lines changed

demos/composition/src/main/java/androidx/media3/demo/composition/effect/DemoLottieProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import android.graphics.Bitmap
2020
import android.graphics.BitmapFactory
2121
import android.graphics.Typeface
2222
import android.util.Base64
23-
import android.util.Log
2423
import androidx.core.graphics.createBitmap
2524
import androidx.core.graphics.scale
25+
import androidx.media3.common.util.Log
2626
import androidx.media3.common.util.UnstableApi
2727
import androidx.media3.effect.LottieOverlay
2828
import com.airbnb.lottie.ImageAssetDelegate

demos/effect/src/main/java/androidx/media3/demo/effect/EffectDemoUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ package androidx.media3.demo.effect
1818
import android.content.Context
1919
import android.net.Uri
2020
import android.util.JsonReader
21-
import android.util.Log
2221
import androidx.media3.common.MediaItem
22+
import androidx.media3.common.util.Log
2323
import java.io.IOException
2424
import java.io.InputStreamReader
2525
import java.nio.charset.StandardCharsets

demos/main/src/main/java/androidx/media3/demo/main/SampleChooserActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import android.os.Looper;
3333
import android.text.TextUtils;
3434
import android.util.JsonReader;
35-
import android.util.Log;
3635
import android.view.Menu;
3736
import android.view.MenuInflater;
3837
import android.view.MenuItem;
@@ -53,6 +52,7 @@
5352
import androidx.media3.common.MediaItem;
5453
import androidx.media3.common.MediaItem.ClippingConfiguration;
5554
import androidx.media3.common.MediaMetadata;
55+
import androidx.media3.common.util.Log;
5656
import androidx.media3.common.util.UnstableApi;
5757
import androidx.media3.common.util.Util;
5858
import androidx.media3.datasource.DataSource;

demos/session/src/main/java/androidx/media3/demo/session/PlayerActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package androidx.media3.demo.session
1818
import android.content.ComponentName
1919
import android.content.Context
2020
import android.os.Bundle
21-
import android.util.Log
2221
import android.view.LayoutInflater
2322
import android.view.View
2423
import android.view.ViewGroup
@@ -40,6 +39,7 @@ import androidx.media3.common.Player.EVENT_MEDIA_ITEM_TRANSITION
4039
import androidx.media3.common.Player.EVENT_MEDIA_METADATA_CHANGED
4140
import androidx.media3.common.Player.EVENT_TIMELINE_CHANGED
4241
import androidx.media3.common.Player.EVENT_TRACKS_CHANGED
42+
import androidx.media3.common.util.Log
4343
import androidx.media3.common.util.UnstableApi
4444
import androidx.media3.session.MediaController
4545
import androidx.media3.session.SessionToken

demos/shortform/src/main/java/androidx/media3/demo/shortform/viewpager/ViewPagerActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
package androidx.media3.demo.shortform.viewpager
1717

1818
import android.os.Bundle
19-
import android.util.Log
2019
import androidx.appcompat.app.AppCompatActivity
20+
import androidx.media3.common.util.Log
2121
import androidx.media3.demo.shortform.MainActivity
2222
import androidx.media3.demo.shortform.MediaItemDatabase
2323
import androidx.media3.demo.shortform.R

libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/VideoDecoderGLSurfaceView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import android.opengl.GLES20;
2323
import android.opengl.GLSurfaceView;
2424
import android.util.AttributeSet;
25-
import android.util.Log;
2625
import androidx.annotation.Nullable;
2726
import androidx.media3.common.util.GlProgram;
2827
import androidx.media3.common.util.GlUtil;
28+
import androidx.media3.common.util.Log;
2929
import androidx.media3.common.util.NullableType;
3030
import androidx.media3.common.util.UnstableApi;
3131
import androidx.media3.decoder.VideoDecoderOutputBuffer;

libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/spherical/ProjectionRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
import android.opengl.GLES11Ext;
2121
import android.opengl.GLES20;
22-
import android.util.Log;
2322
import androidx.annotation.Nullable;
2423
import androidx.media3.common.C;
2524
import androidx.media3.common.util.GlProgram;
2625
import androidx.media3.common.util.GlUtil;
26+
import androidx.media3.common.util.Log;
2727
import java.nio.FloatBuffer;
2828
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
2929

libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpPcmReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import static androidx.media3.exoplayer.rtsp.reader.RtpReaderUtils.toSampleTimeUs;
1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21-
import android.util.Log;
2221
import androidx.media3.common.C;
22+
import androidx.media3.common.util.Log;
2323
import androidx.media3.common.util.ParsableByteArray;
2424
import androidx.media3.common.util.UnstableApi;
2525
import androidx.media3.common.util.Util;

libraries/session/src/main/java/androidx/media3/session/MediaButtonReceiver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ protected final void handleIntentAndMaybeStartTheService(
140140
if (intent == null
141141
|| !Objects.equals(intent.getAction(), Intent.ACTION_MEDIA_BUTTON)
142142
|| !intent.hasExtra(Intent.EXTRA_KEY_EVENT)) {
143-
android.util.Log.d(TAG, "Ignore unsupported intent: " + intent);
143+
Log.d(TAG, "Ignore unsupported intent: " + intent);
144144
return;
145145
}
146146

@@ -163,7 +163,7 @@ protected final void handleIntentAndMaybeStartTheService(
163163
// playback is started and the MediaSessionService/MediaLibraryService is put into the
164164
// foreground (see https://developer.android.com/media/legacy/media-buttons and
165165
// https://developer.android.com/about/versions/oreo/android-8.0-changes#back-all).
166-
android.util.Log.w(
166+
Log.w(
167167
TAG,
168168
"Ignore key event that is not a `play` command on API 26 or above to avoid an"
169169
+ " 'ForegroundServiceDidNotStartInTimeException'");

libraries/session/src/main/java/androidx/media3/session/legacy/MediaBrowserCompat.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@
6565
import android.os.RemoteException;
6666
import android.support.v4.os.ResultReceiver;
6767
import android.text.TextUtils;
68-
import android.util.Log;
6968
import androidx.annotation.IntDef;
7069
import androidx.annotation.Nullable;
7170
import androidx.annotation.RequiresApi;
7271
import androidx.annotation.RestrictTo;
7372
import androidx.collection.ArrayMap;
73+
import androidx.media3.common.util.Log;
7474
import androidx.media3.common.util.NullableType;
7575
import androidx.media3.session.legacy.MediaControllerCompat.TransportControls;
7676
import java.lang.annotation.Retention;
@@ -108,7 +108,6 @@
108108
@RestrictTo(LIBRARY)
109109
public final class MediaBrowserCompat {
110110
static final String TAG = "MediaBrowserCompat";
111-
static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
112111

113112
/**
114113
* Used as an int extra field to denote the page number to subscribe. The value of {@code
@@ -1219,9 +1218,7 @@ public void onLoadChildren(
12191218
// Check that the subscription is still subscribed.
12201219
Subscription subscription = parentId == null ? null : subscriptions.get(parentId);
12211220
if (subscription == null) {
1222-
if (DEBUG) {
1223-
Log.d(TAG, "onLoadChildren for id that isn't subscribed id=" + parentId);
1224-
}
1221+
Log.d(TAG, "onLoadChildren for id that isn't subscribed id=" + parentId);
12251222
return;
12261223
}
12271224

0 commit comments

Comments
 (0)