summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeeti Paananen <veeti.paananen@rojekti.fi>2013-08-03 02:54:11 +0300
committerVeeti Paananen <veeti.paananen@rojekti.fi>2013-08-03 02:54:11 +0300
commit248a2f2776398140cf0059ce251f948ae54ccd82 (patch)
tree2a374047cdc78a2b864780b1c5779efb78190f3f
parentfdc30041b0ce1dccfad2cbc12c5ae3ffaf9b293f (diff)
downloadpackages_apps_settings-248a2f2776398140cf0059ce251f948ae54ccd82.zip
packages_apps_settings-248a2f2776398140cf0059ce251f948ae54ccd82.tar.gz
packages_apps_settings-248a2f2776398140cf0059ce251f948ae54ccd82.tar.bz2
Hide the camera widget option if no camera on device
Change-Id: I034c246651fc9ae698bc32fd4af16cf14adb5314
-rw-r--r--src/com/android/settings/cyanogenmod/LockscreenInterface.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/settings/cyanogenmod/LockscreenInterface.java b/src/com/android/settings/cyanogenmod/LockscreenInterface.java
index c506889..224e652 100644
--- a/src/com/android/settings/cyanogenmod/LockscreenInterface.java
+++ b/src/com/android/settings/cyanogenmod/LockscreenInterface.java
@@ -29,6 +29,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Rect;
@@ -147,6 +148,11 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements
mEnableWidgets.setChecked((disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL) == 0);
mEnableCamera.setChecked((disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) == 0);
+ // Remove the camera widget preference if the device doesn't have one
+ if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
+ widgetsCategory.removePreference(mEnableCamera);
+ }
+
mWallpaperImage = new File(getActivity().getFilesDir() + "/lockwallpaper");
mWallpaperTemporary = new File(getActivity().getCacheDir() + "/lockwallpaper.tmp");