Snap for 5698743 from b64f24986ec886046d56f933d59ffde26976d6b5 to qt-release

Change-Id: Iba4ab26c19c705b3179742887412c9e5e70f4c65
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e34a4fc..721ba1b 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -27,7 +27,7 @@
     <uses-permission android:name="android.permission.NFC" />
 
     <!-- This needs to be present when we are doing unbundled releases. -->
-    <uses-sdk android:targetSdkVersion="28" android:minSdkVersion="14" />
+    <uses-sdk android:targetSdkVersion="24" android:minSdkVersion="14" />
 
     <application
         android:icon="@mipmap/ic_launcher_mail"
@@ -175,9 +175,7 @@
                  android:permission="android.permission.BIND_REMOTEVIEWS"
                  android:exported="false" />
         <service android:name=".MailLogService"/>
-        <service android:name=".browse.EmlTempFileDeletionService"
-                 android:permission="android.permission.BIND_JOB_SERVICE"
-                 android:exported="true" />
+        <service android:name=".browse.EmlTempFileDeletionService" />
 
     </application>
 
diff --git a/src/com/android/mail/MailIntentService.java b/src/com/android/mail/MailIntentService.java
index db7b99b..8151dfc 100644
--- a/src/com/android/mail/MailIntentService.java
+++ b/src/com/android/mail/MailIntentService.java
@@ -15,12 +15,11 @@
  */
 package com.android.mail;
 
+import android.app.IntentService;
 import android.content.Context;
 import android.content.Intent;
 import android.net.Uri;
 
-import androidx.core.app.JobIntentService;
-
 import com.android.mail.analytics.Analytics;
 import com.android.mail.photo.ContactFetcher;
 import com.android.mail.providers.Account;
@@ -35,7 +34,7 @@
 /**
  * A service to handle various intents asynchronously.
  */
-public class MailIntentService extends JobIntentService {
+public class MailIntentService extends IntentService {
     private static final String LOG_TAG = LogTag.getLogTag();
 
     public static final String ACTION_RESEND_NOTIFICATIONS =
@@ -57,18 +56,16 @@
 
     public static final String CONVERSATION_EXTRA = "conversation";
 
-    public static final int JOB_ID = 100;
-
     public MailIntentService() {
-        super();
+        super("MailIntentService");
     }
 
-    public static void enqueueWork(Context context, Intent work) {
-        enqueueWork(context, MailIntentService.class, JOB_ID, work);
+    protected MailIntentService(final String name) {
+        super(name);
     }
 
     @Override
-    protected void onHandleWork(final Intent intent) {
+    protected void onHandleIntent(final Intent intent) {
         // UnifiedEmail does not handle all Intents
 
         LogUtils.v(LOG_TAG, "Handling intent %s", intent);
diff --git a/src/com/android/mail/browse/EmlMessageLoader.java b/src/com/android/mail/browse/EmlMessageLoader.java
index acf7716..82fa98f 100644
--- a/src/com/android/mail/browse/EmlMessageLoader.java
+++ b/src/com/android/mail/browse/EmlMessageLoader.java
@@ -105,7 +105,7 @@
             intent.setClass(getContext(), EmlTempFileDeletionService.class);
             intent.setData(message.attachmentListUri);
 
-            EmlTempFileDeletionService.enqueueWork(getContext(), intent);
+            getContext().startService(intent);
         }
     }
 }
diff --git a/src/com/android/mail/browse/EmlTempFileDeletionService.java b/src/com/android/mail/browse/EmlTempFileDeletionService.java
index 8a772c3..71a915c 100644
--- a/src/com/android/mail/browse/EmlTempFileDeletionService.java
+++ b/src/com/android/mail/browse/EmlTempFileDeletionService.java
@@ -17,33 +17,25 @@
 
 package com.android.mail.browse;
 
-import android.content.Context;
+import android.app.IntentService;
 import android.content.Intent;
 import android.net.Uri;
 
-import androidx.core.app.JobIntentService;
-
 /**
  * {@link IntentService} that cleans up temporary files in the cache for the eml viewer.
  */
-public class EmlTempFileDeletionService extends JobIntentService {
-
-    public static final int JOB_ID = 101;
+public class EmlTempFileDeletionService extends IntentService {
 
     public EmlTempFileDeletionService() {
-        super();
+        super("EmlTempFileDeletionService");
     }
 
     public EmlTempFileDeletionService(String name) {
-        super();
-    }
-
-    public static void enqueueWork(Context context, Intent work) {
-        enqueueWork(context, EmlTempFileDeletionService.class, JOB_ID, work);
+        super(name);
     }
 
     @Override
-    protected void onHandleWork(Intent intent) {
+    protected void onHandleIntent(Intent intent) {
         final String action = intent.getAction();
         if (Intent.ACTION_DELETE.equals(action)) {
             final Uri uri = intent.getData();