Don't send BLOCK_DISCOVERY when P2P is in Disabled state

Before triggering the DHCP, clientModeImpl send BLOCK_DISCOVERY
to stop the P2P discovery. And wait for CMD_PRE_DHCP_ACTION_COMPLETE
message back from P2P module. This is done to protect the DHCP exchange.
But if p2p is in a waiting state(Transitioned from Disabled state) for user
response to create the interface, all the messages will be deferred.
So clientModeImpl doesn't get CMD_PRE_DHCP_ACTION_COMPLETE response from P2P module.
This blocks the DHCP when p2p is in waiting state.

A change (Iacf3e35e82c3cf06e9986dba3535a1ac71b4dd88) was added in last year
to prevent BLOCK_DISCOVERY message exchange when P2P is in waiting state.
But that didn't fix the issue. So modified the
logic to, not to send BLOCK_DISCOVER if p2p service is not running.

Bug: 391509308
Test: atest ClientModeImplTest
Flag: EXEMPT bugfix
Change-Id: I65ffa331c5bfeb2c4143c9e21ddc780ee66f36c1
4 files changed