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
Test: atest FrameworksWifiTests

Change-Id: I8a3b810ba95898a96d81fe57979db4787e1a46c4
4 files changed
tree: 6e04a7a1118620a70fad9fac424f36fdcea5fa7e
  1. apex/
  2. service/
  3. PREUPLOAD.cfg