MediaPlayer2: make TrackInfo.getLanguage return NonNull

Test: cts
Bug: 126702181
Change-Id: I27f03343ee905e46ab48e5667b0ed928cadf772c
This commit is contained in:
Wei Jia
2019-03-07 16:32:46 -08:00
parent 6693dc9375
commit 43f7b8a280
2 changed files with 2 additions and 2 deletions

View File

@@ -25735,7 +25735,7 @@ package android.media {
public static class MediaPlayer2.TrackInfo {
method @Nullable public android.media.MediaFormat getFormat();
method @Nullable public String getLanguage();
method @NonNull public String getLanguage();
method public int getTrackType();
field public static final int MEDIA_TRACK_TYPE_AUDIO = 2; // 0x2
field public static final int MEDIA_TRACK_TYPE_METADATA = 5; // 0x5

View File

@@ -1985,7 +1985,7 @@ public class MediaPlayer2 implements AutoCloseable
* When the language is unknown or could not be determined,
* ISO-639-2 language code, "und", is returned.
*/
public @Nullable String getLanguage() {
public @NonNull String getLanguage() {
String language = mFormat.getString(MediaFormat.KEY_LANGUAGE);
return language == null ? "und" : language;
}