mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-04 08:05:10 +00:00
Don't call mutex.lock in the main thread
This commit is contained in:
@@ -306,14 +306,19 @@ public class BackgroundService extends Service {
|
|||||||
RunCommand(c, null);
|
RunCommand(c, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RunCommand(Context c, final InstanceCallback callback) {
|
public static void RunCommand(final Context c, final InstanceCallback callback) {
|
||||||
if (callback != null) {
|
new Thread(new Runnable() {
|
||||||
mutex.lock();
|
@Override
|
||||||
callbacks.add(callback);
|
public void run() {
|
||||||
mutex.unlock();
|
if (callback != null) {
|
||||||
}
|
mutex.lock();
|
||||||
Intent serviceIntent = new Intent(c, BackgroundService.class);
|
callbacks.add(callback);
|
||||||
c.startService(serviceIntent);
|
mutex.unlock();
|
||||||
|
}
|
||||||
|
Intent serviceIntent = new Intent(c, BackgroundService.class);
|
||||||
|
c.startService(serviceIntent);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user