178cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka/* 278cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * Copyright (C) 2014 The Android Open Source Project 378cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * 478cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * Licensed under the Apache License, Version 2.0 (the "License"); 578cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * you may not use this file except in compliance with the License. 678cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * You may obtain a copy of the License at 778cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * 878cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * http://www.apache.org/licenses/LICENSE-2.0 978cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * 1078cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * Unless required by applicable law or agreed to in writing, software 1178cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * distributed under the License is distributed on an "AS IS" BASIS, 1278cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1378cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * See the License for the specific language governing permissions and 1478cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * limitations under the License. 1578cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka */ 1678cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka 1778cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaokapackage com.android.inputmethod.compat; 1878cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka 1978cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaokaimport android.os.Build; 2078cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka 2178cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaokapublic final class BuildCompatUtils { 2278cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka private BuildCompatUtils() { 2378cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka // This utility class is not publicly instantiable. 2478cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka } 2578cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka 2678cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka private static final boolean IS_RELEASE_BUILD = Build.VERSION.CODENAME.equals("REL"); 2778cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka 2878cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka /** 2978cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * The "effective" API version. 3078cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * {@link android.os.Build.VERSION#SDK_INT} if the platform is a release build. 3178cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka * {@link android.os.Build.VERSION#SDK_INT} plus 1 if the platform is a development build. 3278cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka */ 3378cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka public static final int EFFECTIVE_SDK_INT = IS_RELEASE_BUILD 3478cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka ? Build.VERSION.SDK_INT 3578cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka : Build.VERSION.SDK_INT + 1; 3678cff10f8d317641dd3531cce04e74502be8ad44Tadashi G. Takaoka} 37