diff options
author | Michael Jurka <mikejurka@google.com> | 2012-09-14 14:09:16 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-09-14 14:09:16 -0700 |
commit | ce72ec79218e312e30ee0cb3045848c4e6d6ae5a (patch) | |
tree | 036d5b9c57fb708b42cd3ddcea2335c7bf116db3 | |
parent | 8227e303850d7c1162c62947b70d0592432b455e (diff) | |
download | packages_apps_settings-ce72ec79218e312e30ee0cb3045848c4e6d6ae5a.zip packages_apps_settings-ce72ec79218e312e30ee0cb3045848c4e6d6ae5a.tar.gz packages_apps_settings-ce72ec79218e312e30ee0cb3045848c4e6d6ae5a.tar.bz2 |
Fix crash in Settings > Security
Change-Id: Ib439c652f4f8a55cac710dbd22792943a7ef8f98
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 28 |
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); + } } } |