diff options
Diffstat (limited to 'java/com/android/incallui/videotech/utils')
-rw-r--r-- | java/com/android/incallui/videotech/utils/VideoUtils.java | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/java/com/android/incallui/videotech/utils/VideoUtils.java b/java/com/android/incallui/videotech/utils/VideoUtils.java index 527654030..9dfc68728 100644 --- a/java/com/android/incallui/videotech/utils/VideoUtils.java +++ b/java/com/android/incallui/videotech/utils/VideoUtils.java @@ -20,12 +20,10 @@ import android.content.Context; import android.content.pm.PackageManager; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; -import com.android.dialer.util.DialerUtils; +import com.android.dialer.util.PermissionsUtil; public class VideoUtils { - private static final String PREFERENCE_CAMERA_ALLOWED_BY_USER = "camera_allowed_by_user"; - public static boolean hasSentVideoUpgradeRequest(@SessionModificationState int state) { return state == SessionModificationState.WAITING_FOR_UPGRADE_TO_VIDEO_RESPONSE || state == SessionModificationState.UPGRADE_TO_VIDEO_REQUEST_FAILED @@ -37,24 +35,12 @@ public class VideoUtils { return state == SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST; } - public static boolean hasCameraPermissionAndAllowedByUser(@NonNull Context context) { - return isCameraAllowedByUser(context) && hasCameraPermission(context); + public static boolean hasCameraPermissionAndShownPrivacyToast(@NonNull Context context) { + return PermissionsUtil.hasCameraPrivacyToastShown(context) && hasCameraPermission(context); } public static boolean hasCameraPermission(@NonNull Context context) { return ContextCompat.checkSelfPermission(context, android.Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED; } - - public static boolean isCameraAllowedByUser(@NonNull Context context) { - return DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context) - .getBoolean(PREFERENCE_CAMERA_ALLOWED_BY_USER, false); - } - - public static void setCameraAllowedByUser(@NonNull Context context) { - DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context) - .edit() - .putBoolean(PREFERENCE_CAMERA_ALLOWED_BY_USER, true) - .apply(); - } } |