mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix FlagSet.equals on API levels below 24
PiperOrigin-RevId: 395004645
This commit is contained in:
parent
e7a7235a47
commit
b40a6b86d6
@ -5,6 +5,7 @@
|
|||||||
* Core Library:
|
* Core Library:
|
||||||
* Fix track selection in `StyledPlayerControlView` when using
|
* Fix track selection in `StyledPlayerControlView` when using
|
||||||
`ForwardingPlayer`.
|
`ForwardingPlayer`.
|
||||||
|
* Fix `FlagSet#equals` on API levels below 24.
|
||||||
* Extractors:
|
* Extractors:
|
||||||
* Support TS packets without PTS flag
|
* Support TS packets without PTS flag
|
||||||
([#9294](https://github.com/google/ExoPlayer/issues/9294)).
|
([#9294](https://github.com/google/ExoPlayer/issues/9294)).
|
||||||
|
@ -211,11 +211,33 @@ public final class FlagSet {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
FlagSet that = (FlagSet) o;
|
FlagSet that = (FlagSet) o;
|
||||||
return flags.equals(that.flags);
|
if (Util.SDK_INT < 24) {
|
||||||
|
// SparseBooleanArray.equals() is not implemented on API levels below 24.
|
||||||
|
if (size() != that.size()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < size(); i++) {
|
||||||
|
if (get(i) != that.get(i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return flags.equals(that.flags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return flags.hashCode();
|
if (Util.SDK_INT < 24) {
|
||||||
|
// SparseBooleanArray.hashCode() is not implemented on API levels below 24.
|
||||||
|
int hashCode = size();
|
||||||
|
for (int i = 0; i < size(); i++) {
|
||||||
|
hashCode = 31 * hashCode + get(i);
|
||||||
|
}
|
||||||
|
return hashCode;
|
||||||
|
} else {
|
||||||
|
return flags.hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user