Small clean-ups and added @InlineMe annotation

This commit is contained in:
Ian Baker 2024-02-13 14:48:15 +00:00
parent 1bf3101269
commit e24febf1e2
3 changed files with 10 additions and 6 deletions

View File

@ -15,9 +15,10 @@
*/ */
package androidx.media3.common.util; package androidx.media3.common.util;
import android.os.Trace;
import androidx.media3.common.MediaLibraryInfo; import androidx.media3.common.MediaLibraryInfo;
/** Calls through to {@link android.os.Trace} methods on supported API levels. */ /** Calls through to {@link Trace} methods if {@link MediaLibraryInfo#TRACE_ENABLED} is {@code true}. */
@UnstableApi @UnstableApi
public final class TraceUtil { public final class TraceUtil {
@ -26,24 +27,24 @@ public final class TraceUtil {
/** /**
* Writes a trace message to indicate that a given section of code has begun. * Writes a trace message to indicate that a given section of code has begun.
* *
* @see android.os.Trace#beginSection(String) * @see Trace#beginSection(String)
* @param sectionName The name of the code section to appear in the trace. This may be at most 127 * @param sectionName The name of the code section to appear in the trace. This may be at most 127
* Unicode code units long. * Unicode code units long.
*/ */
public static void beginSection(String sectionName) { public static void beginSection(String sectionName) {
if (MediaLibraryInfo.TRACE_ENABLED) { if (MediaLibraryInfo.TRACE_ENABLED) {
android.os.Trace.beginSection(sectionName); Trace.beginSection(sectionName);
} }
} }
/** /**
* Writes a trace message to indicate that a given section of code has ended. * Writes a trace message to indicate that a given section of code has ended.
* *
* @see android.os.Trace#endSection() * @see Trace#endSection()
*/ */
public static void endSection() { public static void endSection() {
if (MediaLibraryInfo.TRACE_ENABLED) { if (MediaLibraryInfo.TRACE_ENABLED) {
android.os.Trace.endSection(); Trace.endSection();
} }
} }
} }

View File

@ -33,6 +33,7 @@ import androidx.media3.common.util.GlUtil;
import androidx.media3.common.util.Log; import androidx.media3.common.util.Log;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
import androidx.media3.common.util.Util; import androidx.media3.common.util.Util;
import com.google.errorprone.annotations.InlineMe;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** A placeholder {@link Surface}. */ /** A placeholder {@link Surface}. */
@ -67,6 +68,9 @@ public final class PlaceholderSurface extends Surface {
/** /**
* @deprecated Use {@link #newInstance(Context, boolean)} instead. * @deprecated Use {@link #newInstance(Context, boolean)} instead.
*/ */
@InlineMe(
replacement = "PlaceholderSurface.newInstance(context, secure)",
imports = "androidx.media3.exoplayer.video.PlaceholderSurface")
@Deprecated @Deprecated
public static PlaceholderSurface newInstanceV17(Context context, boolean secure) { public static PlaceholderSurface newInstanceV17(Context context, boolean secure) {
return newInstance(context, secure); return newInstance(context, secure);

View File

@ -114,7 +114,6 @@ public final class CaptionStyleCompat {
* @param captionStyle A {@link CaptionStyle}. * @param captionStyle A {@link CaptionStyle}.
* @return The equivalent {@link CaptionStyleCompat}. * @return The equivalent {@link CaptionStyleCompat}.
*/ */
@SuppressWarnings("ResourceType") // DO NOT SUBMIT check this is still needed
public static CaptionStyleCompat createFromCaptionStyle( public static CaptionStyleCompat createFromCaptionStyle(
CaptioningManager.CaptionStyle captionStyle) { CaptioningManager.CaptionStyle captionStyle) {
if (Util.SDK_INT >= 21) { if (Util.SDK_INT >= 21) {