I have a device manager application and I am trying to use setScreenCaptureDisabled(..) function of DevicePolicyManager class available since API 21.
DevicePolicyManager pManager = (android.app.admin.DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
pManager.setScreenCaptureDisabled(admin.getReceiverName(), true);
I am getting the following error:
03-30 13:50:24.623: E/AndroidRuntime(11564):
java.lang.SecurityException: Admin
ComponentInfo{com.example.xxv/com.example.xxv.DeviceAdminReceiver}
does not own the profile
Any idea how I can solve this problem?
If there is any permission required, can you please indicate what it is.