mirror of
https://github.com/etesync/android
synced 2024-12-24 15:38:09 +00:00
Remove the ACCOUNT_TYPE constant (now a string resource)
This corresponds to commit 41dae8bcb3335b9e77d9e73b33e9bb14f8900af9 from DAVdroid, but was done manually.
This commit is contained in:
parent
0d7e2362b3
commit
dfb8981752
@ -329,7 +329,7 @@ public class AccountSettings {
|
|||||||
|
|
||||||
// peek into AccountSettings to initiate a possible migration
|
// peek into AccountSettings to initiate a possible migration
|
||||||
AccountManager accountManager = AccountManager.get(context);
|
AccountManager accountManager = AccountManager.get(context);
|
||||||
for (Account account : accountManager.getAccountsByType(Constants.ACCOUNT_TYPE))
|
for (Account account : accountManager.getAccountsByType(App.getAccountType()))
|
||||||
try {
|
try {
|
||||||
App.log.info("Checking account " + account.name);
|
App.log.info("Checking account " + account.name);
|
||||||
new AccountSettings(context, account);
|
new AccountSettings(context, account);
|
||||||
|
@ -310,7 +310,7 @@ public class App extends Application {
|
|||||||
if (fromVersion < 7) {
|
if (fromVersion < 7) {
|
||||||
/* Fix all of the etags to be non-null */
|
/* Fix all of the etags to be non-null */
|
||||||
AccountManager am = AccountManager.get(this);
|
AccountManager am = AccountManager.get(this);
|
||||||
for (Account account : am.getAccountsByType(Constants.ACCOUNT_TYPE)) {
|
for (Account account : am.getAccountsByType(App.getAccountType())) {
|
||||||
try {
|
try {
|
||||||
// Generate account settings to make sure account is migrated.
|
// Generate account settings to make sure account is migrated.
|
||||||
new AccountSettings(this, account);
|
new AccountSettings(this, account);
|
||||||
|
@ -13,9 +13,6 @@ import static com.etesync.syncadapter.BuildConfig.DEBUG_REMOTE_URL;
|
|||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
public static final String
|
|
||||||
ACCOUNT_TYPE = "com.etesync.syncadapter";
|
|
||||||
|
|
||||||
// notification IDs
|
// notification IDs
|
||||||
public final static int
|
public final static int
|
||||||
NOTIFICATION_ACCOUNT_SETTINGS_UPDATED = 0,
|
NOTIFICATION_ACCOUNT_SETTINGS_UPDATED = 0,
|
||||||
|
@ -29,6 +29,7 @@ import android.widget.ListView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.etesync.syncadapter.AccountsChangedReceiver;
|
import com.etesync.syncadapter.AccountsChangedReceiver;
|
||||||
|
import com.etesync.syncadapter.App;
|
||||||
import com.etesync.syncadapter.Constants;
|
import com.etesync.syncadapter.Constants;
|
||||||
import com.etesync.syncadapter.R;
|
import com.etesync.syncadapter.R;
|
||||||
|
|
||||||
@ -106,7 +107,7 @@ public class AccountListFragment extends ListFragment implements LoaderManager.L
|
|||||||
@Override
|
@Override
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
public Account[] loadInBackground() {
|
public Account[] loadInBackground() {
|
||||||
return accountManager.getAccountsByType(Constants.ACCOUNT_TYPE);
|
return accountManager.getAccountsByType(App.getAccountType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ public class SetupEncryptionFragment extends DialogFragment implements LoaderMan
|
|||||||
|
|
||||||
|
|
||||||
protected boolean createAccount(String accountName, BaseConfigurationFinder.Configuration config) {
|
protected boolean createAccount(String accountName, BaseConfigurationFinder.Configuration config) {
|
||||||
Account account = new Account(accountName, Constants.ACCOUNT_TYPE);
|
Account account = new Account(accountName, App.getAccountType());
|
||||||
|
|
||||||
// create Android account
|
// create Android account
|
||||||
Bundle userData = AccountSettings.initialUserData(config.url, config.userName);
|
Bundle userData = AccountSettings.initialUserData(config.url, config.userName);
|
||||||
|
Loading…
Reference in New Issue
Block a user