Merge "Fix erroneous "Field requires API level 33 (current min is 32)" warnings" am: fcf0b686aa am: 587f8c3425

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2072628

Change-Id: I7cc60174e9e525181cbf51dfd20e2e3e89f5c241
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-04-27 23:30:58 +00:00
committed by Automerger Merge Worker
3 changed files with 38 additions and 10 deletions

View File

@@ -54,6 +54,14 @@ type ApiLevel struct {
isPreview bool
}
func (this ApiLevel) FinalInt() int {
if this.IsPreview() {
panic("Requested a final int from a non-final ApiLevel")
} else {
return this.number
}
}
func (this ApiLevel) FinalOrFutureInt() int {
if this.IsPreview() {
return FutureApiLevelInt