diff options
author | Jizhou Liao <jizhou.liao@nxp.com> | 2018-04-03 10:32:48 -0700 |
---|---|---|
committer | Ruchi Kandoi <kandoiruchi@google.com> | 2018-04-04 19:38:15 +0000 |
commit | 4e9325348695e6aa35a3637763203606ac925a21 (patch) | |
tree | 12f82d9c461aab4ec7bba7a0b50bee4603fccf49 /halimpl | |
parent | 51ffd43f5eeef151446fa21aa6c6ff139c8bffe4 (diff) | |
download | android_hardware_nxp_nfc-4e9325348695e6aa35a3637763203606ac925a21.tar.gz android_hardware_nxp_nfc-4e9325348695e6aa35a3637763203606ac925a21.tar.bz2 android_hardware_nxp_nfc-4e9325348695e6aa35a3637763203606ac925a21.zip |
Fix factoryReset crash
Bug: 75980364
Test: Vts, first boot
Change-Id: Ideea59e8d1f65937d0e8edbed60a475e30063cdf
(cherry picked from commit 457f0a6862ac0c1de65468d756f5149b8a1b0ae8)
Diffstat (limited to 'halimpl')
-rwxr-xr-x | halimpl/hal/phNxpNciHal.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/halimpl/hal/phNxpNciHal.cc b/halimpl/hal/phNxpNciHal.cc index 8d941d1..1a7ae32 100755 --- a/halimpl/hal/phNxpNciHal.cc +++ b/halimpl/hal/phNxpNciHal.cc @@ -2920,7 +2920,15 @@ static NFCSTATUS phNxpNciHal_do_se_session_reset(void) { * ******************************************************************************/ void phNxpNciHal_do_factory_reset(void) { - NFCSTATUS status = phNxpNciHal_do_se_session_reset(); + NFCSTATUS status = NFCSTATUS_FAILED; + if (nxpncihal_ctrl.halStatus == HAL_STATUS_CLOSE) { + status = phNxpNciHal_MinOpen(); + if (status != NFCSTATUS_SUCCESS ) { + NXPLOG_NCIHAL_E("%s: NXP Nfc Open failed", __func__); + return; + } + } + status = phNxpNciHal_do_se_session_reset(); if (status != NFCSTATUS_SUCCESS) { NXPLOG_NCIHAL_E("%s failed. status = %x ",__func__, status); } |