Permalink
Browse files

fixed missing WakefulIntentService

  • Loading branch information...
1 parent e943299 commit df432eb8e60d776d67c98203e8512b26186ee1cb @commonsguy committed Mar 6, 2013
@@ -1,7 +1,6 @@
package com.commonsware.empublite;
import android.app.DownloadManager;
-import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -14,10 +13,11 @@
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
+import com.commonsware.cwac.wakeful.WakefulIntentService;
import org.json.JSONException;
import org.json.JSONObject;
-public class DownloadCheckService extends IntentService {
+public class DownloadCheckService extends WakefulIntentService {
public static final String PREF_PENDING_UPDATE="pendingUpdateDir";
public static final String UPDATE_FILENAME="book.zip";
private static final String UPDATE_BASEDIR="updates";
@@ -29,7 +29,7 @@ public DownloadCheckService() {
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void doWakefulWork(Intent intent) {
BufferedReader reader=null;
try {
@@ -1,6 +1,5 @@
package com.commonsware.empublite;
-import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Environment;
@@ -15,8 +14,9 @@
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import com.commonsware.cwac.wakeful.WakefulIntentService;
-public class DownloadInstallService extends IntentService {
+public class DownloadInstallService extends WakefulIntentService {
public static final String PREF_UPDATE_DIR="updateDir";
public static final String PREF_PREV_UPDATE="previousUpdateDir";
public static final String ACTION_UPDATE_READY=
@@ -27,7 +27,7 @@ public DownloadInstallService() {
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void doWakefulWork(Intent intent) {
SharedPreferences prefs=
PreferenceManager.getDefaultSharedPreferences(this);
String prevUpdateDir=prefs.getString(PREF_UPDATE_DIR, null);
@@ -1,7 +1,6 @@
package com.commonsware.empublite;
import android.app.DownloadManager;
-import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -14,10 +13,11 @@
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
+import com.commonsware.cwac.wakeful.WakefulIntentService;
import org.json.JSONException;
import org.json.JSONObject;
-public class DownloadCheckService extends IntentService {
+public class DownloadCheckService extends WakefulIntentService {
public static final String PREF_PENDING_UPDATE="pendingUpdateDir";
public static final String UPDATE_FILENAME="book.zip";
private static final String UPDATE_BASEDIR="updates";
@@ -29,7 +29,7 @@ public DownloadCheckService() {
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void doWakefulWork(Intent intent) {
BufferedReader reader=null;
try {
@@ -1,6 +1,5 @@
package com.commonsware.empublite;
-import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Environment;
@@ -15,8 +14,9 @@
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import com.commonsware.cwac.wakeful.WakefulIntentService;
-public class DownloadInstallService extends IntentService {
+public class DownloadInstallService extends WakefulIntentService {
public static final String PREF_UPDATE_DIR="updateDir";
public static final String PREF_PREV_UPDATE="previousUpdateDir";
public static final String ACTION_UPDATE_READY=
@@ -27,7 +27,7 @@ public DownloadInstallService() {
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void doWakefulWork(Intent intent) {
SharedPreferences prefs=
PreferenceManager.getDefaultSharedPreferences(this);
String prevUpdateDir=prefs.getString(PREF_UPDATE_DIR, null);
@@ -1,7 +1,6 @@
package com.commonsware.empublite;
import android.app.DownloadManager;
-import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -14,10 +13,11 @@
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
+import com.commonsware.cwac.wakeful.WakefulIntentService;
import org.json.JSONException;
import org.json.JSONObject;
-public class DownloadCheckService extends IntentService {
+public class DownloadCheckService extends WakefulIntentService {
public static final String PREF_PENDING_UPDATE="pendingUpdateDir";
public static final String UPDATE_FILENAME="book.zip";
private static final String UPDATE_BASEDIR="updates";
@@ -29,7 +29,7 @@ public DownloadCheckService() {
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void doWakefulWork(Intent intent) {
BufferedReader reader=null;
try {
@@ -1,6 +1,5 @@
package com.commonsware.empublite;
-import android.app.IntentService;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Environment;
@@ -15,8 +14,9 @@
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import com.commonsware.cwac.wakeful.WakefulIntentService;
-public class DownloadInstallService extends IntentService {
+public class DownloadInstallService extends WakefulIntentService {
public static final String PREF_UPDATE_DIR="updateDir";
public static final String PREF_PREV_UPDATE="previousUpdateDir";
public static final String ACTION_UPDATE_READY=
@@ -27,7 +27,7 @@ public DownloadInstallService() {
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void doWakefulWork(Intent intent) {
SharedPreferences prefs=
PreferenceManager.getDefaultSharedPreferences(this);
String prevUpdateDir=prefs.getString(PREF_UPDATE_DIR, null);

0 comments on commit df432eb

Please sign in to comment.