Commit a78b1829 by olly Committed by Oliver Woodman

Remove some long deprecated methods

PiperOrigin-RevId: 369626542
parent 7d4a013c
...@@ -87,6 +87,21 @@ ...@@ -87,6 +87,21 @@
module instead. module instead.
* Remove `DefaultMediaSourceEventListener`. Use `MediaSourceEventListener` * Remove `DefaultMediaSourceEventListener`. Use `MediaSourceEventListener`
instead. instead.
* Remove
`NotificationUtil.createNotificationChannel(Context, String, int, int)`.
Use `createNotificationChannel(Context, String, int, int, int)`
instead.
* Remove `PlayerNotificationManager.NotificationListener`
`onNotificationStarted(int, Notification)` and
`onNotificationCancelled(int)`. Use
`onNotificationPosted(int, Notification, boolean)` and
`onNotificationCancelled(int, boolean)` instead.
* Remove `PlayerNotificationManager.setNotificationListener`. Use
`PlayerNotificationManager.Builder.setNotificationListener` instead.
* Remove `DashManifest` constructor. Use the remaining constructor with
`programInformation` and `serviceDescription` set to `null` instead.
* Remove `CryptoInfo.getFrameworkCryptoInfoV16`. Use
`CryptoInfo.getFrameworkCryptoInfo` instead.
* DRM: * DRM:
* Only dispatch DRM session acquire and release events once per period * Only dispatch DRM session acquire and release events once per period
when playing content that uses the same encryption keys for both audio & when playing content that uses the same encryption keys for both audio &
......
...@@ -121,12 +121,6 @@ public final class CryptoInfo { ...@@ -121,12 +121,6 @@ public final class CryptoInfo {
return frameworkCryptoInfo; return frameworkCryptoInfo;
} }
/** @deprecated Use {@link #getFrameworkCryptoInfo()}. */
@Deprecated
public android.media.MediaCodec.CryptoInfo getFrameworkCryptoInfoV16() {
return getFrameworkCryptoInfo();
}
/** /**
* Increases the number of clear data for the first sub sample by {@code count}. * Increases the number of clear data for the first sub sample by {@code count}.
* *
......
...@@ -63,14 +63,6 @@ public final class NotificationUtil { ...@@ -63,14 +63,6 @@ public final class NotificationUtil {
/** @see NotificationManager#IMPORTANCE_HIGH */ /** @see NotificationManager#IMPORTANCE_HIGH */
public static final int IMPORTANCE_HIGH = NotificationManager.IMPORTANCE_HIGH; public static final int IMPORTANCE_HIGH = NotificationManager.IMPORTANCE_HIGH;
/** @deprecated Use {@link #createNotificationChannel(Context, String, int, int, int)}. */
@Deprecated
public static void createNotificationChannel(
Context context, String id, @StringRes int nameResourceId, @Importance int importance) {
createNotificationChannel(
context, id, nameResourceId, /* descriptionResourceId= */ 0, importance);
}
/** /**
* Creates a notification channel that notifications can be posted to. See {@link * Creates a notification channel that notifications can be posted to. See {@link
* NotificationChannel} and {@link * NotificationChannel} and {@link
......
...@@ -93,39 +93,6 @@ public class DashManifest implements FilterableManifest<DashManifest> { ...@@ -93,39 +93,6 @@ public class DashManifest implements FilterableManifest<DashManifest> {
private final List<Period> periods; private final List<Period> periods;
/**
* @deprecated Use {@link #DashManifest(long, long, long, boolean, long, long, long, long,
* ProgramInformation, UtcTimingElement, ServiceDescriptionElement, Uri, List)}.
*/
@Deprecated
public DashManifest(
long availabilityStartTimeMs,
long durationMs,
long minBufferTimeMs,
boolean dynamic,
long minUpdatePeriodMs,
long timeShiftBufferDepthMs,
long suggestedPresentationDelayMs,
long publishTimeMs,
@Nullable UtcTimingElement utcTiming,
@Nullable Uri location,
List<Period> periods) {
this(
availabilityStartTimeMs,
durationMs,
minBufferTimeMs,
dynamic,
minUpdatePeriodMs,
timeShiftBufferDepthMs,
suggestedPresentationDelayMs,
publishTimeMs,
/* programInformation= */ null,
utcTiming,
/* serviceDescription= */ null,
location,
periods);
}
public DashManifest( public DashManifest(
long availabilityStartTimeMs, long availabilityStartTimeMs,
long durationMs, long durationMs,
......
...@@ -261,25 +261,6 @@ public class PlayerNotificationManager { ...@@ -261,25 +261,6 @@ public class PlayerNotificationManager {
public interface NotificationListener { public interface NotificationListener {
/** /**
* Called after the notification has been started.
*
* @param notificationId The id with which the notification has been posted.
* @param notification The {@link Notification}.
* @deprecated Use {@link #onNotificationPosted(int, Notification, boolean)} instead.
*/
@Deprecated
default void onNotificationStarted(int notificationId, Notification notification) {}
/**
* Called after the notification has been cancelled.
*
* @param notificationId The id of the notification which has been cancelled.
* @deprecated Use {@link #onNotificationCancelled(int, boolean)}.
*/
@Deprecated
default void onNotificationCancelled(int notificationId) {}
/**
* Called after the notification has been cancelled. * Called after the notification has been cancelled.
* *
* @param notificationId The id of the notification which has been cancelled. * @param notificationId The id of the notification which has been cancelled.
...@@ -644,6 +625,7 @@ public class PlayerNotificationManager { ...@@ -644,6 +625,7 @@ public class PlayerNotificationManager {
private final String channelId; private final String channelId;
private final int notificationId; private final int notificationId;
private final MediaDescriptionAdapter mediaDescriptionAdapter; private final MediaDescriptionAdapter mediaDescriptionAdapter;
@Nullable private final NotificationListener notificationListener;
@Nullable private final CustomActionReceiver customActionReceiver; @Nullable private final CustomActionReceiver customActionReceiver;
private final Handler mainHandler; private final Handler mainHandler;
private final NotificationManagerCompat notificationManager; private final NotificationManagerCompat notificationManager;
...@@ -663,7 +645,6 @@ public class PlayerNotificationManager { ...@@ -663,7 +645,6 @@ public class PlayerNotificationManager {
private ControlDispatcher controlDispatcher; private ControlDispatcher controlDispatcher;
private boolean isNotificationStarted; private boolean isNotificationStarted;
private int currentNotificationTag; private int currentNotificationTag;
@Nullable private NotificationListener notificationListener;
@Nullable private MediaSessionCompat.Token mediaSessionToken; @Nullable private MediaSessionCompat.Token mediaSessionToken;
private boolean usePreviousAction; private boolean usePreviousAction;
private boolean useNextAction; private boolean useNextAction;
...@@ -963,21 +944,6 @@ public class PlayerNotificationManager { ...@@ -963,21 +944,6 @@ public class PlayerNotificationManager {
} }
/** /**
* Sets the {@link NotificationListener}.
*
* <p>Please note that you should call this method before you call {@link #setPlayer(Player)} or
* you may not get the {@link NotificationListener#onNotificationStarted(int, Notification)}
* called on your listener.
*
* @param notificationListener The {@link NotificationListener}.
* @deprecated Pass the notification listener to the constructor instead.
*/
@Deprecated
public final void setNotificationListener(NotificationListener notificationListener) {
this.notificationListener = notificationListener;
}
/**
* @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link * @deprecated Use {@link #setControlDispatcher(ControlDispatcher)} with {@link
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}. * DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
*/ */
...@@ -1290,8 +1256,6 @@ public class PlayerNotificationManager { ...@@ -1290,8 +1256,6 @@ public class PlayerNotificationManager {
} }
} }
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings("deprecation")
private void startOrUpdateNotification(Player player, @Nullable Bitmap bitmap) { private void startOrUpdateNotification(Player player, @Nullable Bitmap bitmap) {
boolean ongoing = getOngoing(player); boolean ongoing = getOngoing(player);
builder = createNotification(player, builder, ongoing, bitmap); builder = createNotification(player, builder, ongoing, bitmap);
...@@ -1303,22 +1267,16 @@ public class PlayerNotificationManager { ...@@ -1303,22 +1267,16 @@ public class PlayerNotificationManager {
notificationManager.notify(notificationId, notification); notificationManager.notify(notificationId, notification);
if (!isNotificationStarted) { if (!isNotificationStarted) {
context.registerReceiver(notificationBroadcastReceiver, intentFilter); context.registerReceiver(notificationBroadcastReceiver, intentFilter);
if (notificationListener != null) {
notificationListener.onNotificationStarted(notificationId, notification);
}
} }
@Nullable NotificationListener listener = notificationListener; if (notificationListener != null) {
if (listener != null) {
// Always pass true for ongoing with the first notification to tell a service to go into // Always pass true for ongoing with the first notification to tell a service to go into
// foreground even when paused. // foreground even when paused.
listener.onNotificationPosted( notificationListener.onNotificationPosted(
notificationId, notification, ongoing || !isNotificationStarted); notificationId, notification, ongoing || !isNotificationStarted);
} }
isNotificationStarted = true; isNotificationStarted = true;
} }
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings("deprecation")
private void stopNotification(boolean dismissedByUser) { private void stopNotification(boolean dismissedByUser) {
if (isNotificationStarted) { if (isNotificationStarted) {
isNotificationStarted = false; isNotificationStarted = false;
...@@ -1327,7 +1285,6 @@ public class PlayerNotificationManager { ...@@ -1327,7 +1285,6 @@ public class PlayerNotificationManager {
context.unregisterReceiver(notificationBroadcastReceiver); context.unregisterReceiver(notificationBroadcastReceiver);
if (notificationListener != null) { if (notificationListener != null) {
notificationListener.onNotificationCancelled(notificationId, dismissedByUser); notificationListener.onNotificationCancelled(notificationId, dismissedByUser);
notificationListener.onNotificationCancelled(notificationId);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment