mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-11 18:54:21 +00:00
7a5846a6d4
1) Move contact URI, contact photo URI, and custom label into recipient database, so there are no longer any contact DB queries during Recipient object loading. 2) Use a SoftHashMap so that any referenced Recipient objects can't get kicked out of the cache. 3) Don't load Recipient objects through the provider during sync. This was a super expensive thing to do, and blew up the cache. 4) Only apply changes to Recipient objects during sync if they are in the cache. Otherwise, there should be no outstanding references, and the changes are fine going exclusively to the DB.
24 lines
474 B
Java
24 lines
474 B
Java
package org.thoughtcrime.securesms.util;
|
|
|
|
|
|
import java.util.concurrent.LinkedBlockingDeque;
|
|
|
|
public class LinkedBlockingLifoQueue<E> extends LinkedBlockingDeque<E> {
|
|
@Override
|
|
public void put(E runnable) throws InterruptedException {
|
|
super.putFirst(runnable);
|
|
}
|
|
|
|
@Override
|
|
public boolean add(E runnable) {
|
|
super.addFirst(runnable);
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean offer(E runnable) {
|
|
super.addFirst(runnable);
|
|
return true;
|
|
}
|
|
}
|