Skip to content
Snippets Groups Projects
Commit 4603657f authored by Alexandre Savard's avatar Alexandre Savard
Browse files

#15735: Add addAccount and removeAccount methods to AIDL interface

parent 3bbb4799
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@ interface ISipService {
void accept(in String callID);
void hangUp(in String callID);
List getAccountList();
String addAccount(in Map accountDetails);
void removeAccount(in String accoundId);
Map getAccountDetails(in String accountID);
void setAccountDetails(in String accountId, in Map accountDetails);
void setAudioPlugin(in String callID);
......
......@@ -191,9 +191,40 @@ public class SipService extends Service {
configurationManagerJNI.setAccountDetails(accountId, swigmap);
}
});
}
@Override
public String addAccount(Map map) {
class AddAccount extends SipRunnableWithReturn {
StringMap map;
AddAccount(StringMap m) { map = m; }
@Override
protected String doRun() throws SameThreadException {
Log.i(TAG, "SipService.getAccountDetails() thread running...");
return configurationManagerJNI.addAccount(map);
}
};
final StringMap swigmap = AccountDetailsHandler.convertFromNativeToSwig((HashMap<String,String>)map);
AddAccount runInstance = new AddAccount(swigmap);
getExecutor().execute(runInstance);
while(!runInstance.isDone()) {}
String accountId = (String) runInstance.getVal();
return accountId;
}
@Override
public void removeAccount(final String accountId) {
getExecutor().execute(new SipRunnable() {
@Override
protected void doRun() throws SameThreadException {
Log.i(TAG, "SipService.setAccountDetails() thread running...");
configurationManagerJNI.removeAccount(accountId);
}
});
}
};
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment