mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
call setConfigFromQR() from background thread
setConfigFromQR() involves network and should not block the UI.
This commit is contained in:
@@ -50,6 +50,7 @@ import org.thoughtcrime.securesms.profiles.ProfileMediaConstraints;
|
||||
import org.thoughtcrime.securesms.qr.RegistrationQrActivity;
|
||||
import org.thoughtcrime.securesms.scribbles.ScribbleActivity;
|
||||
import org.thoughtcrime.securesms.util.Prefs;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.views.ProgressDialog;
|
||||
|
||||
import java.io.File;
|
||||
@@ -472,12 +473,16 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||
|
||||
DcHelper.getEventCenter(this).captureNextError();
|
||||
|
||||
if (!dcContext.setConfigFromQr(qrCode)) {
|
||||
progressError(dcContext.getLastError());
|
||||
return;
|
||||
}
|
||||
DcHelper.getAccounts(this).stopIo();
|
||||
dcContext.configure();
|
||||
new Thread(() -> {
|
||||
if (!dcContext.setConfigFromQr(qrCode)) {
|
||||
Util.runOnMain(() -> {
|
||||
progressError(dcContext.getLastError());
|
||||
});
|
||||
return;
|
||||
}
|
||||
DcHelper.getAccounts(this).stopIo();
|
||||
dcContext.configure();
|
||||
}).start();
|
||||
}
|
||||
|
||||
private class AvatarSelectedListener implements AvatarSelector.AttachmentClickedListener {
|
||||
|
||||
Reference in New Issue
Block a user