summaryrefslogtreecommitdiff
path: root/java/com/android/contacts/common
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2020-05-18 15:51:25 -0700
committerMichael Bestas <mkbestas@lineageos.org>2020-12-12 01:23:35 +0200
commit1efec636c8f9ae15cfd0b911a1f9640358afbbda (patch)
tree7d610d016e6e9830aff728d1c0b9206c45992d1b /java/com/android/contacts/common
parent9f88668f19c42262e9f3a3bca382d51dac7a5672 (diff)
Updated target SDK from 28 to 29.
Merged the following change from internal source: cl/305938566 Do not use EXTRA_IS_HANDOVER for API levels 28 and above When targeting API level 29, this field becomes blacklisted. Since the Handover feature is officially supported via a public API since API level 28, we do not need to check for the internal field when the API level is 28+. go/forrest_run/L11100000565062425 BUG: 143990966 Test: manual and CTS tests. Change-Id: Ib3fda29b4d5714efc52b29f49ca4a9a310584fff
Diffstat (limited to 'java/com/android/contacts/common')
-rw-r--r--java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java b/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java
index ca8ed29ec..a1dc89d75 100644
--- a/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java
+++ b/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java
@@ -15,6 +15,8 @@
*/
package com.android.contacts.common.compat.telecom;
+import android.os.Build.VERSION;
+import android.os.Build.VERSION_CODES;
import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
@@ -50,13 +52,16 @@ public class TelecomManagerCompat {
return null;
}
- /**
- * Handovers are supported from Android O-DR onward. Since there is no API bump from O to O-DR, we
- * need to use reflection to check the existence of TelecomManager.EXTRA_IS_HANDOVER in
- * http://cs/android/frameworks/base/telecomm/java/android/telecom/TelecomManager.java.
- */
+ /** Returns true if the Android version supports Handover. */
public static boolean supportsHandover() {
- //
+ // Starting with Android P, handover is supported via a public API.
+ if (VERSION.SDK_INT >= VERSION_CODES.P) {
+ return true;
+ }
+ // Handovers are supported from Android O-DR onward. Since there is no API
+ // bump from O to O-DR, we need to use reflection to check the existence
+ // of TelecomManager.EXTRA_IS_HANDOVER in
+ // http://cs/android/frameworks/base/telecomm/java/android/telecom/TelecomManager.java.
try {
Field field = TelecomManager.class.getDeclaredField("EXTRA_IS_HANDOVER");
return "android.telecom.extra.IS_HANDOVER".equals(field.get(null /* obj (static field) */));