Merge "Disable widget creation if there're no accounts"

This commit is contained in:
Ben Komalo 2011-10-21 14:53:23 -07:00 committed by Android (Google) Code Review
commit 037e00b97d

View File

@ -166,12 +166,10 @@ public class Email extends Application {
MailService.actionReschedule(context);
}
// Note - the Email widget is always enabled as it will show a warning if no accounts are
// configured. In previous releases, this was disabled if no accounts were set, so we
// need to unconditionally enable it here.
pm.setComponentEnabledSetting(
new ComponentName(context, WidgetConfiguration.class),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
// Start/stop the various services depending on whether there are any accounts