From 122fb0b6c58774c75e06cbf786d0f366b674c163 Mon Sep 17 00:00:00 2001 From: linyuh Date: Mon, 26 Mar 2018 13:35:32 -0700 Subject: Remove obsolete methods in CompatUtils and rename it as "LocaleUtils". Test: Existing tests PiperOrigin-RevId: 190516504 Change-Id: I5fa9e123b45beb9728257ecd160a348fb3f4732c --- java/com/android/incallui/InCallActivity.java | 5 +--- java/com/android/incallui/VideoCallPresenter.java | 33 ++++------------------- 2 files changed, 6 insertions(+), 32 deletions(-) (limited to 'java/com/android/incallui') diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index 3236e160a..8144ddb10 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -60,7 +60,6 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutorComponent; import com.android.dialer.common.concurrent.ThreadUtil; -import com.android.dialer.compat.CompatUtils; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression.Type; import com.android.dialer.logging.Logger; @@ -321,9 +320,7 @@ public class InCallActivity extends TransactionSafeFragmentActivity // InCallActivity is responsible for disconnecting a new outgoing call if there is no way of // making it (i.e. no valid call capable accounts). - // If the version is not MSIM compatible, ignore this code. - if (CompatUtils.isMSIMCompatible() - && InCallPresenter.isCallWithNoValidAccounts(outgoingCall)) { + if (InCallPresenter.isCallWithNoValidAccounts(outgoingCall)) { LogUtil.i( "InCallActivity.internalResolveIntent", "Call with no valid accounts, disconnecting"); outgoingCall.disconnect(); diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java index f5d681c74..050ce9859 100644 --- a/java/com/android/incallui/VideoCallPresenter.java +++ b/java/com/android/incallui/VideoCallPresenter.java @@ -29,7 +29,6 @@ import android.view.Surface; import android.view.SurfaceView; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; -import com.android.dialer.compat.CompatUtils; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.util.PermissionsUtil; import com.android.incallui.InCallPresenter.InCallDetailsListener; @@ -164,10 +163,7 @@ public class VideoCallPresenter * @param callState The current call state. * @return {@code true} if the incoming video surface should be shown, {@code false} otherwise. */ - public static boolean showIncomingVideo(int videoState, int callState) { - if (!CompatUtils.isVideoCompatible()) { - return false; - } + static boolean showIncomingVideo(int videoState, int callState) { boolean isPaused = VideoProfile.isPaused(videoState); boolean isCallActive = callState == DialerCall.State.ACTIVE; @@ -187,17 +183,13 @@ public class VideoCallPresenter * @return {@code true} if the the outgoing video surface should be shown, {@code false} * otherwise. */ - public static boolean showOutgoingVideo( + private static boolean showOutgoingVideo( Context context, int videoState, int sessionModificationState) { if (!VideoUtils.hasCameraPermissionAndShownPrivacyToast(context)) { LogUtil.i("VideoCallPresenter.showOutgoingVideo", "Camera permission is disabled by user."); return false; } - if (!CompatUtils.isVideoCompatible()) { - return false; - } - return VideoProfile.isTransmissionEnabled(videoState) || isVideoUpgrade(sessionModificationState); } @@ -309,12 +301,6 @@ public class VideoCallPresenter LogUtil.v("VideoCallPresenter.onVideoCallScreenUiReady", ""); Assert.checkState(!isVideoCallScreenUiReady); - // Do not register any listeners if video calling is not compatible to safeguard against - // any accidental calls of video calling code. - if (!CompatUtils.isVideoCompatible()) { - return; - } - deviceOrientation = InCallOrientationEventListener.getCurrentOrientation(); // Register for call state changes last @@ -345,10 +331,6 @@ public class VideoCallPresenter LogUtil.v("VideoCallPresenter.onVideoCallScreenUiUnready", ""); Assert.checkState(isVideoCallScreenUiReady); - if (!CompatUtils.isVideoCompatible()) { - return; - } - cancelAutoFullScreen(); InCallPresenter.getInstance().removeListener(this); @@ -1273,7 +1255,7 @@ public class VideoCallPresenter } private static boolean isBidirectionalVideoCall(DialerCall call) { - return CompatUtils.isVideoCompatible() && VideoProfile.isBidirectional(call.getVideoState()); + return VideoProfile.isBidirectional(call.getVideoState()); } private static boolean isIncomingVideoCall(DialerCall call) { @@ -1299,10 +1281,6 @@ public class VideoCallPresenter } private static boolean isAudioCall(DialerCall call) { - if (!CompatUtils.isVideoCompatible()) { - return true; - } - return call != null && VideoProfile.isAudioOnly(call.getVideoState()); } @@ -1311,8 +1289,7 @@ public class VideoCallPresenter } private static boolean isVideoCall(int videoState) { - return CompatUtils.isVideoCompatible() - && (VideoProfile.isTransmissionEnabled(videoState) - || VideoProfile.isReceptionEnabled(videoState)); + return VideoProfile.isTransmissionEnabled(videoState) + || VideoProfile.isReceptionEnabled(videoState); } } -- cgit v1.2.3