summaryrefslogtreecommitdiffstats
path: root/java/com/android/incallui/VideoCallPresenter.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/incallui/VideoCallPresenter.java')
-rw-r--r--java/com/android/incallui/VideoCallPresenter.java22
1 files changed, 10 insertions, 12 deletions
diff --git a/java/com/android/incallui/VideoCallPresenter.java b/java/com/android/incallui/VideoCallPresenter.java
index a10602227..70f95e082 100644
--- a/java/com/android/incallui/VideoCallPresenter.java
+++ b/java/com/android/incallui/VideoCallPresenter.java
@@ -30,7 +30,6 @@ 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;
import com.android.incallui.InCallPresenter.InCallOrientationListener;
import com.android.incallui.InCallPresenter.InCallStateListener;
@@ -187,7 +186,7 @@ public class VideoCallPresenter
*/
public static boolean showOutgoingVideo(
Context context, int videoState, int sessionModificationState) {
- if (!VideoUtils.hasCameraPermissionAndShownPrivacyToast(context)) {
+ if (!VideoUtils.hasCameraPermissionAndAllowedByUser(context)) {
LogUtil.i("VideoCallPresenter.showOutgoingVideo", "Camera permission is disabled by user.");
return false;
}
@@ -422,7 +421,7 @@ public class VideoCallPresenter
@Override
public void onCameraPermissionGranted() {
LogUtil.i("VideoCallPresenter.onCameraPermissionGranted", "");
- PermissionsUtil.setCameraPrivacyToastShown(mContext);
+ VideoUtils.setCameraAllowedByUser(mContext);
enableCamera(mPrimaryCall.getVideoCall(), isCameraRequired());
showVideoUi(
mPrimaryCall.getVideoState(),
@@ -762,7 +761,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) {
@@ -840,11 +839,11 @@ public class VideoCallPresenter
return;
}
- boolean hasCameraPermission = VideoUtils.hasCameraPermissionAndShownPrivacyToast(mContext);
+ boolean hasCameraPermission = VideoUtils.hasCameraPermissionAndAllowedByUser(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());
@@ -1082,23 +1081,22 @@ public class VideoCallPresenter
}
@Override
- public boolean shouldShowCameraPermissionToast() {
+ public boolean shouldShowCameraPermissionDialog() {
if (mPrimaryCall == null) {
- LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionToast", "null call");
+ LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionDialog", "null call");
return false;
}
if (mPrimaryCall.didShowCameraPermission()) {
LogUtil.i(
- "VideoCallPresenter.shouldShowCameraPermissionToast", "already shown for this call");
+ "VideoCallPresenter.shouldShowCameraPermissionDialog", "already shown for this call");
return false;
}
if (!ConfigProviderBindings.get(mContext)
.getBoolean("camera_permission_dialog_allowed", true)) {
- LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionToast", "disabled by config");
+ LogUtil.i("VideoCallPresenter.shouldShowCameraPermissionDialog", "disabled by config");
return false;
}
- return !VideoUtils.hasCameraPermission(mContext)
- || !PermissionsUtil.hasCameraPrivacyToastShown(mContext);
+ return !VideoUtils.hasCameraPermission(mContext) || !VideoUtils.isCameraAllowedByUser(mContext);
}
@Override