run UpdateService at lowest priority possible
Currently, UpdateService is running at default priority, which is the same as the UI tasks, since it is a regular IntentService. That means it would put a noticable load on the device when running, especially on older devices. This should help with that. #563 https://gitlab.com/fdroid/fdroidclient/issues/563
This commit is contained in:
parent
22e40bfee1
commit
ed09b1af2d
@ -31,6 +31,7 @@ import android.database.Cursor;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.os.SystemClock;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
@ -338,6 +339,7 @@ public class UpdateService extends IntentService implements ProgressListener {
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);
|
||||
|
||||
final long startTime = System.currentTimeMillis();
|
||||
String address = intent.getStringExtra(EXTRA_ADDRESS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user