Clarify receivers

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-08-01 00:26:24 +02:00 committed by AndyScherzinger
parent c1c3775752
commit 8dfdf92118
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -41,7 +41,7 @@ public class ReceiversHelper {
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (!Device.getNetworkType(context).equals(JobRequest.NetworkType.ANY)) {
if (Device.getNetworkType(context).equals(JobRequest.NetworkType.UNMETERED)) {
FilesSyncHelper.restartJobsIfNeeded();
}
}
@ -60,7 +60,9 @@ public class ReceiversHelper {
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
FilesSyncHelper.restartJobsIfNeeded();
if (intent.getAction().equals(Intent.ACTION_POWER_CONNECTED)) {
FilesSyncHelper.restartJobsIfNeeded();
}
}
};