wpa_supplicant(hidl): Handle file access denials

For new devices (launching with P+), we're removing the sepolicy
exception granted to wpa_supplicant to access /data/misc/wifi.

This causes a problem in the .conf file migration logic in the HIDL
interface. We currently identify clean (new/factory-reset/wiped) devices by
the ENOENT error code, which indicates the legacy conf file does not
exist. But, with the sepolicy exception removed for new devices, we will
now receive an error code of EACCESS instead of ENOENT.
For older devices (launched with O), the sepolicy exception
granted will continue and hence they would have access to /data/misc/wifi/
in P.

Bug: 72643420
Bug: 74120033
Test: Booted device in enforcing mode and completed the setup wizard.
Change-Id: I4ca0cf97420f2cd377f02d856e26b9a92c3631c2
1 file changed