diff options
author | Raman Tenneti <rtenneti@google.com> | 2019-06-26 14:04:30 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-26 14:04:30 -0700 |
commit | b730f9c72343e2a76ea612165ba21acd0154e411 (patch) | |
tree | 439defc6470c4b453f057b8da60123cec9b4075f | |
parent | ff067ef281b2e68d265836198ce23217a8ab9443 (diff) | |
parent | 7cecc49387ddf4d3d06d03e44095a0dd21f64a54 (diff) | |
download | UnifiedEmail-b730f9c72343e2a76ea612165ba21acd0154e411.tar.gz |
Merge "Revert "AOSP/UnifiedEmail - Bumped the targetSdkVersion to 28 (maximum version). Used JobIntentservice API calls to replace context.startService."" am: 7ffdac40ac
am: 7cecc49387
Change-Id: I61d98c23c2411e9fb09515741f4ffe652aface43
-rw-r--r-- | AndroidManifest.xml | 6 | ||||
-rw-r--r-- | src/com/android/mail/MailIntentService.java | 15 | ||||
-rw-r--r-- | src/com/android/mail/browse/EmlMessageLoader.java | 2 | ||||
-rw-r--r-- | src/com/android/mail/browse/EmlTempFileDeletionService.java | 18 |
4 files changed, 14 insertions, 27 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e34a4fc1d..721ba1b68 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 db7b99b04..8151dfc28 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 @@ import com.android.mail.utils.Utils; /** * 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 class MailIntentService extends JobIntentService { 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 acf7716e4..82fa98f81 100644 --- a/src/com/android/mail/browse/EmlMessageLoader.java +++ b/src/com/android/mail/browse/EmlMessageLoader.java @@ -105,7 +105,7 @@ public class EmlMessageLoader extends MailAsyncTaskLoader<ConversationMessage> { 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 8a772c3aa..71a915c51 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(); |