Remove some long deprecated methods

PiperOrigin-RevId: 369626542
This commit is contained in:
olly 2021-04-21 12:07:41 +01:00 committed by Oliver Woodman
parent 7d4a013c80
commit a78b18298b
5 changed files with 18 additions and 93 deletions

View file

@ -87,6 +87,21 @@
module instead.
* Remove `DefaultMediaSourceEventListener`. Use `MediaSourceEventListener`
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:
* Only dispatch DRM session acquire and release events once per period
when playing content that uses the same encryption keys for both audio &

View file

@ -121,12 +121,6 @@ public final class CryptoInfo {
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}.
*

View file

@ -63,14 +63,6 @@ public final class NotificationUtil {
/** @see 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
* NotificationChannel} and {@link

View file

@ -93,39 +93,6 @@ public class DashManifest implements FilterableManifest<DashManifest> {
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(
long availabilityStartTimeMs,
long durationMs,

View file

@ -260,25 +260,6 @@ public class PlayerNotificationManager {
/** A listener for changes to the notification. */
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.
*
@ -644,6 +625,7 @@ public class PlayerNotificationManager {
private final String channelId;
private final int notificationId;
private final MediaDescriptionAdapter mediaDescriptionAdapter;
@Nullable private final NotificationListener notificationListener;
@Nullable private final CustomActionReceiver customActionReceiver;
private final Handler mainHandler;
private final NotificationManagerCompat notificationManager;
@ -663,7 +645,6 @@ public class PlayerNotificationManager {
private ControlDispatcher controlDispatcher;
private boolean isNotificationStarted;
private int currentNotificationTag;
@Nullable private NotificationListener notificationListener;
@Nullable private MediaSessionCompat.Token mediaSessionToken;
private boolean usePreviousAction;
private boolean useNextAction;
@ -962,21 +943,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
* DefaultControlDispatcher#DefaultControlDispatcher(long, long)}.
@ -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) {
boolean ongoing = getOngoing(player);
builder = createNotification(player, builder, ongoing, bitmap);
@ -1303,22 +1267,16 @@ public class PlayerNotificationManager {
notificationManager.notify(notificationId, notification);
if (!isNotificationStarted) {
context.registerReceiver(notificationBroadcastReceiver, intentFilter);
if (notificationListener != null) {
notificationListener.onNotificationStarted(notificationId, notification);
}
}
@Nullable NotificationListener listener = notificationListener;
if (listener != null) {
if (notificationListener != null) {
// Always pass true for ongoing with the first notification to tell a service to go into
// foreground even when paused.
listener.onNotificationPosted(
notificationListener.onNotificationPosted(
notificationId, notification, ongoing || !isNotificationStarted);
}
isNotificationStarted = true;
}
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings("deprecation")
private void stopNotification(boolean dismissedByUser) {
if (isNotificationStarted) {
isNotificationStarted = false;
@ -1327,7 +1285,6 @@ public class PlayerNotificationManager {
context.unregisterReceiver(notificationBroadcastReceiver);
if (notificationListener != null) {
notificationListener.onNotificationCancelled(notificationId, dismissedByUser);
notificationListener.onNotificationCancelled(notificationId);
}
}
}