summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SettingsPreferenceFragment.java
diff options
context:
space:
mode:
authorDanesh Mondegarian <daneshm90@gmail.com>2013-05-30 15:33:51 -0400
committerDanny Baumann <dannybaumann@web.de>2013-07-03 14:57:46 +0200
commitf6b181905d42a0360e612b4655e75253ecfa83bb (patch)
treec67d0994cf60243d69afd617ffbeede20d9e8311 /src/com/android/settings/SettingsPreferenceFragment.java
parent5aacfcbbe55f638d1f69933acb0821492c354b48 (diff)
downloadpackages_apps_settings-f6b181905d42a0360e612b4655e75253ecfa83bb.zip
packages_apps_settings-f6b181905d42a0360e612b4655e75253ecfa83bb.tar.gz
packages_apps_settings-f6b181905d42a0360e612b4655e75253ecfa83bb.tar.bz2
Lockscreen options : Camera/widgets toggle
As per https://jira.cyanogenmod.org/browse/CYAN-1243 this commit allows user to control visibility of widgets/camera on lockscreen. Change-Id: Idab2ff4f058e355a1e5936531d9a264b1fea16a1
Diffstat (limited to 'src/com/android/settings/SettingsPreferenceFragment.java')
-rw-r--r--src/com/android/settings/SettingsPreferenceFragment.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index b961bbc..3a225f3 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -29,6 +29,7 @@ import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
+import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.util.Log;
@@ -313,6 +314,10 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
}
public boolean removePreferenceIfPackageNotInstalled(Preference preference) {
+ return removePreferenceIfPackageNotInstalled(preference, getPreferenceScreen());
+ }
+
+ public boolean removePreferenceIfPackageNotInstalled(Preference preference, PreferenceGroup parent) {
String intentUri = ((PreferenceScreen) preference).getIntent().toUri(1);
Pattern pattern = Pattern.compile("component=([^/]+)/");
Matcher matcher = pattern.matcher(intentUri);
@@ -323,7 +328,7 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
getPackageManager().getPackageInfo(packageName, 0);
} catch (NameNotFoundException e) {
Log.e(TAG, "package " + packageName + " not installed, hiding preference.");
- getPreferenceScreen().removePreference(preference);
+ parent.removePreference(preference);
return true;
}
}