AccountServiceProxy.restoreAccountsIfNeeded should be synchronous

* In the case where there are no Exchange accounts, we can stop ExchangeService
  while restoreAccountsIfNeeded is still running, which can cause us to leak
  the connection
* Change the call to be synchronous.

Bug: 3495601
Change-Id: I4a396e8b1650bd15fabd2802d2ec8d4276c6e43a
This commit is contained in:
Marc Blank 2011-02-28 12:01:06 -08:00
parent b02f7eb1e8
commit e4481d4110
1 changed files with 5 additions and 0 deletions

View File

@ -79,6 +79,7 @@ public class AccountServiceProxy extends ServiceProxy implements IAccountService
}, "accountDeleted");
}
// The following call is synchronous, and should not be made from the UI thread
@Override
public void restoreAccountsIfNeeded() throws RemoteException {
setTask(new ProxyTask() {
@ -86,8 +87,10 @@ public class AccountServiceProxy extends ServiceProxy implements IAccountService
mService.restoreAccountsIfNeeded();
}
}, "restoreAccountsIfNeeded");
waitForCompletion();
}
// The following call is synchronous, and should not be made from the UI thread
@Override
public int getAccountColor(final long accountId) throws RemoteException {
setTask(new ProxyTask() {
@ -103,6 +106,7 @@ public class AccountServiceProxy extends ServiceProxy implements IAccountService
}
}
// The following call is synchronous, and should not be made from the UI thread
public Bundle getConfigurationData(final String accountType) throws RemoteException {
setTask(new ProxyTask() {
public void run() throws RemoteException{
@ -117,6 +121,7 @@ public class AccountServiceProxy extends ServiceProxy implements IAccountService
}
}
// The following call is synchronous, and should not be made from the UI thread
public String getDeviceId() throws RemoteException {
setTask(new ProxyTask() {
public void run() throws RemoteException{