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.
Bug: 146203882
Bug: 140065828
Test: atest FrameworksWifiTests
Merged-In: I8a3b810ba95898a96d81fe57979db4787e1a46c4
Change-Id: I8a3b810ba95898a96d81fe57979db4787e1a46c4
(cherry-picked from 0b3eca3c05190e5824638f3da25b8b3167dc9d60)
(cherry picked from commit b4486b2a1bce042384b6da156aced9c8ff76b5ec)
4 files changed