diff options
author | Danesh Mondegarian <daneshm90@gmail.com> | 2013-07-03 16:01:25 -0700 |
---|---|---|
committer | Danesh Mondegarian <daneshm90@gmail.com> | 2013-07-03 16:35:36 -0700 |
commit | 6cf771e7b24dd69b523ed5f4940f27a9abd21420 (patch) | |
tree | 27f6ce5188d3311d4afcfe2a903341b0da8c9369 | |
parent | 4df4c3e727ce0820169bff5807da30ed2348c27f (diff) | |
download | packages_apps_settings-6cf771e7b24dd69b523ed5f4940f27a9abd21420.zip packages_apps_settings-6cf771e7b24dd69b523ed5f4940f27a9abd21420.tar.gz packages_apps_settings-6cf771e7b24dd69b523ed5f4940f27a9abd21420.tar.bz2 |
Lockscreen Options : Disable keyguard camera only
Current method of disabling camera does so for entire system, not just
lockscreen. This patchset addresses that.
Change-Id: Iba357214df36ddd8afd49a3e39abcaaba4ec808e
-rw-r--r-- | res/xml/device_admin_lockscreen.xml | 1 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/LockscreenInterface.java | 15 |
2 files changed, 9 insertions, 7 deletions
diff --git a/res/xml/device_admin_lockscreen.xml b/res/xml/device_admin_lockscreen.xml index fb665d3..a6c15a2 100644 --- a/res/xml/device_admin_lockscreen.xml +++ b/res/xml/device_admin_lockscreen.xml @@ -1,6 +1,5 @@ <device-admin xmlns:android="http://schemas.android.com/apk/res/android"> <uses-policies> <disable-keyguard-features/> - <disable-camera /> </uses-policies> </device-admin> diff --git a/src/com/android/settings/cyanogenmod/LockscreenInterface.java b/src/com/android/settings/cyanogenmod/LockscreenInterface.java index 74ca91a..c506889 100644 --- a/src/com/android/settings/cyanogenmod/LockscreenInterface.java +++ b/src/com/android/settings/cyanogenmod/LockscreenInterface.java @@ -143,9 +143,9 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE); - boolean widgetsEnabled = mDPM.getKeyguardDisabledFeatures(null) == 0; - mEnableWidgets.setChecked(widgetsEnabled); - mEnableCamera.setChecked(!mDPM.getCameraDisabled(null)); + int disabledFeatures = mDPM.getKeyguardDisabledFeatures(null); + mEnableWidgets.setChecked((disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) == 0); + mEnableCamera.setChecked((disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) == 0); mWallpaperImage = new File(getActivity().getFilesDir() + "/lockwallpaper"); mWallpaperTemporary = new File(getActivity().getCacheDir() + "/lockwallpaper.tmp"); @@ -256,10 +256,13 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements ComponentName dpmAdminName = new ComponentName(getActivity(), DeviceAdminLockscreenReceiver.class); mDPM.setActiveAdmin(dpmAdminName, true); - mDPM.setKeyguardDisabledFeatures(dpmAdminName, enableWidgets + int disabledFeatures = enableWidgets ? DevicePolicyManager.KEYGUARD_DISABLE_FEATURES_NONE - : DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL); - mDPM.setCameraDisabled(dpmAdminName, !enableCamera); + : DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL; + if (!enableCamera) { + disabledFeatures |= DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA; + } + mDPM.setKeyguardDisabledFeatures(dpmAdminName, disabledFeatures); } private boolean handleBackgroundSelection(int selection) { |