mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove IntRange from Player.getMediaItemAt
No other index-related methods in Player are annotated, it's considered obvious that these should be >=0. PiperOrigin-RevId: 405882756
This commit is contained in:
parent
d39ffa5a34
commit
60a68f8891
@ -2175,7 +2175,7 @@ public interface Player {
|
|||||||
int getMediaItemCount();
|
int getMediaItemCount();
|
||||||
|
|
||||||
/** Returns the {@link MediaItem} at the given index. */
|
/** Returns the {@link MediaItem} at the given index. */
|
||||||
MediaItem getMediaItemAt(@IntRange(from = 0) int index);
|
MediaItem getMediaItemAt(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the duration of the current content or ad in milliseconds, or {@link C#TIME_UNSET} if
|
* Returns the duration of the current content or ad in milliseconds, or {@link C#TIME_UNSET} if
|
||||||
|
@ -35,6 +35,7 @@ import android.view.SurfaceHolder;
|
|||||||
import android.view.SurfaceView;
|
import android.view.SurfaceView;
|
||||||
import android.view.TextureView;
|
import android.view.TextureView;
|
||||||
import androidx.annotation.FloatRange;
|
import androidx.annotation.FloatRange;
|
||||||
|
import androidx.annotation.IntRange;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import androidx.media3.common.AudioAttributes;
|
import androidx.media3.common.AudioAttributes;
|
||||||
@ -676,6 +677,7 @@ public class MediaController implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@IntRange(from = 0, to = 100)
|
||||||
public int getBufferedPercentage() {
|
public int getBufferedPercentage() {
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
return isConnected() ? impl.getBufferedPercentage() : 0;
|
return isConnected() ? impl.getBufferedPercentage() : 0;
|
||||||
@ -1627,6 +1629,7 @@ public class MediaController implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@IntRange(from = 0)
|
||||||
public int getDeviceVolume() {
|
public int getDeviceVolume() {
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
if (!isConnected()) {
|
if (!isConnected()) {
|
||||||
@ -1645,7 +1648,7 @@ public class MediaController implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDeviceVolume(int volume) {
|
public void setDeviceVolume(@IntRange(from = 0) int volume) {
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
if (!isConnected()) {
|
if (!isConnected()) {
|
||||||
Log.w(TAG, "The controller is not connected. Ignoring setDeviceVolume().");
|
Log.w(TAG, "The controller is not connected. Ignoring setDeviceVolume().");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user