diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java b/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java index 2d26d8c9..2851ef04 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java @@ -72,7 +72,7 @@ public class AccountContentProvider extends ContentProvider { accounts = am.getAccountsByTypeForPackage(arg, packageName); } if (accounts == null || accounts.length == 0) { - accounts = am.getAccountsByType(arg); + accounts = new Account[0]; } } if (accounts == null) { diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AuthManager.java b/play-services-core/src/main/java/org/microg/gms/auth/AuthManager.java index 82677a42..e4ca6938 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AuthManager.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AuthManager.java @@ -134,9 +134,6 @@ public class AuthManager { } public boolean accountExists() { - for (Account refAccount : getAccountManager().getAccountsByType(accountType)) { - if (refAccount.name.equalsIgnoreCase(accountName)) return true; - } return false; } diff --git a/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java b/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java index 0804d384..51206fb8 100755 --- a/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java +++ b/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java @@ -53,19 +53,7 @@ public class AccountSettingsActivity extends AbstractSettingsActivity { super.onCreatePreferences(savedInstanceState, rootKey); Preference pref = findPreference(PREF_AUTH_VISIBLE); if (pref != null) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - pref.setVisible(false); - } else { - pref.setOnPreferenceChangeListener((preference, newValue) -> { - if (newValue instanceof Boolean) { - AccountManager am = AccountManager.get(getContext()); - for (Account account : am.getAccountsByType(AuthConstants.DEFAULT_ACCOUNT_TYPE)) { - am.setAccountVisibility(account, PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE, (Boolean) newValue ? VISIBILITY_USER_MANAGED_VISIBLE : VISIBILITY_USER_MANAGED_NOT_VISIBLE); - } - } - return true; - }); - } + pref.setVisible(false); } } }