1
0
mirror of https://github.com/etesync/android synced 2024-12-23 15:18:14 +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:
Tom Hacohen 2017-04-21 17:02:21 +01:00
parent 0d7e2362b3
commit dfb8981752
5 changed files with 5 additions and 7 deletions

View File

@ -329,7 +329,7 @@ public class AccountSettings {
// peek into AccountSettings to initiate a possible migration
AccountManager accountManager = AccountManager.get(context);
for (Account account : accountManager.getAccountsByType(Constants.ACCOUNT_TYPE))
for (Account account : accountManager.getAccountsByType(App.getAccountType()))
try {
App.log.info("Checking account " + account.name);
new AccountSettings(context, account);

View File

@ -310,7 +310,7 @@ public class App extends Application {
if (fromVersion < 7) {
/* Fix all of the etags to be non-null */
AccountManager am = AccountManager.get(this);
for (Account account : am.getAccountsByType(Constants.ACCOUNT_TYPE)) {
for (Account account : am.getAccountsByType(App.getAccountType())) {
try {
// Generate account settings to make sure account is migrated.
new AccountSettings(this, account);

View File

@ -13,9 +13,6 @@ import static com.etesync.syncadapter.BuildConfig.DEBUG_REMOTE_URL;
public class Constants {
public static final String
ACCOUNT_TYPE = "com.etesync.syncadapter";
// notification IDs
public final static int
NOTIFICATION_ACCOUNT_SETTINGS_UPDATED = 0,

View File

@ -29,6 +29,7 @@ import android.widget.ListView;
import android.widget.TextView;
import com.etesync.syncadapter.AccountsChangedReceiver;
import com.etesync.syncadapter.App;
import com.etesync.syncadapter.Constants;
import com.etesync.syncadapter.R;
@ -106,7 +107,7 @@ public class AccountListFragment extends ListFragment implements LoaderManager.L
@Override
@SuppressLint("MissingPermission")
public Account[] loadInBackground() {
return accountManager.getAccountsByType(Constants.ACCOUNT_TYPE);
return accountManager.getAccountsByType(App.getAccountType());
}
}

View File

@ -146,7 +146,7 @@ public class SetupEncryptionFragment extends DialogFragment implements LoaderMan
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
Bundle userData = AccountSettings.initialUserData(config.url, config.userName);