diff options
author | Danny Baumann <dannybaumann@web.de> | 2013-07-04 02:10:51 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-07-04 02:10:51 -0700 |
commit | 9d0065d4992263c948da56d3a0d668046092c1d8 (patch) | |
tree | f4794940f9eec9e142ac00715a03f14046c458c2 | |
parent | 1ff44cc56db68e9fefb8b824581544c4736945f3 (diff) | |
parent | 6cf771e7b24dd69b523ed5f4940f27a9abd21420 (diff) | |
download | packages_apps_settings-9d0065d4992263c948da56d3a0d668046092c1d8.zip packages_apps_settings-9d0065d4992263c948da56d3a0d668046092c1d8.tar.gz packages_apps_settings-9d0065d4992263c948da56d3a0d668046092c1d8.tar.bz2 |
Merge "Lockscreen Options : Disable keyguard camera only" into cm-10.1
-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) { |