[P2P] Public API to clean-up resources of P2P
1. Add public API to close a Channel and allow configuration to be
cleaned-up. Actual clean-up will only happen when the last p2p
client executes close or terminates (binder death is triggered
for the service).
2. Add Close Guard to verify that API is called - issue warning
otherwise. Note that to actually get the warning an app needs
to use the StrictMode policy:
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedClosableObjects().build());
Bug: 37443149
Test: (new) unit tests, CtsVerifier, Settings/WFD app
Change-Id: I9590101ef7f7ba0a90812634ac1b931d1482fe72
6 files changed