From 6a4e9d87031f1f803ce9b64844f71c73e9502a7e Mon Sep 17 00:00:00 2001 From: Sailesh Nepal Date: Sat, 20 Feb 2016 15:54:49 -0800 Subject: Remove Lollipop support for InCallUI This CL removes support for running dialer on Android L MR1. The change allows us to switch from the system SDK to the public SDK. This is useful for the following reasons: - makes it easier to switch to gradle - makes it easier to migrate GoogleDialer to google3 - reduces maintenance overhead for unused code Currently there's no plan to release Dialer on Lollipop. If or when we decide to support Lollipop we can consider switching back to the system SDK and restoring the comapatiblity code. Bug: 26676586 Change-Id: Idac9e6e19f1d21c9261c1b0d0ff3e3ca4aab980b --- Android.mk | 4 +- InCallUI/src/com/android/incallui/Call.java | 108 ++-------------- .../com/android/incallui/CallButtonPresenter.java | 2 +- .../com/android/incallui/CallCardPresenter.java | 7 +- .../incallui/ConferenceParticipantListAdapter.java | 6 +- .../src/com/android/incallui/InCallActivity.java | 7 +- .../src/com/android/incallui/InCallPresenter.java | 121 +++++------------- .../com/android/incallui/InCallServiceImpl.java | 86 ------------- .../src/com/android/incallui/TelecomAdapter.java | 20 ++- .../com/android/incallui/VideoCallPresenter.java | 23 ++-- InCallUI/src/com/android/incallui/VideoUtils.java | 11 +- .../incallui/compat/telecom/DetailsCompat.java | 108 ---------------- .../compat/telecom/InCallServiceCompat.java | 97 -------------- .../compat/telecom/VideoProfileCompat.java | 140 --------------------- 14 files changed, 74 insertions(+), 666 deletions(-) delete mode 100644 InCallUI/src/com/android/incallui/compat/telecom/DetailsCompat.java delete mode 100644 InCallUI/src/com/android/incallui/compat/telecom/InCallServiceCompat.java delete mode 100644 InCallUI/src/com/android/incallui/compat/telecom/VideoProfileCompat.java diff --git a/Android.mk b/Android.mk index 4c67293ad..eb6cbdc37 100644 --- a/Android.mk +++ b/Android.mk @@ -64,9 +64,7 @@ LOCAL_PRIVILEGED_MODULE := true LOCAL_PROGUARD_FLAG_FILES := proguard.flags $(incallui_dir)/proguard.flags -# Uncomment the following line to build against the current SDK -# This is required for building an unbundled app. -LOCAL_SDK_VERSION := system_current +LOCAL_SDK_VERSION := current include $(BUILD_PACKAGE) diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index aec806f1e..54ec52829 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -19,9 +19,9 @@ package com.android.incallui; import android.content.Context; import android.hardware.camera2.CameraCharacteristics; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.os.Trace; +import android.telecom.Call.Details; import android.telecom.Connection; import android.telecom.DisconnectCause; import android.telecom.GatewayInfo; @@ -37,8 +37,6 @@ import com.android.contacts.common.compat.SdkVersionOverride; import com.android.contacts.common.compat.telecom.TelecomManagerCompat; import com.android.contacts.common.testing.NeededForTesting; import com.android.dialer.util.IntentUtil; -import com.android.incallui.compat.telecom.DetailsCompat; -import com.android.incallui.compat.telecom.VideoProfileCompat; import com.android.incallui.util.TelecomCallUtil; import java.util.ArrayList; @@ -291,18 +289,8 @@ public class Call { private static final String ID_PREFIX = Call.class.getSimpleName() + "_"; private static int sIdCounter = 0; - private Object mTelecomCallCallback = newTelecomCallCallback(); - - private Object newTelecomCallCallback() { - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - return newMarshmallowTelecomCallCallback(); - } - return newLollipopTelecomCallCallback(); - } - - private Object newMarshmallowTelecomCallCallback() { - Log.i(this, "Using an android.telecom.Call$Callback"); - return new android.telecom.Call.Callback() { + private final android.telecom.Call.Callback mTelecomCallCallback = + new android.telecom.Call.Callback() { @Override public void onStateChanged(android.telecom.Call call, int newState) { Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " newState=" @@ -367,81 +355,7 @@ public class Call { List conferenceableCalls) { update(); } - }; - } - - private Object newLollipopTelecomCallCallback() { - // This code only runs for Google Experience phones on the pre-M sdk since only the system - // dialer can invoke the InCallUI code. This allows us to safely use the - // android.telecom.Call.Listener interface - Log.i(this, "Using an android.telecom.Call$Listener"); - return new android.telecom.Call.Listener() { - @Override - public void onStateChanged(android.telecom.Call call, int newState) { - Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " newState=" - + newState); - update(); - } - - @Override - public void onParentChanged(android.telecom.Call call, - android.telecom.Call newParent) { - Log.d(this, "TelecomCallCallback onParentChanged call=" + call + " newParent=" - + newParent); - update(); - } - - @Override - public void onChildrenChanged(android.telecom.Call call, - List children) { - update(); - } - - @Override - public void onDetailsChanged(android.telecom.Call call, - android.telecom.Call.Details details) { - Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " details=" - + details); - update(); - } - - @Override - public void onCannedTextResponsesLoaded(android.telecom.Call call, - List cannedTextResponses) { - Log.d(this, "TelecomCallCallback onStateChanged call=" + call - + " cannedTextResponses=" + cannedTextResponses); - update(); - } - - @Override - public void onPostDialWait(android.telecom.Call call, - String remainingPostDialSequence) { - Log.d(this, "TelecomCallCallback onStateChanged call=" + call - + " remainingPostDialSequence=" + remainingPostDialSequence); - update(); - } - - @Override - public void onVideoCallChanged(android.telecom.Call call, - VideoCall videoCall) { - Log.d(this, "TelecomCallCallback onStateChanged call=" + call + " videoCall=" - + videoCall); - update(); - } - - @Override - public void onCallDestroyed(android.telecom.Call call) { - Log.d(this, "TelecomCallCallback onStateChanged call=" + call); - call.removeListener(this); - } - - @Override - public void onConferenceableCallsChanged(android.telecom.Call call, - List conferenceableCalls) { - update(); - } - }; - } + }; private android.telecom.Call mTelecomCall; private boolean mIsEmergencyCall; @@ -491,11 +405,7 @@ public class Call { updateFromTelecomCall(); - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - mTelecomCall.registerCallback((android.telecom.Call.Callback) mTelecomCallCallback); - } else { - mTelecomCall.addListener((android.telecom.Call.Listener) mTelecomCallCallback); - } + mTelecomCall.registerCallback(mTelecomCallCallback); mTimeAddedMs = System.currentTimeMillis(); } @@ -750,7 +660,7 @@ public class Call { } public Bundle getIntentExtras() { - return DetailsCompat.getIntentExtras(mTelecomCall.getDetails()); + return mTelecomCall.getDetails().getIntentExtras(); } public Bundle getExtras() { @@ -824,7 +734,7 @@ public class Call { } public boolean hasProperty(int property) { - return DetailsCompat.hasProperty(mTelecomCall.getDetails(), property); + return mTelecomCall.getDetails().hasProperty(property); } /** Gets the time when the call first became active. */ @@ -989,11 +899,11 @@ public class Call { "videoState:%s, mSessionModificationState:%d, VideoSettings:%s]", mId, State.toString(getState()), - DetailsCompat.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), + Details.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), mChildCallIds, getParentId(), this.mTelecomCall.getConferenceableCalls(), - VideoProfileCompat.videoStateToString(mTelecomCall.getDetails().getVideoState()), + VideoProfile.videoStateToString(mTelecomCall.getDetails().getVideoState()), mSessionModificationState, getVideoSettings()); } diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index dde62954f..fd0dd7639 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -380,7 +380,7 @@ public class CallButtonPresenter extends Presenter updatePrimaryCallState(); if (call.can(Details.CAPABILITY_MANAGE_CONFERENCE) != - DetailsCompat.can(details, Details.CAPABILITY_MANAGE_CONFERENCE)) { + details.can(Details.CAPABILITY_MANAGE_CONFERENCE)) { maybeShowManageConferenceCallButton(); } } @@ -1112,8 +1111,8 @@ public class CallCardPresenter extends Presenter } private static boolean hasCallSubject(Call call) { - return !TextUtils.isEmpty(DetailsCompat.getIntentExtras( - call.getTelecomCall().getDetails()).getString(TelecomManager.EXTRA_CALL_SUBJECT)); + return !TextUtils.isEmpty(call.getTelecomCall().getDetails().getIntentExtras() + .getString(TelecomManager.EXTRA_CALL_SUBJECT)); } public interface CallCardUi extends Ui { diff --git a/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java b/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java index 86002b0d7..9d7069d1c 100644 --- a/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java +++ b/InCallUI/src/com/android/incallui/ConferenceParticipantListAdapter.java @@ -38,7 +38,6 @@ import com.android.contacts.common.compat.PhoneNumberUtilsCompat; import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.incallui.ContactInfoCache.ContactCacheEntry; -import com.android.incallui.compat.telecom.DetailsCompat; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -356,10 +355,9 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { new ContactLookupCallback(this)); } - boolean thisRowCanSeparate = mParentCanSeparate && DetailsCompat.can( - call.getTelecomCall().getDetails(), + boolean thisRowCanSeparate = mParentCanSeparate && call.getTelecomCall().getDetails().can( android.telecom.Call.Details.CAPABILITY_SEPARATE_FROM_CONFERENCE); - boolean thisRowCanDisconnect = DetailsCompat.can(call.getTelecomCall().getDetails(), + boolean thisRowCanDisconnect = call.getTelecomCall().getDetails().can( android.telecom.Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE); setCallerInfoForRow(result, contactCache.namePrimary, diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java index 73155a460..dec1323b2 100644 --- a/InCallUI/src/com/android/incallui/InCallActivity.java +++ b/InCallUI/src/com/android/incallui/InCallActivity.java @@ -58,7 +58,6 @@ import com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.Selec import com.android.dialer.logging.Logger; import com.android.dialer.logging.ScreenEvent; import com.android.incallui.Call.State; -import com.android.incallui.compat.telecom.DetailsCompat; import com.android.incallui.util.AccessibilityUtil; import com.android.phone.common.animation.AnimUtils; import com.android.phone.common.animation.AnimationListenerAdapter; @@ -573,7 +572,7 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD Bundle extras = null; if (call != null) { - extras = DetailsCompat.getIntentExtras(call.getTelecomCall().getDetails()); + extras = call.getTelecomCall().getDetails().getIntentExtras(); } if (extras == null) { // Initialize the extras bundle to avoid NPE @@ -610,8 +609,8 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD Call pendingAccountSelectionCall = CallList.getInstance().getWaitingForAccountCall(); if (pendingAccountSelectionCall != null) { showCallCardFragment(false); - Bundle extras = DetailsCompat.getIntentExtras(pendingAccountSelectionCall - .getTelecomCall().getDetails()); + Bundle extras = + pendingAccountSelectionCall.getTelecomCall().getDetails().getIntentExtras(); final List phoneAccountHandles; if (extras != null) { diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index c51a561bf..249071faa 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -25,7 +25,6 @@ import android.content.Intent; import android.content.res.Resources; import android.database.ContentObserver; import android.graphics.Point; -import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.provider.CallLog; @@ -56,7 +55,6 @@ import com.android.dialer.filterednumber.FilteredNumbersUtil; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; import com.android.dialer.util.TelecomUtil; -import com.android.incallui.compat.telecom.DetailsCompat; import com.android.incallui.util.TelecomCallUtil; import com.android.incalluibind.ObjectFactory; @@ -139,89 +137,38 @@ public class InCallPresenter implements CallList.Listener, */ private boolean mIsFullScreen = false; - private final Object mCallCallback = newTelecomCallCallback(); - - private Object newTelecomCallCallback() { - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - return newMarshmallowTelecomCallCallback(); - } - return newLollipopTelecomCallCallback(); - } - - private Object newMarshmallowTelecomCallCallback() { - Log.i(this, "Using android.telecom.Call.Callback"); - return new android.telecom.Call.Callback() { - @Override - public void onPostDialWait(android.telecom.Call telecomCall, - String remainingPostDialSequence) { - final Call call = mCallList.getCallByTelecomCall(telecomCall); - if (call == null) { - Log.w(this, "Call not found in call list: " + telecomCall); - return; - } - onPostDialCharWait(call.getId(), remainingPostDialSequence); - } - - @Override - public void onDetailsChanged(android.telecom.Call telecomCall, - android.telecom.Call.Details details) { - final Call call = mCallList.getCallByTelecomCall(telecomCall); - if (call == null) { - Log.w(this, "Call not found in call list: " + telecomCall); - return; - } - for (InCallDetailsListener listener : mDetailsListeners) { - listener.onDetailsChanged(call, details); - } - } - - @Override - public void onConferenceableCallsChanged(android.telecom.Call telecomCall, - List conferenceableCalls) { - Log.i(this, "onConferenceableCallsChanged: " + telecomCall); - onDetailsChanged(telecomCall, telecomCall.getDetails()); + private final android.telecom.Call.Callback mCallCallback = new android.telecom.Call.Callback() { + @Override + public void onPostDialWait(android.telecom.Call telecomCall, + String remainingPostDialSequence) { + final Call call = mCallList.getCallByTelecomCall(telecomCall); + if (call == null) { + Log.w(this, "Call not found in call list: " + telecomCall); + return; } - }; - } + onPostDialCharWait(call.getId(), remainingPostDialSequence); + } - private Object newLollipopTelecomCallCallback() { - // This code only runs for Google Experience phones on the pre-M sdk since only the system - // dialer can invoke the InCallUI code. This allows us to safely use the - // android.telecom.Call.Listener interface - Log.i(this, "Using android.telecom.Call.Listener"); - return new android.telecom.Call.Listener() { - @Override - public void onPostDialWait(android.telecom.Call telecomCall, - String remainingPostDialSequence) { - final Call call = mCallList.getCallByTelecomCall(telecomCall); - if (call == null) { - Log.w(this, "Call not found in call list: " + telecomCall); - return; - } - onPostDialCharWait(call.getId(), remainingPostDialSequence); + @Override + public void onDetailsChanged(android.telecom.Call telecomCall, + android.telecom.Call.Details details) { + final Call call = mCallList.getCallByTelecomCall(telecomCall); + if (call == null) { + Log.w(this, "Call not found in call list: " + telecomCall); + return; } - - @Override - public void onDetailsChanged(android.telecom.Call telecomCall, - android.telecom.Call.Details details) { - final Call call = mCallList.getCallByTelecomCall(telecomCall); - if (call == null) { - Log.w(this, "Call not found in call list: " + telecomCall); - return; - } - for (InCallDetailsListener listener : mDetailsListeners) { - listener.onDetailsChanged(call, details); - } + for (InCallDetailsListener listener : mDetailsListeners) { + listener.onDetailsChanged(call, details); } + } - @Override - public void onConferenceableCallsChanged(android.telecom.Call telecomCall, - List conferenceableCalls) { - Log.i(this, "onConferenceableCallsChanged: " + telecomCall); - onDetailsChanged(telecomCall, telecomCall.getDetails()); - } - }; - } + @Override + public void onConferenceableCallsChanged(android.telecom.Call telecomCall, + List conferenceableCalls) { + Log.i(this, "onConferenceableCallsChanged: " + telecomCall); + onDetailsChanged(telecomCall, telecomCall.getDetails()); + } + }; private PhoneStateListener mPhoneStateListener = new PhoneStateListener() { public void onCallStateChanged(int state, String incomingNumber) { @@ -559,11 +506,7 @@ public class InCallPresenter implements CallList.Listener, // Since a call has been added we are no longer waiting for Telecom to send us a call. setBoundAndWaitingForOutgoingCall(false, null); - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - call.registerCallback((android.telecom.Call.Callback) mCallCallback); - } else { - call.addListener((android.telecom.Call.Listener) mCallCallback); - } + call.registerCallback(mCallCallback); } /** @@ -632,11 +575,7 @@ public class InCallPresenter implements CallList.Listener, public void onCallRemoved(android.telecom.Call call) { mCallList.onCallRemoved(call); - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - call.unregisterCallback((android.telecom.Call.Callback) mCallCallback); - } else { - call.removeListener((android.telecom.Call.Listener) mCallCallback); - } + call.unregisterCallback(mCallCallback); } public void onCanAddCallChanged(boolean canAddCall) { @@ -1470,7 +1409,7 @@ public class InCallPresenter implements CallList.Listener, private void setDisconnectCauseForMissingAccounts(Call call) { android.telecom.Call telecomCall = call.getTelecomCall(); - Bundle extras = DetailsCompat.getIntentExtras(telecomCall.getDetails()); + Bundle extras = telecomCall.getDetails().getIntentExtras(); // Initialize the extras bundle to avoid NPE if (extras == null) { extras = new Bundle(); diff --git a/InCallUI/src/com/android/incallui/InCallServiceImpl.java b/InCallUI/src/com/android/incallui/InCallServiceImpl.java index 31d6efb92..86936973e 100644 --- a/InCallUI/src/com/android/incallui/InCallServiceImpl.java +++ b/InCallUI/src/com/android/incallui/InCallServiceImpl.java @@ -18,15 +18,10 @@ package com.android.incallui; import android.content.Context; import android.content.Intent; -import android.os.Build; import android.os.IBinder; -import android.telecom.AudioState; import android.telecom.Call; import android.telecom.CallAudioState; import android.telecom.InCallService; -import android.telecom.Phone; - -import com.android.contacts.common.compat.SdkVersionOverride; /** * Used to receive updates about calls from the Telecom component. This service is bound to @@ -100,85 +95,4 @@ public class InCallServiceImpl extends InCallService { TelecomAdapter.getInstance().clearInCallService(); InCallPresenter.getInstance().tearDown(); } - - /* - * Compatibility code for devices running the L sdk. In that version of the sdk, InCallService - * callbacks were registered via a android.telecom.Phone$Listener. These callbacks typically - * correspond 1:1 to callbacks now found in android.telecom.InCallService so the compatibility - * code forwards to those methods. - */ - private Phone.Listener mPhoneListener = new Phone.Listener() { - @Override - public void onAudioStateChanged(Phone phone, AudioState audioState) { - /* - * Need to use reflection here; in M these are private fields retrieved through getters, - * but in L they are public fields without getters. - */ - try { - boolean isMuted = AudioState.class.getField("isMuted").getBoolean(audioState); - int route = AudioState.class.getField("route").getInt(audioState); - int supportedRouteMask = AudioState.class.getField("supportedRouteMask") - .getInt(audioState); - AudioModeProvider.getInstance() - .onAudioStateChanged(isMuted, route, supportedRouteMask); - } catch (ReflectiveOperationException e) { - Log.e(this, "Unable to use reflection to retrieve AudioState fields", e); - } - } - - @Override - public void onBringToForeground(Phone phone, boolean showDialpad) { - InCallServiceImpl.this.onBringToForeground(showDialpad); - } - - @Override - public void onCallAdded(Phone phone, Call call) { - InCallServiceImpl.this.onCallAdded(call); - } - - @Override - public void onCallRemoved(Phone phone, Call call) { - InCallServiceImpl.this.onCallRemoved(call); - } - }; - - private Phone mPhone; - - @Override - public void onPhoneCreated(Phone phone) { - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - return; - } - mPhone = phone; - mPhone.addListener(mPhoneListener); - } - - @Override - public void onPhoneDestroyed(Phone phone) { - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - return; - } - mPhone.removeListener(mPhoneListener); - mPhone = null; - } - - /* - * setMuted and setAudioRoute are final in InCallService so compat methods are - * used to perform the needed branching logic based on sdk version - */ - public void setMutedCompat(boolean state) { - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - super.setMuted(state); - return; - } - mPhone.setMuted(state); - } - - public void setAudioRouteCompat(int route) { - if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { - super.setAudioRoute(route); - return; - } - mPhone.setAudioRoute(route); - } } diff --git a/InCallUI/src/com/android/incallui/TelecomAdapter.java b/InCallUI/src/com/android/incallui/TelecomAdapter.java index 0fc2e280a..f172270dd 100644 --- a/InCallUI/src/com/android/incallui/TelecomAdapter.java +++ b/InCallUI/src/com/android/incallui/TelecomAdapter.java @@ -24,9 +24,6 @@ import android.os.Looper; import android.telecom.InCallService; import android.telecom.PhoneAccountHandle; -import com.android.incallui.compat.telecom.DetailsCompat; -import com.android.incallui.compat.telecom.InCallServiceCompat; - import java.util.List; final class TelecomAdapter implements InCallServiceListener { @@ -108,7 +105,7 @@ final class TelecomAdapter implements InCallServiceListener { void mute(boolean shouldMute) { if (mInCallService != null) { - InCallServiceCompat.setMuted(mInCallService, shouldMute); + mInCallService.setMuted(shouldMute); } else { Log.e(this, "error mute, mInCallService is null"); } @@ -116,7 +113,7 @@ final class TelecomAdapter implements InCallServiceListener { void setAudioRoute(int route) { if (mInCallService != null) { - InCallServiceCompat.setAudioRoute(mInCallService, route); + mInCallService.setAudioRoute(route); } else { Log.e(this, "error setAudioRoute, mInCallService is null"); } @@ -138,8 +135,7 @@ final class TelecomAdapter implements InCallServiceListener { if (!conferenceable.isEmpty()) { call.conference(conferenceable.get(0)); } else { - if (DetailsCompat.can(call.getDetails(), - android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE)) { + if (call.getDetails().can(android.telecom.Call.Details.CAPABILITY_MERGE_CONFERENCE)) { call.mergeConference(); } } @@ -151,8 +147,7 @@ final class TelecomAdapter implements InCallServiceListener { void swap(String callId) { android.telecom.Call call = getTelecomCallById(callId); if (call != null) { - if (DetailsCompat.can(call.getDetails(), - android.telecom.Call.Details.CAPABILITY_SWAP_CONFERENCE)) { + if (call.getDetails().can(android.telecom.Call.Details.CAPABILITY_SWAP_CONFERENCE)) { call.swapConference(); } } else { @@ -222,7 +217,10 @@ final class TelecomAdapter implements InCallServiceListener { } } - boolean canAddCall(Call call) { - return InCallServiceCompat.canAddCall(mInCallService, call); + boolean canAddCall() { + if (mInCallService != null) { + return mInCallService.canAddCall(); + } + return false; } } diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java index 2b6bc09a2..c9a332881 100644 --- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java +++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java @@ -39,7 +39,6 @@ import com.android.incallui.InCallPresenter.InCallStateListener; import com.android.incallui.InCallPresenter.IncomingCallListener; import com.android.incallui.InCallVideoCallCallbackNotifier.SurfaceChangeListener; import com.android.incallui.InCallVideoCallCallbackNotifier.VideoEventListener; -import com.android.incallui.compat.telecom.VideoProfileCompat; import java.util.Objects; @@ -485,8 +484,8 @@ public class VideoCallPresenter extends Presenter