mirror of https://github.com/tasks/tasks
Silently update security provider
parent
8a94c15ebe
commit
f76d046b11
@ -1,10 +1,22 @@
|
|||||||
package org.tasks.activities;
|
package org.tasks.activities;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import org.tasks.caldav.CaldavClient;
|
import org.tasks.caldav.CaldavClient;
|
||||||
|
import org.tasks.gtasks.PlayServices;
|
||||||
import org.tasks.ui.CompletableViewModel;
|
import org.tasks.ui.CompletableViewModel;
|
||||||
|
|
||||||
public class AddCaldavAccountViewModel extends CompletableViewModel<String> {
|
public class AddCaldavAccountViewModel extends CompletableViewModel<String> {
|
||||||
public void addAccount(CaldavClient client, String url, String username, String password) {
|
public void addAccount(
|
||||||
run(() -> client.forUrl(url, username, password).getHomeSet());
|
PlayServices playServices,
|
||||||
|
Context context,
|
||||||
|
CaldavClient client,
|
||||||
|
String url,
|
||||||
|
String username,
|
||||||
|
String password) {
|
||||||
|
run(
|
||||||
|
() -> {
|
||||||
|
playServices.updateSecurityProvider(context);
|
||||||
|
return client.forUrl(url, username, password).getHomeSet();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue