Deprecated onTransformationError methods are not called.
When a listener method is deprecated, the new method should (by default) called through to the deprecated one. This is because any class that implements the method that is now deprecated needs to still receive that callback. It appears when onTransformationError(MediaItem, Exception) was deprecated in favour of onTransformationError(MediaItem, TransformationException), this deprecation was the wrong way round, and the newer callback - onTransformationError(MediaItem, TransformationResult, TransformationException) continued this mistake. This CL now corrects this. PiperOrigin-RevId: 498221504
This commit is contained in:
parent
310434a8f9
commit
4541db3541
@ -498,10 +498,9 @@ public final class Transformer {
|
|||||||
* Called when the transformation is completed successfully.
|
* Called when the transformation is completed successfully.
|
||||||
*
|
*
|
||||||
* @param inputMediaItem The {@link MediaItem} for which the transformation is completed.
|
* @param inputMediaItem The {@link MediaItem} for which the transformation is completed.
|
||||||
* @param transformationResult The {@link TransformationResult} of the transformation.
|
* @param result The {@link TransformationResult} of the transformation.
|
||||||
*/
|
*/
|
||||||
default void onTransformationCompleted(
|
default void onTransformationCompleted(MediaItem inputMediaItem, TransformationResult result) {
|
||||||
MediaItem inputMediaItem, TransformationResult transformationResult) {
|
|
||||||
onTransformationCompleted(inputMediaItem);
|
onTransformationCompleted(inputMediaItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,9 +509,7 @@ public final class Transformer {
|
|||||||
* TransformationException)}.
|
* TransformationException)}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
default void onTransformationError(MediaItem inputMediaItem, Exception exception) {
|
default void onTransformationError(MediaItem inputMediaItem, Exception exception) {}
|
||||||
onTransformationError(inputMediaItem, (TransformationException) exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #onTransformationError(MediaItem, TransformationResult,
|
* @deprecated Use {@link #onTransformationError(MediaItem, TransformationResult,
|
||||||
@ -521,7 +518,7 @@ public final class Transformer {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
default void onTransformationError(
|
default void onTransformationError(
|
||||||
MediaItem inputMediaItem, TransformationException exception) {
|
MediaItem inputMediaItem, TransformationException exception) {
|
||||||
onTransformationError(inputMediaItem, new TransformationResult.Builder().build(), exception);
|
onTransformationError(inputMediaItem, (Exception) exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -532,7 +529,9 @@ public final class Transformer {
|
|||||||
* @param exception The {@link TransformationException} describing the exception.
|
* @param exception The {@link TransformationException} describing the exception.
|
||||||
*/
|
*/
|
||||||
default void onTransformationError(
|
default void onTransformationError(
|
||||||
MediaItem inputMediaItem, TransformationResult result, TransformationException exception) {}
|
MediaItem inputMediaItem, TransformationResult result, TransformationException exception) {
|
||||||
|
onTransformationError(inputMediaItem, exception);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when fallback to an alternative {@link TransformationRequest} is necessary to comply
|
* Called when fallback to an alternative {@link TransformationRequest} is necessary to comply
|
||||||
|
Loading…
x
Reference in New Issue
Block a user