Show correct error when adding widget with no email accts on device.

If the WidgetConfiguration service is disabled until the user adds an account,
adding the widget just fails badly as there is no service registered
to handed an APPWIDGET_CONFIGURE intent.
Fixes b/5613821 App isn't installed toast message when creating widget for Email without any account

Change-Id: I98003eadf71fb944d3c0902f7e132ca7c5b67571
This commit is contained in:
Mindy Pereira 2011-11-28 16:28:13 -08:00
parent 87dde96eaf
commit 30003e582f
2 changed files with 1 additions and 7 deletions

View File

@ -463,7 +463,7 @@
<!-- Email AppWidget definitions -->
<activity
android:name=".widget.WidgetConfiguration"
android:enabled="false"
android:enabled="true"
android:theme="@android:style/Theme.Holo.Light.DialogWhenLarge"
>
<intent-filter

View File

@ -166,12 +166,6 @@ public class Email extends Application {
MailService.actionReschedule(context);
}
pm.setComponentEnabledSetting(
new ComponentName(context, WidgetConfiguration.class),
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
startOrStopService(enabled, context, new Intent(context, AttachmentDownloadService.class));
NotificationController.getInstance(context).watchForMessages(enabled);