How to disable Fingerprint sensor in Android Emulator? I could not find any option in settings window or config.ini file.
By default, all the emulators above SDK 23 have fingerprint support. I would like to test my flow in above SDK 23 with no fingerprint support.
In the folder there should be four files - uevent , bind and the ones we will need unbind and deviceName . Now the system will think that there is no fingerprint sensor in the system... till the next reboot.
Run your Android emulator and go to Settings->Security & location->Fingerprint. If you have set up your PIN, enter it on your emulator. If you haven't set up your PIN, Android emulator will prompt you to add it at this point. Click Add fingerprint.
Open Settings > Lock Screen and Security > Screen Lock Type and toggle off all the options under the Biometrics section.
To do this, jump into the Settings menu, then tap the “Security & Location” option. On the Security & Location page, tap the “Lock Screen Preferences” setting. On the next page, turn on the “Show Lockdown” toggle. Bam, you're there.
It is not possible to achieve with conventional methods. There are unconventional though.
The reason you cannot disable is that its presence is regulated not via Android Framework but via underlaying Linux OS as for all the other sensors. Thus if your system has driver for this sensor - Android will think that this sensor is present.
So fingerprint sensor presence is driver dependent. The solution is easy now. If there will be no driver - there will be no sensor present. All you have to do is to disable(disconnect from the OS) driver. For that you will need
I am not completely sure how fingerprint driver is depicted in the system(I was doing it with other sensor) but after not very long googling and using of extrapolation I think it may be called something like fpc.
So you may want to search for this in the system drives folder - something like /sys/bus/(platform/spi/blablabla/something)/drivers/fpc.../
In the folder there should be four files - uevent
, bind
and the ones we will need unbind
and deviceName
.
And now unbind the sensor - echo deviceName > /sys/bus/(platform/spi/blablabla/something)/drivers/fpc.../unbind
Now the system will think that there is no fingerprint sensor in the system... till the next reboot.
I was doing this on the real device and with other sensor but I think the method should be pretty much the same.
Inspiration taken from here
Hope it helps.
There is no clear way to override it in the emulator settings. A workaround would be to extend either BiometricPrompt (API 28+) or FingerprintManagerCompat (27 and below) and provide your own implementation. For an extension of FingerprintManagerCompat you would override isHardwareDetected() to be something like
override fun isHardwareDetected() { if (System.getProperty("os.arch") == "mips64") { return false; } return super.isHardwareDetected() }
For BiometricPrompt you would override BiometricPrompt.authenticate() in a similar manner to return the constant BIOMETRIC_ERROR_HW_UNAVAILABLE
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With