Handle recipient modification callbacks on main thread

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2017-09-08 11:36:09 -07:00
parent 989ea4042c
commit afed60f870
3 changed files with 10 additions and 4 deletions

View File

@ -42,6 +42,7 @@ import org.thoughtcrime.securesms.util.DateUtils;
import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.SaveAttachmentTask;
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.video.VideoPlayer;
import java.io.IOException;
@ -98,7 +99,7 @@ public class MediaPreviewActivity extends PassphraseRequiredActionBarActivity im
@Override
public void onModified(Recipient recipient) {
initializeActionBar();
Util.runOnMain(this::initializeActionBar);
}
private void initializeActionBar() {

View File

@ -46,6 +46,7 @@ import org.thoughtcrime.securesms.contacts.avatars.ContactPhotoFactory;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.recipients.RecipientModifiedListener;
import org.thoughtcrime.securesms.service.WebRtcCallService;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.VerifySpan;
import org.thoughtcrime.securesms.util.ViewUtil;
import org.webrtc.SurfaceViewRenderer;
@ -339,9 +340,11 @@ public class WebRtcCallScreen extends FrameLayout implements RecipientModifiedLi
@Override
public void onModified(Recipient recipient) {
if (recipient == this.recipient) {
setPersonInfo(recipient);
}
Util.runOnMain(() -> {
if (recipient == WebRtcCallScreen.this.recipient) {
setPersonInfo(recipient);
}
});
}
public static interface HangupButtonListener {

View File

@ -1299,6 +1299,8 @@ public class DatabaseFactory {
db.insert("recipient_preferences", null, contentValues);
}
}
if (cursor != null) cursor.close();
}
if (oldVersion < INTERNAL_SYSTEM_DISPLAY_NAME) {