Skip to content
Snippets Groups Projects
Commit b987af12 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dring: run non-blocking constant methods in the calling thread

Should reduce UI latency

Tuleap: #468
Change-Id: Ic51b6b44daa73ffba8d0eea0d86733e011150a6a
parent 296422d3
No related branches found
No related tags found
No related merge requests found
......@@ -796,14 +796,9 @@ public class DRingService extends Service {
@Override
public Map<String, String> getAccountTemplate(final String accountType) throws RemoteException {
return getExecutor().executeAndReturn(new SipRunnableWithReturn<Map<String, String>>() {
@Override
protected Map<String, String> doRun() throws SameThreadException {
Log.i(TAG, "DRingService.getAccountTemplate() thread running...");
Log.i(TAG, "DRingService.getAccountTemplate() " + accountType);
return Ringservice.getAccountTemplate(accountType).toNative();
}
});
}
@SuppressWarnings("unchecked")
// Hashmap runtime cast
......@@ -1292,11 +1287,10 @@ public class DRingService extends Service {
getExecutor().execute(new SipRunnable() {
@Override
protected void doRun() throws SameThreadException, RemoteException {
Log.i(TAG, "DRingService.setActiveAudioCodecList() thread running...");
UintVect list = new UintVect();
for (Object codec : codecs) {
Log.i(TAG, "DRingService.setActiveCodecList() thread running...");
UintVect list = new UintVect(codecs.size());
for (Object codec : codecs)
list.add((Long) codec);
}
Ringservice.setActiveCodecList(accountID, list);
}
});
......@@ -1361,14 +1355,9 @@ public class DRingService extends Service {
@Override
public List<String> getTlsSupportedMethods(){
return getExecutor().executeAndReturn(new SipRunnableWithReturn<List<String>>() {
@Override
protected List<String> doRun() throws SameThreadException {
Log.i(TAG, "DRingService.getCredentials() thread running...");
Log.i(TAG, "DRingService.getTlsSupportedMethods()");
return SwigNativeConverter.convertSwigToNative(Ringservice.getSupportedTlsMethod());
}
});
}
@Override
public List getCredentials(final String accountID) throws RemoteException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment