summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/VideoCallPresenter.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-08-31 16:17:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-08-31 16:17:04 +0000
commitc39ea3c55fac807c0b98aabdf56c70dc8a49036c (patch)
treee282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/incallui/VideoCallPresenter.java
parent68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff)
parent2ca4318cc1ee57dda907ba2069bd61d162b1baef (diff)
Merge "Update Dialer source to latest internal Google revision."
Diffstat (limited to 'java/com/android/incallui/VideoCallPresenter.java')
-rw-r--r--java/com/android/incallui/VideoCallPresenter.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java
index 31999ef2e..89cddb9c4 100644
--- a/java/com/android/incallui/VideoCallPresenter.java
+++ b/java/com/android/incallui/VideoCallPresenter.java
@@ -27,9 +27,10 @@ import android.telecom.VideoProfile.CameraCapabilities;
import android.view.Surface;
import android.view.SurfaceView;
import com.android.dialer.common.Assert;
-import com.android.dialer.common.ConfigProviderBindings;
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;
import com.android.incallui.InCallPresenter.InCallOrientationListener;
import com.android.incallui.InCallPresenter.InCallStateListener;
@@ -186,7 +187,7 @@ public class VideoCallPresenter
*/
public static boolean showOutgoingVideo(
Context context, int videoState, int sessionModificationState) {
- if (!VideoUtils.hasCameraPermissionAndAllowedByUser(context)) {
+ if (!VideoUtils.hasCameraPermissionAndShownPrivacyToast(context)) {
LogUtil.i("VideoCallPresenter.showOutgoingVideo", "Camera permission is disabled by user.");
return false;
}
@@ -421,7 +422,7 @@ public class VideoCallPresenter
@Override
public void onCameraPermissionGranted() {
LogUtil.i("VideoCallPresenter.onCameraPermissionGranted", "");
- VideoUtils.setCameraAllowedByUser(mContext);
+ PermissionsUtil.setCameraPrivacyToastShown(mContext);
enableCamera(mPrimaryCall.getVideoCall(), isCameraRequired());
showVideoUi(
mPrimaryCall.getVideoState(),
@@ -761,7 +762,7 @@ public class VideoCallPresenter
/**
* Adjusts the current video mode by setting up the preview and display surfaces as necessary.
* Expected to be called whenever the video state associated with a call changes (e.g. a user
- * turns their camera on or off) to ensure the correct surfaces are shown/hidden. TODO: Need
+ * turns their camera on or off) to ensure the correct surfaces are shown/hidden. TODO(vt): Need
* to adjust size and orientation of preview surface here.
*/
private void adjustVideoMode(DialerCall call) {
@@ -839,11 +840,11 @@ public class VideoCallPresenter
return;
}
- boolean hasCameraPermission = VideoUtils.hasCameraPermissionAndAllowedByUser(mContext);
+ boolean hasCameraPermission = VideoUtils.hasCameraPermissionAndShownPrivacyToast(mContext);
if (!hasCameraPermission) {
videoCall.setCamera(null);
mPreviewSurfaceState = PreviewSurfaceState.NONE;
- // TODO: Inform remote party that the video is off. This is similar to b/30256571.
+ // TODO(wangqi): Inform remote party that the video is off. This is similar to b/30256571.
} else if (isCameraRequired) {
InCallCameraManager cameraManager = InCallPresenter.getInstance().getInCallCameraManager();
videoCall.setCamera(cameraManager.getActiveCameraId());
@@ -866,7 +867,7 @@ public class VideoCallPresenter
false /* isRemotelyHeld */);
enableCamera(mVideoCall, false);
InCallPresenter.getInstance().setFullScreen(false);
-
+ InCallPresenter.getInstance().enableScreenTimeout(false);
mIsVideoMode = false;
}
@@ -1081,22 +1082,23 @@ public class VideoCallPresenter
}
@Override
- public boolean shouldShowCameraPermissionDialog() {
+ public boolean shouldShowCameraPermissionToast() {
if (mPrimaryCall == null) {
- LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionDialog", "null call");
+ LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionToast", "null call");
return false;
}
if (mPrimaryCall.didShowCameraPermission()) {
LogUtil.i(
- "VideoCallPresenter.shouldShowCameraPermissionDialog", "already shown for this call");
+ "VideoCallPresenter.shouldShowCameraPermissionToast", "already shown for this call");
return false;
}
if (!ConfigProviderBindings.get(mContext)
.getBoolean("camera_permission_dialog_allowed", true)) {
- LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionDialog", "disabled by config");
+ LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionToast", "disabled by config");
return false;
}
- return !VideoUtils.hasCameraPermission(mContext) || !VideoUtils.isCameraAllowedByUser(mContext);
+ return !VideoUtils.hasCameraPermission(mContext)
+ || !PermissionsUtil.hasCameraPrivacyToastShown(mContext);
}
@Override