summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-09-18 13:26:29 -0700
committerAdam Cohen <adamcohen@google.com>2012-09-18 14:41:47 -0700
commit1dd0024327159deff0401978683b49a7d3879021 (patch)
tree8a12374869de73aaa0af2e7972f683c2cda2a6d6 /src
parent221e4356e1cbf24dd32037800601df91c3b85c6d (diff)
downloadpackages_apps_settings-1dd0024327159deff0401978683b49a7d3879021.zip
packages_apps_settings-1dd0024327159deff0401978683b49a7d3879021.tar.gz
packages_apps_settings-1dd0024327159deff0401978683b49a7d3879021.tar.bz2
Tweaking mechanism for adding keyguard widgets
-> Fix for issue 7173877 -> Fix for issue 7173587 Change-Id: I266cafcf175c98e0c8a8401e11faa5dd2e2fa885
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/SecuritySettings.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 588075e..ac4ea86 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -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);
@@ -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);
@@ -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();