Skip to content

Commit

Permalink
Add lint baseline for spurious API-level warnings
Browse files Browse the repository at this point in the history
The API 32 SDK has incorrect versioning metadata for Spatializer. It
reports the whole class has only been present since API 33 (which is
surely impossible given it's present in the API 32 SDK):
https://issuetracker.google.com/234009300

The metadata seems to be correct in the API 33 SDK, so this baseline
will no longer be needed when we bump to `compileSdkVersion = 33`.
  • Loading branch information
icbaker committed Jun 17, 2022
1 parent 460d221 commit 85d8682
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/core/build.gradle
Expand Up @@ -28,6 +28,10 @@ android {
}
}

lint {
baseline = file("lint-baseline.xml")
}

sourceSets {
androidTest.assets.srcDir '../../testdata/src/test/assets/'
test.assets.srcDir '../../testdata/src/test/assets/'
Expand Down
125 changes: 125 additions & 0 deletions library/core/lint-baseline.xml
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 7.2.1" type="baseline" client="gradle" dependencies="false" name="AGP (7.2.1)" variant="all" version="7.2.1">

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.AudioManager#getSpatializer`"
errorLine1=" return audioManager == null ? null : new SpatializerWrapperV32(audioManager.getSpatializer());"
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3639"
column="83"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.Spatializer#getImmersiveAudioLevel`"
errorLine1=" spatializer.getImmersiveAudioLevel() != Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3645"
column="23"/>
</issue>

<issue
id="NewApi"
message="Cast to `OnSpatializerStateChangedListener` requires API level 33 (current min is 32)"
errorLine1=" new Spatializer.OnSpatializerStateChangedListener() {"
errorLine2=" ^">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3653"
column="11"/>
</issue>

<issue
id="NewApi"
message="Class requires API level 33 (current min is 32): `android.media.Spatializer.OnSpatializerStateChangedListener`"
errorLine1=" new Spatializer.OnSpatializerStateChangedListener() {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3653"
column="15"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.Spatializer#addOnSpatializerStateChangedListener`"
errorLine1=" spatializer.addOnSpatializerStateChangedListener(handler::post, listener);"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3665"
column="19"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.Spatializer#isAvailable`"
errorLine1=" return spatializer.isAvailable();"
errorLine2=" ~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3673"
column="26"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.Spatializer#isEnabled`"
errorLine1=" return spatializer.isEnabled();"
errorLine2=" ~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3677"
column="26"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.Spatializer#canBeSpatialized`"
errorLine1=" return spatializer.canBeSpatialized("
errorLine2=" ~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3695"
column="26"/>
</issue>

<issue
id="NewApi"
message="Call requires API level 33 (current min is 32): `android.media.Spatializer#removeOnSpatializerStateChangedListener`"
errorLine1=" spatializer.removeOnSpatializerStateChangedListener(listener);"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3703"
column="19"/>
</issue>

<issue
id="Override"
message="This method is not overriding anything with the current build target, but will in API level 33 (current target is 32): `null#onSpatializerEnabledChanged`"
errorLine1=" public void onSpatializerEnabledChanged(Spatializer spatializer, boolean enabled) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3655"
column="25"/>
</issue>

<issue
id="Override"
message="This method is not overriding anything with the current build target, but will in API level 33 (current target is 32): `null#onSpatializerAvailableChanged`"
errorLine1=" public void onSpatializerAvailableChanged(Spatializer spatializer, boolean available) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java"
line="3660"
column="25"/>
</issue>

</issues>

0 comments on commit 85d8682

Please sign in to comment.