fix soft reboot caused by KeyStore exception
The Mac handle obtained from AndroidKeyStore is sometimes invalidated by
the AndroidKeyStore based on some LRU technique.
This change make sure that we always get a valid handle.
And adds exception handling to make sure a crash will not happen for the
same reason again.
If KeyStore continuously fails to generate MAC address, we will use
locally generated MAC as it is the next best option.
Test: atest FrameworksWifiTests
(cherry-picked from e299359a6e6e9e13217862f7f66627eccbff46ce)
(cherry picked from commit 0b3eca3c05190e5824638f3da25b8b3167dc9d60)
4 files changed