mirror of
https://github.com/etesync/android
synced 2025-01-23 06:01:01 +00:00
Rename DavResourceFinder.
This commit is contained in:
parent
dcb3429884
commit
d62d7049f2
@ -27,7 +27,7 @@ public class DavResourceFinderTest {
|
||||
|
||||
MockWebServer server = new MockWebServer();
|
||||
|
||||
DavResourceFinder finder;
|
||||
BaseConfigurationFinder finder;
|
||||
OkHttpClient client;
|
||||
LoginCredentials credentials;
|
||||
|
||||
@ -48,7 +48,7 @@ public class DavResourceFinderTest {
|
||||
server.start();
|
||||
|
||||
credentials = new LoginCredentials(URI.create("/"), "mock", "12345");
|
||||
finder = new DavResourceFinder(getTargetContext(), credentials);
|
||||
finder = new BaseConfigurationFinder(getTargetContext(), credentials);
|
||||
|
||||
client = HttpClient.create(null);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ import lombok.ToString;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
public class DavResourceFinder {
|
||||
public class BaseConfigurationFinder {
|
||||
protected final Context context;
|
||||
protected final LoginCredentials credentials;
|
||||
|
||||
@ -36,11 +36,11 @@ public class DavResourceFinder {
|
||||
protected final StringHandler logBuffer = new StringHandler();
|
||||
protected OkHttpClient httpClient;
|
||||
|
||||
public DavResourceFinder(@NonNull Context context, @NonNull LoginCredentials credentials) {
|
||||
public BaseConfigurationFinder(@NonNull Context context, @NonNull LoginCredentials credentials) {
|
||||
this.context = context;
|
||||
this.credentials = credentials;
|
||||
|
||||
log = Logger.getLogger("davdroid.DavResourceFinder");
|
||||
log = Logger.getLogger("davdroid.BaseConfigurationFinder");
|
||||
log.setLevel(Level.FINEST);
|
||||
log.addHandler(logBuffer);
|
||||
|
@ -24,7 +24,7 @@ import android.support.v7.app.AlertDialog;
|
||||
import at.bitfire.davdroid.App;
|
||||
import at.bitfire.davdroid.R;
|
||||
import at.bitfire.davdroid.ui.DebugInfoActivity;
|
||||
import at.bitfire.davdroid.ui.setup.DavResourceFinder.Configuration;
|
||||
import at.bitfire.davdroid.ui.setup.BaseConfigurationFinder.Configuration;
|
||||
|
||||
public class DetectConfigurationFragment extends DialogFragment implements LoaderManager.LoaderCallbacks<Configuration> {
|
||||
protected static final String ARG_LOGIN_CREDENTIALS = "credentials";
|
||||
@ -139,7 +139,7 @@ public class DetectConfigurationFragment extends DialogFragment implements Loade
|
||||
|
||||
@Override
|
||||
public Configuration loadInBackground() {
|
||||
return new DavResourceFinder(context, credentials).findInitialConfiguration();
|
||||
return new BaseConfigurationFinder(context, credentials).findInitialConfiguration();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class EncryptionDetailsFragment extends Fragment {
|
||||
EditPassword editPassword = null;
|
||||
|
||||
|
||||
public static EncryptionDetailsFragment newInstance(DavResourceFinder.Configuration config) {
|
||||
public static EncryptionDetailsFragment newInstance(BaseConfigurationFinder.Configuration config) {
|
||||
EncryptionDetailsFragment frag = new EncryptionDetailsFragment();
|
||||
Bundle args = new Bundle(1);
|
||||
args.putSerializable(KEY_CONFIG, config);
|
||||
@ -46,7 +46,7 @@ public class EncryptionDetailsFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
final DavResourceFinder.Configuration config = (DavResourceFinder.Configuration)getArguments().getSerializable(KEY_CONFIG);
|
||||
final BaseConfigurationFinder.Configuration config = (BaseConfigurationFinder.Configuration)getArguments().getSerializable(KEY_CONFIG);
|
||||
|
||||
TextView accountName = (TextView)v.findViewById(R.id.account_name);
|
||||
accountName.setText(getString(R.string.login_encryption_account_label) + " " + config.userName);
|
||||
@ -68,7 +68,7 @@ public class EncryptionDetailsFragment extends Fragment {
|
||||
return v;
|
||||
}
|
||||
|
||||
private DavResourceFinder.Configuration validateEncryptionData(DavResourceFinder.Configuration config) {
|
||||
private BaseConfigurationFinder.Configuration validateEncryptionData(BaseConfigurationFinder.Configuration config) {
|
||||
boolean valid = true;
|
||||
String password = editPassword.getText().toString();
|
||||
if (password.isEmpty()) {
|
||||
|
@ -37,14 +37,14 @@ import at.bitfire.davdroid.journalmanager.Helpers;
|
||||
import at.bitfire.davdroid.model.CollectionInfo;
|
||||
import at.bitfire.davdroid.model.ServiceDB;
|
||||
import at.bitfire.davdroid.resource.LocalTaskList;
|
||||
import at.bitfire.davdroid.ui.setup.DavResourceFinder.Configuration;
|
||||
import at.bitfire.davdroid.ui.setup.BaseConfigurationFinder.Configuration;
|
||||
import at.bitfire.ical4android.TaskProvider;
|
||||
import lombok.Cleanup;
|
||||
|
||||
public class SetupEncryptionFragment extends DialogFragment implements LoaderManager.LoaderCallbacks<Configuration> {
|
||||
private static final String KEY_CONFIG = "config";
|
||||
|
||||
public static SetupEncryptionFragment newInstance(DavResourceFinder.Configuration config) {
|
||||
public static SetupEncryptionFragment newInstance(BaseConfigurationFinder.Configuration config) {
|
||||
SetupEncryptionFragment frag = new SetupEncryptionFragment();
|
||||
Bundle args = new Bundle(1);
|
||||
args.putSerializable(KEY_CONFIG, config);
|
||||
@ -115,7 +115,7 @@ public class SetupEncryptionFragment extends DialogFragment implements LoaderMan
|
||||
}
|
||||
|
||||
|
||||
protected boolean createAccount(String accountName, DavResourceFinder.Configuration config) {
|
||||
protected boolean createAccount(String accountName, BaseConfigurationFinder.Configuration config) {
|
||||
Account account = new Account(accountName, Constants.ACCOUNT_TYPE);
|
||||
|
||||
// create Android account
|
||||
@ -167,7 +167,7 @@ public class SetupEncryptionFragment extends DialogFragment implements LoaderMan
|
||||
return true;
|
||||
}
|
||||
|
||||
protected long insertService(SQLiteDatabase db, String accountName, String service, DavResourceFinder.Configuration.ServiceInfo info) {
|
||||
protected long insertService(SQLiteDatabase db, String accountName, String service, BaseConfigurationFinder.Configuration.ServiceInfo info) {
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
// insert service
|
||||
|
Loading…
Reference in New Issue
Block a user