move migration away from ui thread

This commit is contained in:
afischerdev 2023-07-09 18:35:10 +02:00
parent 9a029af8dd
commit 62595b2553

View file

@ -174,8 +174,18 @@ public class BRouterView extends View {
// new init is done move old files // new init is done move old files
if (waitingForMigration) { if (waitingForMigration) {
Log.d("BR", "path " + oldMigrationPath + " " + basedir); Log.d("BR", "path " + oldMigrationPath + " " + basedir);
Thread t = new Thread(new Runnable() {
@Override
public void run() {
if (!oldMigrationPath.equals(basedir + "/brouter")) if (!oldMigrationPath.equals(basedir + "/brouter"))
moveFolders(oldMigrationPath, basedir + "/brouter"); moveFolders(oldMigrationPath, basedir + "/brouter");
}});
t.start();
try {
t.join(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
waitingForMigration = false; waitingForMigration = false;
} }