blob: b22c14396421e2621e0c4db65ec9a1adb89866d5 [file] [log] [blame]
Wenyi Wang6fa570f2015-11-24 15:44:11 -08001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.contacts.common.compat;
17
18import android.os.Build;
19
20import com.android.contacts.common.compat.SdkVersionOverride;
21
22public final class CompatUtils {
23 /**
24 * PrioritizedMimeType is added in API level 23.
25 */
26 public static boolean hasPrioritizedMimeType() {
27 return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M)
28 >= Build.VERSION_CODES.M;
29 }
Nancy Cheneab0b822015-11-25 15:44:48 -080030
31 /**
32 * Determines if this version is compatible with multi-SIM and the phone account APIs.
33 * Can also force the version to be lower through SdkVersionOverride.
34 *
35 * @return {@code true} if multi-SIM capability is available, {@code false} otherwise.
36 */
37 public static boolean isMSIMCompatible() {
38 return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP)
39 >= Build.VERSION_CODES.LOLLIPOP_MR1;
40 }
Nancy Chen5fe647d2015-12-08 16:57:48 -080041
42 /**
43 * Determines if this version is compatible with video calling. Can also force the version to be
44 * lower through SdkVersionOverride.
45 *
46 * @return {@code true} if video calling is allowed, {@code false} otherwise.
47 */
48 public static boolean isVideoCompatible() {
49 return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP)
50 >= Build.VERSION_CODES.M;
51 }
52
53 /**
54 * Determines if this version is compatible with call subject. Can also force the version to
55 * be lower through SdkVersionOverride.
56 *
57 * @return {@code true} if call subject is a feature on this device, {@code false} otherwise.
58 */
59 public static boolean isCallSubjectCompatible() {
60 return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP)
61 >= Build.VERSION_CODES.M;
62 }
Wenyi Wang6fa570f2015-11-24 15:44:11 -080063}