diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:26:43 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:26:43 +0000 |
commit | 859e1e9302a47fd1cf5167cc43fbda10b1e051ac (patch) | |
tree | 205a7df644a3c041b065d01177eb189795285c8a /provider_src/com/android/email/provider/EmailProvider.java | |
parent | 192234c1485b1cf5f1177b5e3c5ea1ef58ae74e8 (diff) | |
parent | 1bfde93e51219462769a0251172c9d27e7642cb4 (diff) | |
download | Email-android10-android13-mainline-tzdata-release.tar.gz |
Snap for 6439596 from 1bfde93e51219462769a0251172c9d27e7642cb4 to qt-aml-tzdata-releaseq_tzdata_aml_297100400q_tzdata_aml_297100300q_tzdata_aml_297100000q_tzdata_aml_296200000q_tzdata_aml_295600118q_tzdata_aml_295600110q_tzdata_aml_295500002q_tzdata_aml_295500001q_tzdata_aml_294400310android-mainline-12.0.0_r54android-mainline-12.0.0_r111android-mainline-10.0.0_r13android-mainline-10.0.0_r12android-mainline-10.0.0_r11q_tzdata_aml_297100000android12-mainline-tzdata-releaseandroid10-mainline-tzdata-releaseandroid10-android13-mainline-tzdata-release
Change-Id: I9ececdcebb03be297a9ef636b616a7c22037e1a4
Diffstat (limited to 'provider_src/com/android/email/provider/EmailProvider.java')
-rw-r--r-- | provider_src/com/android/email/provider/EmailProvider.java | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/provider_src/com/android/email/provider/EmailProvider.java b/provider_src/com/android/email/provider/EmailProvider.java index aadc51b0b..00d608f30 100644 --- a/provider_src/com/android/email/provider/EmailProvider.java +++ b/provider_src/com/android/email/provider/EmailProvider.java @@ -1346,10 +1346,8 @@ public class EmailProvider extends ContentProvider c = uiQuery(match, uri, projection, unseenOnly); return c; case UI_FOLDERS: - // TODO(rtenneti): Enable notifications. - // c = uiFolders(uri, projection); - // return c; - return null; + c = uiFolders(uri, projection); + return c; case UI_FOLDER_LOAD_MORE: c = uiFolderLoadMore(getMailbox(uri)); return c; @@ -1541,8 +1539,7 @@ public class EmailProvider extends ContentProvider } if ((c != null) && !isTemporary()) { - // TODO(rtenneti): Enable notifications. - // c.setNotificationUri(getContext().getContentResolver(), uri); + c.setNotificationUri(getContext().getContentResolver(), uri); } return c; } @@ -2549,8 +2546,7 @@ public class EmailProvider extends ContentProvider final Set<Uri> notifications = getBatchNotificationsSet(); setBatchNotificationsSet(null); for (final Uri uri : notifications) { - // TODO(rtenneti): Enable notifications. - // context.getContentResolver().notifyChange(uri, null); + context.getContentResolver().notifyChange(uri, null); } } } @@ -2566,8 +2562,7 @@ public class EmailProvider extends ContentProvider @Override public void attachmentChanged(final Context context, final long id, final int flags) { // The default implementation delegates to the real service. - // TODO(rtenneti): Enable AttachmentService. - // AttachmentService.attachmentChanged(context, id, flags); + AttachmentService.attachmentChanged(context, id, flags); } }; private EmailAttachmentService mAttachmentService = DEFAULT_ATTACHMENT_SERVICE; @@ -3981,8 +3976,7 @@ public class EmailProvider extends ContentProvider } finally { accountIdCursor.close(); } - // TODO(rtenneti): Enable notifications. - // mc.setNotificationUri(context.getContentResolver(), UIPROVIDER_ALL_ACCOUNTS_NOTIFIER); + mc.setNotificationUri(context.getContentResolver(), UIPROVIDER_ALL_ACCOUNTS_NOTIFIER); return mc; } @@ -4643,9 +4637,8 @@ public class EmailProvider extends ContentProvider // Return real and virtual mailboxes alike final Cursor rawc = db.rawQuery(genQueryAccountAllMailboxes(uiProjection), new String[] {id}); - // TODO(rtenneti): Enable notifications. - // rawc.setNotificationUri(context.getContentResolver(), notifyUri); - // vc.setNotificationUri(context.getContentResolver(), notifyUri); + rawc.setNotificationUri(context.getContentResolver(), notifyUri); + vc.setNotificationUri(context.getContentResolver(), notifyUri); if (rawc.getCount() > 0) { c = new MergeCursor(new Cursor[]{rawc, vc}); } else { @@ -4786,8 +4779,7 @@ public class EmailProvider extends ContentProvider break; } if (notifyUri != null) { - // TODO(rtenneti): Enable notifications. - // c.setNotificationUri(resolver, notifyUri); + c.setNotificationUri(resolver, notifyUri); } return c; } @@ -5242,8 +5234,7 @@ public class EmailProvider extends ContentProvider mailPrefs.setConversationOverviewMode(overviewMode); } - // TODO(rtenneti): Enable notifications. - // c.getContentResolver().notifyChange(UIPROVIDER_ALL_ACCOUNTS_NOTIFIER, null, false); + c.getContentResolver().notifyChange(UIPROVIDER_ALL_ACCOUNTS_NOTIFIER, null, false); return 1; } @@ -5720,8 +5711,7 @@ public class EmailProvider extends ContentProvider if (batchNotifications != null) { batchNotifications.add(notifyUri); } else { - // TODO(rtenneti): Enable notifications. - // getContext().getContentResolver().notifyChange(notifyUri, null); + getContext().getContentResolver().notifyChange(notifyUri, null); } } @@ -6367,7 +6357,7 @@ public class EmailProvider extends ContentProvider // Start/stop the various services depending on whether there are any accounts // TODO: Make sure that the AttachmentService responds to this request as it // expects a particular set of data in the intents that it receives or it ignores. - startOrStopService(enabled, context); + startOrStopService(enabled, context, new Intent(context, AttachmentService.class)); final NotificationController controller = NotificationControllerCreatorHolder.getInstance(context); @@ -6377,16 +6367,16 @@ public class EmailProvider extends ContentProvider } /** - * Starts or stops the attachment service as necessary. - * + * Starts or stops the service as necessary. * @param enabled If {@code true}, the service will be started. Otherwise, it will be stopped. * @param context The context to manage the service with. + * @param intent The intent of the service to be managed. */ - private static void startOrStopService(boolean enabled, Context context) { + private static void startOrStopService(boolean enabled, Context context, Intent intent) { if (enabled) { - AttachmentService.startWithoutSpecificAttachmentChange(context); + context.startService(intent); } else { - AttachmentService.stop(context); + context.stopService(intent); } } |