summaryrefslogtreecommitdiffstats
path: root/java/com/android/incallui/InCallActivity.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-24 09:31:16 -0700
committerEric Erfanian <erfanian@google.com>2017-03-27 08:56:19 -0700
commit9050823ccf6f512e06ad65c8a741cb17cbc4a833 (patch)
treee454c9e0fa20b8384fa87d4e6309bb8b9e3aa2a4 /java/com/android/incallui/InCallActivity.java
parentdd9d50805f1b49dff1fe3787740393d726124cdb (diff)
downloadandroid_packages_apps_Dialer-9050823ccf6f512e06ad65c8a741cb17cbc4a833.tar.gz
android_packages_apps_Dialer-9050823ccf6f512e06ad65c8a741cb17cbc4a833.tar.bz2
android_packages_apps_Dialer-9050823ccf6f512e06ad65c8a741cb17cbc4a833.zip
Update AOSP Dialer source from internal google3 repository at
cl/151128062 Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150756069 (3/21/2017) to cl/151128062 (3/24/2017). Notable this release: - Explicitly enumerate host and target dependencies. - Update proguard flag references. This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Bug: 33210202 36511925 Addresses 33210202 - Proguard support 36511925 - Compiler warnings when building against platform sdk Change-Id: I448ec3b3f2358886859cf7a4ef76a8fcef3244ae
Diffstat (limited to 'java/com/android/incallui/InCallActivity.java')
-rw-r--r--java/com/android/incallui/InCallActivity.java40
1 files changed, 37 insertions, 3 deletions
diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java
index 395829b80..90eb0aa6a 100644
--- a/java/com/android/incallui/InCallActivity.java
+++ b/java/com/android/incallui/InCallActivity.java
@@ -28,11 +28,13 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.graphics.ColorUtils;
import android.telecom.DisconnectCause;
+import android.telephony.TelephonyManager;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import com.android.dialer.common.Assert;
+import com.android.dialer.common.ConfigProviderBindings;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.ActivityCompat;
import com.android.dialer.logging.Logger;
@@ -72,6 +74,8 @@ public class InCallActivity extends TransactionSafeFragmentActivity
private static final String DID_SHOW_IN_CALL_SCREEN_KEY = "did_show_in_call_screen";
private static final String DID_SHOW_VIDEO_CALL_SCREEN_KEY = "did_show_video_call_screen";
+ private static final String CONFIG_ANSWER_AND_RELEASE_ENABLED = "answer_and_release_enabled";
+
private final InCallActivityCommon common;
private boolean didShowAnswerScreen;
private boolean didShowInCallScreen;
@@ -460,7 +464,11 @@ public class InCallActivity extends TransactionSafeFragmentActivity
}
@Override
- public VideoCallScreenDelegate newVideoCallScreenDelegate() {
+ public VideoCallScreenDelegate newVideoCallScreenDelegate(VideoCallScreen videoCallScreen) {
+ DialerCall dialerCall = CallList.getInstance().getCallById(videoCallScreen.getCallId());
+ if (dialerCall != null && dialerCall.getVideoTech().shouldUseSurfaceView()) {
+ return dialerCall.getVideoTech().createVideoCallScreenDelegate(this, videoCallScreen);
+ }
return new VideoCallPresenter();
}
@@ -629,7 +637,9 @@ public class InCallActivity extends TransactionSafeFragmentActivity
call.getId(),
call.isVideoCall(),
isVideoUpgradeRequest,
- call.getVideoTech().isSelfManagedCamera());
+ call.getVideoTech().isSelfManagedCamera(),
+ shouldAllowAnswerAndRelease(call),
+ CallList.getInstance().getBackgroundCall() != null);
transaction.add(R.id.main, answerScreen.getAnswerScreenFragment(), TAG_ANSWER_SCREEN);
Logger.get(this).logScreenView(ScreenEvent.Type.INCOMING_CALL, this);
@@ -637,6 +647,28 @@ public class InCallActivity extends TransactionSafeFragmentActivity
return true;
}
+ private boolean shouldAllowAnswerAndRelease(DialerCall call) {
+ if (CallList.getInstance().getActiveCall() == null) {
+ LogUtil.i("InCallActivity.shouldAllowAnswerAndRelease", "no active call");
+ return false;
+ }
+ if (getSystemService(TelephonyManager.class).getPhoneType()
+ == TelephonyManager.PHONE_TYPE_CDMA) {
+ LogUtil.i("InCallActivity.shouldAllowAnswerAndRelease", "PHONE_TYPE_CDMA not supported");
+ return false;
+ }
+ if (call.isVideoCall() || call.hasReceivedVideoUpgradeRequest()) {
+ LogUtil.i("InCallActivity.shouldAllowAnswerAndRelease", "video call");
+ return false;
+ }
+ if (!ConfigProviderBindings.get(this).getBoolean(CONFIG_ANSWER_AND_RELEASE_ENABLED, true)) {
+ LogUtil.i("InCallActivity.shouldAllowAnswerAndRelease", "disabled by config");
+ return false;
+ }
+
+ return true;
+ }
+
private boolean hideAnswerScreenFragment(FragmentTransaction transaction) {
if (!didShowAnswerScreen) {
return false;
@@ -692,7 +724,9 @@ public class InCallActivity extends TransactionSafeFragmentActivity
LogUtil.i("InCallActivity.showVideoCallScreenFragment", "call: %s", call);
- VideoCallScreen videoCallScreen = VideoBindings.createVideoCallScreen(call.getId());
+ VideoCallScreen videoCallScreen =
+ VideoBindings.createVideoCallScreen(
+ call.getId(), call.getVideoTech().shouldUseSurfaceView());
transaction.add(R.id.main, videoCallScreen.getVideoCallScreenFragment(), TAG_VIDEO_CALL_SCREEN);
Logger.get(this).logScreenView(ScreenEvent.Type.INCALL, this);