0

I am trying to develop a security application , I want initially to display list of installed apps and on item click of list , its required permissions.

I have successfully made the app till permissions. Now , I want to disable camera , internet, etc, using Device admin API, I wish to include "Disable Camera" option in the settings of "AppsList" ie my list of installed apps Application ?

Can someone guide me how to do it ? Should I need to use preferences ? Any help appreciated,new to android development.

4

1 回答 1

0

在developers.android.com 上它描述为

禁用相机

从 Android 4.0 开始,您可以禁用摄像头。请注意,这不一定是永久禁用。可以根据上下文、时间等动态启用/禁用相机。

您可以使用 setCameraDisabled() 方法控制是否禁用相机。例如,此代码段根据复选框设置启用或禁用相机:

代码

 private CheckBoxPreference mDisableCameraCheckbox; DevicePolicyManager
     mDPM; ComponentName mDeviceAdminSample; ...
     mDPM.setCameraDisabled(mDeviceAdminSample,
     mDisableCameraCheckbox.isChecked());
于 2013-06-10T07:06:53.910 回答