Add null check on getting p2p iface name

Cherry-picked from partners

After tearing down client interface, p2p interface will be invalid and
null is returned when getting p2p interface name. When Wifi on/off is
quickly repeated, a crash happens due to NullPointerException because
WifiP2pNative#setupInterface is called and trying to get p2p interface
name at that time while p2p iface is marked as invalid (client mode is
shutting down). This patch adds null check on getting p2p iface name
to avoid crash.

Bug: 80095183
Test: manual

Change-Id: I8aee5e3ca4d77eae3ed94aa76f6666649424e690
1 file changed