disable autofill for password field when not in init mode

maybe fixes #3924
This commit is contained in:
Daniel Gultsch 2020-11-16 12:08:07 +01:00
parent c7ec6a9dae
commit 36f5f77c30

View file

@ -9,6 +9,7 @@ import android.content.SharedPreferences;
import android.databinding.DataBindingUtil; import android.databinding.DataBindingUtil;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
@ -64,6 +65,7 @@ import eu.siacs.conversations.ui.util.AvatarWorkerTask;
import eu.siacs.conversations.ui.util.MenuDoubleTabUtil; import eu.siacs.conversations.ui.util.MenuDoubleTabUtil;
import eu.siacs.conversations.ui.util.PendingItem; import eu.siacs.conversations.ui.util.PendingItem;
import eu.siacs.conversations.ui.util.SoftKeyboardUtils; import eu.siacs.conversations.ui.util.SoftKeyboardUtils;
import eu.siacs.conversations.utils.CharSequenceUtils;
import eu.siacs.conversations.utils.CryptoHelper; import eu.siacs.conversations.utils.CryptoHelper;
import eu.siacs.conversations.utils.Resolver; import eu.siacs.conversations.utils.Resolver;
import eu.siacs.conversations.utils.SignupUtils; import eu.siacs.conversations.utils.SignupUtils;
@ -964,6 +966,10 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
} }
if (!mInitMode && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
this.binding.accountPassword.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);
}
final boolean editable = !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && !mAccount.isOptionSet(Account.OPTION_FIXED_USERNAME) && QuickConversationsService.isConversations(); final boolean editable = !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && !mAccount.isOptionSet(Account.OPTION_FIXED_USERNAME) && QuickConversationsService.isConversations();
this.binding.accountJid.setEnabled(editable); this.binding.accountJid.setEnabled(editable);
this.binding.accountJid.setFocusable(editable); this.binding.accountJid.setFocusable(editable);
@ -975,10 +981,10 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
updateDisplayName(displayName); updateDisplayName(displayName);
final boolean tooglePassword = mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY); final boolean togglePassword = mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || !mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY);
final boolean editPassword = !mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || (!mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && QuickConversationsService.isConversations()) || mAccount.getLastErrorStatus() == Account.State.UNAUTHORIZED; final boolean editPassword = !mAccount.isOptionSet(Account.OPTION_MAGIC_CREATE) || (!mAccount.isOptionSet(Account.OPTION_LOGGED_IN_SUCCESSFULLY) && QuickConversationsService.isConversations()) || mAccount.getLastErrorStatus() == Account.State.UNAUTHORIZED;
this.binding.accountPasswordLayout.setPasswordVisibilityToggleEnabled(tooglePassword); this.binding.accountPasswordLayout.setPasswordVisibilityToggleEnabled(togglePassword);
this.binding.accountPassword.setFocusable(editPassword); this.binding.accountPassword.setFocusable(editPassword);
this.binding.accountPassword.setFocusableInTouchMode(editPassword); this.binding.accountPassword.setFocusableInTouchMode(editPassword);