From 2ca4318cc1ee57dda907ba2069bd61d162b1baef Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Thu, 31 Aug 2017 06:57:16 -0700 Subject: Update Dialer source to latest internal Google revision. Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. Test: make, flash install, run Merged-In: I45270eaa8ce732d71a1bd84b08c7fa0e99af3160 Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436 --- java/com/android/incallui/VideoCallPresenter.java | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'java/com/android/incallui/VideoCallPresenter.java') 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 -- cgit v1.2.3