Add CTS tests for cleartext network traffic security policy.

Because the policy is set in apps' manifest, this CTS test needs to
use three different apps:
1. app which declares android:usesCleartextTraffic="true",
2. app which declares android:usesCleartextTraffic="false",
3. app which does not declare the android:usesCleartextTraffic
   attribute.

Moreover, because the app which a CTS test module instruments is
hard-coded in the module, we need three CTS test modules, one for each
of the above three apps.

As a result of this complication the relatively simple CTS tests are
split over multiple directories with most of the code shared between
them.

This CL also modifies CtsTestServer, the HTTP(S) server used in many
CTS tests, to not use HttpURLConnection to shut the server down.
CtsTestServer cliens shut it down by invoking CtsTestServer.shutdown
which makes a particular HTTP(S) request to the server which the
server then carries out. If HTTP traffic is blocked in an app, this
method of notifying the server will not work. To avoid entirely
changing the shutdown mechanism, this CL switching to issuing the
shutdown HTTP request using Socket API instead of the
HttpURLConnection API. This is because Socket API is not affected by
the cleartext network traffic policy.

Bug: 19215516
Change-Id: Id3c54bcf0e610b04884fba24707b81eb87917795
20 files changed