Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Google Password Manager list out saved passwords in Android?

I am unable to perform my android espresso unit test and it has failed with:

// (kotlin syntax)
closeSoftKeyboard()
onView(withId(R.id.et_login_mobile_number)).perform(TypeTextAction(invalidMobileNo))
closeSoftKeyboard()

androidx.test.espresso.InjectEventSecurityException: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission.

I finally learned that: ANY UNEXPECTED animation appeared on UI that is undergoing automated testing could interrupt the process.

So I suspect this is due to the Google Password Manager that suggesting the list of saved password keep popping up and it might be the one causing the interruption.

enter image description here

What I'm looking now is: THE WAY OF TURNING OFF GOOGLE PASSWORD MANAGER FROM SUGGESTING SAVED PASSWORD

All I keep found is

Manage offers to save passwords

And there is no way to turn it off / disable it


enter image description here


After I ended up delete all the saved passwords from Google Password Manager and now it turned up suggest autofill text (Kindly compare both screenshot)

I have included attributes as followed, it still DOES NOT PREVENT autofill to device with Android 8 and above.

android:inputType="number|textNoSuggestions|textFilter"

enter image description here


like image 720
elliotching Avatar asked Oct 01 '19 08:10

elliotching


2 Answers

According to this Answer ,

android:importantForAutofill="no"

works to prevent both default autofill and Google Password Manager from Android 8 and above.

like image 141
elliotching Avatar answered Sep 30 '22 07:09

elliotching


I think you should try deleting the current saved passwords and adding this app in declined apps' list. This was the app will not have any options to autofill and the pop-up will not show.

Let me know if this helps. Good luck.

like image 30
Akanshi Srivastava Avatar answered Sep 30 '22 06:09

Akanshi Srivastava