Restore discovery notification callback when (de)selecting SE.

When the host opens the pipe to the SE for communication,
the notification callback is temporarily changed to a
SE-specific callback. In itself this is fine, because
there can be no other devices discovered while the eSE
is connected.

However, when disconnecting the connection from the host,
the PN544 already resumes discovery. This is before we
call enableDiscover(), and before we've restored the
correct target notification callback. This race-condition
can cause a crash.

Fix it by restoring the proper notification when
(de)selecting the secure element.

Bug: 8599167
Change-Id: I26816eb8851637de18058e974b98607e4379f55d
1 file changed