summaryrefslogtreecommitdiff
path: root/android/api_levels.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2022-07-01 22:48:49 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-07-01 22:48:49 +0000
commit100c7ad7f28c44ca9110f73b9886c22d00a005d1 (patch)
treec65fbfd1022bfec3bfdbd18c818a16f45249763d /android/api_levels.go
parent4b1fe58b7deca2e581b9e2df1a706f687006b4f8 (diff)
parente5bf3fb4c2ef475051ef74b29ef732118b8766bf (diff)
Merge "Revert^2 "Fix erroneous "Field requires API level 33 (current min is 32)" warnings""
Diffstat (limited to 'android/api_levels.go')
-rw-r--r--android/api_levels.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/android/api_levels.go b/android/api_levels.go
index 41b338c8a..da50b1927 100644
--- a/android/api_levels.go
+++ b/android/api_levels.go
@@ -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