summaryrefslogtreecommitdiff
path: root/android/api_levels.go
diff options
context:
space:
mode:
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