MAP: Fix to handle crash in MAP in Direct Boot Mode.

Usecase:
1) Enable Direct boot mode in DUT.
2) Reboot DUT and connect to remote device in Locked state.
3) Disconnect from remote device(with failed pending messages).

Issue:
Exception while moving pending messages from outbox to failed.

Root Cause:
As database is not accessible in Direct Boot Mode, it results in
fatal exception while trying to move messages from outbox to failed
when remote disconnects and DUT is still not unlocked.

Fix:
Prevent failPendingMessages if device is not unlocked in Direct
Boot Mode.

Change-Id: I616ed3bfb2e390c420658b8927de547ad70d1bea
CRs-Fixed: 2048514
1 file changed