Example usage for android.app.admin DevicePolicyManager getCameraDisabled

List of usage examples for android.app.admin DevicePolicyManager getCameraDisabled

Introduction

In this page you can find the example usage for android.app.admin DevicePolicyManager getCameraDisabled.

Prototype

public boolean getCameraDisabled(@Nullable ComponentName admin) 

Source Link

Document

Determine whether or not the device's cameras have been disabled for this user, either by the calling admin, if specified, or all admins.

Usage

From source file:at.wada811.utils.CameraUtils.java

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static boolean isCameraDisabled(Context context) {
    if (AndroidUtils.isMoreThanBuildVersion(Build.VERSION_CODES.ICE_CREAM_SANDWICH)) {
        DevicePolicyManager devicePolicyManager = (DevicePolicyManager) context
                .getSystemService(Context.DEVICE_POLICY_SERVICE);
        return devicePolicyManager.getCameraDisabled(null);
    } else {/*  w  w w  . j  ava2 s .  c om*/
        return false;
    }
}