|
|
@ -67,7 +67,6 @@ import java.util.Map;
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
import java.util.concurrent.Semaphore;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.mail.Address;
|
|
|
|
import javax.mail.Address;
|
|
|
|
import javax.mail.FetchProfile;
|
|
|
|
import javax.mail.FetchProfile;
|
|
|
@ -1552,17 +1551,6 @@ public class ServiceSynchronize extends LifecycleService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void acquire(Semaphore semaphore, String name) {
|
|
|
|
|
|
|
|
boolean acquired = false;
|
|
|
|
|
|
|
|
while (!acquired)
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
semaphore.acquire();
|
|
|
|
|
|
|
|
acquired = true;
|
|
|
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
|
|
|
Log.e(Helper.TAG, name + " acquire " + ex.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void start(Context context) {
|
|
|
|
public static void start(Context context) {
|
|
|
|
ContextCompat.startForegroundService(context,
|
|
|
|
ContextCompat.startForegroundService(context,
|
|
|
|
new Intent(context, ServiceSynchronize.class));
|
|
|
|
new Intent(context, ServiceSynchronize.class));
|
|
|
|