Example usage for android.app.admin DevicePolicyManager PERMISSION_GRANT_STATE_GRANTED

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

Introduction

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

Prototype

int PERMISSION_GRANT_STATE_GRANTED

To view the source code for android.app.admin DevicePolicyManager PERMISSION_GRANT_STATE_GRANTED.

Click Source Link

Document

Runtime permission state: The permission is granted to the app and the user cannot manage the permission through the UI.

Usage

From source file:com.android.cts.verifier.managedprovisioning.ByodHelperActivity.java

private void grantCameraPermissionToSelf() {
    mDevicePolicyManager.setPermissionGrantState(mAdminReceiverComponent, getPackageName(),
            android.Manifest.permission.CAMERA, DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED);
}

From source file:com.android.cts.verifier.managedprovisioning.ByodHelperActivity.java

private void grantLocationPermissionToSelf() {
    mDevicePolicyManager.setPermissionGrantState(mAdminReceiverComponent, getPackageName(),
            android.Manifest.permission.ACCESS_FINE_LOCATION,
            DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED);
}