summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-09-14 14:12:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-14 14:12:14 -0700
commitbc7f678cc9334ef9d45a220fd0ef2db9c31019dc (patch)
tree2f72ed18f3d761f9a312e38fbbcd1a79eea4c8e3
parent767597b28aebf46e42f7ce194acc09454d8d2324 (diff)
parentce72ec79218e312e30ee0cb3045848c4e6d6ae5a (diff)
downloadpackages_apps_settings-bc7f678cc9334ef9d45a220fd0ef2db9c31019dc.zip
packages_apps_settings-bc7f678cc9334ef9d45a220fd0ef2db9c31019dc.tar.gz
packages_apps_settings-bc7f678cc9334ef9d45a220fd0ef2db9c31019dc.tar.bz2
Merge "Fix crash in Settings > Security" into jb-mr1-dev
-rw-r--r--src/com/android/settings/SecuritySettings.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index e9e3a19..ce59fdd 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -254,19 +254,21 @@ public class SecuritySettings extends SettingsPreferenceFragment
}
mUserSelectedWidget = root.findPreference(KEY_CHOOSE_USER_SELECTED_LOCKSCREEN_WIDGET);
- AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getActivity());
- int appWidgetId = -1;
- String appWidgetIdString = Settings.Secure.getString(
- getContentResolver(), Settings.Secure.LOCK_SCREEN_USER_SELECTED_APPWIDGET_ID);
- if (appWidgetIdString != null) {;
- appWidgetId = (int) Integer.decode(appWidgetIdString);
- }
- if (appWidgetId == -1) {
- mUserSelectedWidget.setSummary(getResources().getString(R.string.widget_none));
- } else {
- AppWidgetProviderInfo appWidget = appWidgetManager.getAppWidgetInfo(appWidgetId);
- if (appWidget != null) {
- mUserSelectedWidget.setSummary(appWidget.label);
+ if (mUserSelectedWidget != null) {
+ AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(getActivity());
+ int appWidgetId = -1;
+ String appWidgetIdString = Settings.Secure.getString(
+ getContentResolver(), Settings.Secure.LOCK_SCREEN_USER_SELECTED_APPWIDGET_ID);
+ if (appWidgetIdString != null) {;
+ appWidgetId = (int) Integer.decode(appWidgetIdString);
+ }
+ if (appWidgetId == -1) {
+ mUserSelectedWidget.setSummary(getResources().getString(R.string.widget_none));
+ } else {
+ AppWidgetProviderInfo appWidget = appWidgetManager.getAppWidgetInfo(appWidgetId);
+ if (appWidget != null) {
+ mUserSelectedWidget.setSummary(appWidget.label);
+ }
}
}