diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-03-05 18:37:54 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-03-05 18:37:54 -0800 |
commit | 7d09187e4159cef599f1b67e8f39605a0f63095b (patch) | |
tree | 6c6eaf4efd57d37fc8a4248b50efa54f87edacba /src | |
parent | 2f467dbbc4e63cbf58afa240fbc73265082f169d (diff) | |
download | packages_apps_settings-7d09187e4159cef599f1b67e8f39605a0f63095b.zip packages_apps_settings-7d09187e4159cef599f1b67e8f39605a0f63095b.tar.gz packages_apps_settings-7d09187e4159cef599f1b67e8f39605a0f63095b.tar.bz2 |
Use a component name that actually exists when enabling/disabling.
Change-Id: Id6422a0039060bce3dc1bdc39551f04a4e4adbe6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/widget/SettingsAppWidgetProvider.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java index 656d072..3101b01 100644 --- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java +++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java @@ -605,9 +605,10 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { @Override public void onEnabled(Context context) { + Class clazz = com.android.settings.widget.SettingsAppWidgetProvider.class; PackageManager pm = context.getPackageManager(); pm.setComponentEnabledSetting( - new ComponentName("com.android.settings", ".widget.SettingsAppWidgetProvider"), + new ComponentName(context.getPackageName(), clazz.getName()), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); checkObserver(context); @@ -618,7 +619,7 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { Class clazz = com.android.settings.widget.SettingsAppWidgetProvider.class; PackageManager pm = context.getPackageManager(); pm.setComponentEnabledSetting( - new ComponentName("com.android.settings", ".widget.SettingsAppWidgetProvider"), + new ComponentName(context.getPackageName(), clazz.getName()), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); if (sSettingsObserver != null) { |