Loading src/com/android/settings/SecuritySettings.java +4 −5 Original line number Diff line number Diff line Loading @@ -459,8 +459,7 @@ public class SecuritySettings extends SettingsPreferenceFragment Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK); // Found in KeyguardHostView.java final int KEYGUARD_HOST_ID = 0x4B455947; int appWidgetId = AppWidgetHost.allocateAppWidgetIdForHost( "com.android.internal.policy.impl.keyguard", KEYGUARD_HOST_ID); int appWidgetId = AppWidgetHost.allocateAppWidgetIdForSystem(KEYGUARD_HOST_ID); if (appWidgetId != -1) { pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); pickIntent.putExtra(AppWidgetManager.EXTRA_CUSTOM_SORT, false); Loading Loading @@ -592,7 +591,7 @@ public class SecuritySettings extends SettingsPreferenceFragment // Otherwise just add it if (noWidget) { // If we selected "none", delete the allocated id AppWidgetHost.deleteAppWidgetIdForHost(appWidgetId); AppWidgetHost.deleteAppWidgetIdForSystem(appWidgetId); data.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1); } else { onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data); Loading @@ -603,13 +602,13 @@ public class SecuritySettings extends SettingsPreferenceFragment // If a widget existed before, delete it int oldAppWidgetId = getUserSelectedAppWidgetId(); if (oldAppWidgetId != -1) { AppWidgetHost.deleteAppWidgetIdForHost(oldAppWidgetId); AppWidgetHost.deleteAppWidgetIdForSystem(oldAppWidgetId); } Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCK_SCREEN_USER_SELECTED_APPWIDGET_ID, Integer.toString(appWidgetId)); } else { AppWidgetHost.deleteAppWidgetIdForHost(appWidgetId); AppWidgetHost.deleteAppWidgetIdForSystem(appWidgetId); } } createPreferenceHierarchy(); Loading Loading
src/com/android/settings/SecuritySettings.java +4 −5 Original line number Diff line number Diff line Loading @@ -459,8 +459,7 @@ public class SecuritySettings extends SettingsPreferenceFragment Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK); // Found in KeyguardHostView.java final int KEYGUARD_HOST_ID = 0x4B455947; int appWidgetId = AppWidgetHost.allocateAppWidgetIdForHost( "com.android.internal.policy.impl.keyguard", KEYGUARD_HOST_ID); int appWidgetId = AppWidgetHost.allocateAppWidgetIdForSystem(KEYGUARD_HOST_ID); if (appWidgetId != -1) { pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); pickIntent.putExtra(AppWidgetManager.EXTRA_CUSTOM_SORT, false); Loading Loading @@ -592,7 +591,7 @@ public class SecuritySettings extends SettingsPreferenceFragment // Otherwise just add it if (noWidget) { // If we selected "none", delete the allocated id AppWidgetHost.deleteAppWidgetIdForHost(appWidgetId); AppWidgetHost.deleteAppWidgetIdForSystem(appWidgetId); data.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, -1); } else { onActivityResult(REQUEST_CREATE_APPWIDGET, Activity.RESULT_OK, data); Loading @@ -603,13 +602,13 @@ public class SecuritySettings extends SettingsPreferenceFragment // If a widget existed before, delete it int oldAppWidgetId = getUserSelectedAppWidgetId(); if (oldAppWidgetId != -1) { AppWidgetHost.deleteAppWidgetIdForHost(oldAppWidgetId); AppWidgetHost.deleteAppWidgetIdForSystem(oldAppWidgetId); } Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCK_SCREEN_USER_SELECTED_APPWIDGET_ID, Integer.toString(appWidgetId)); } else { AppWidgetHost.deleteAppWidgetIdForHost(appWidgetId); AppWidgetHost.deleteAppWidgetIdForSystem(appWidgetId); } } createPreferenceHierarchy(); Loading