libcore changes to support ConnectionPool cache flushing

A set of observer / listener components for network
events.

Party A, e.g. the Android ConnectivityManager, can make
changes to network configuration that impacts the java
network objects (e.g. connection pools, caches, etc.).

Party B, e.g. Android libcore network components are
interested in network configuration changes.

The NetworkEventDispatcher enables Party A to communicate
with Party B without hardcoding their details. Additional
parties like B can be added.

Bug: 17314604
(cherry-picked from commit b1e60e2015b81c285938ca569b66edda63d6533d)

Change-Id: Ie0d0a8afe14e6a15253ce72f1abf9b996176e02f
Fix FilePreferencesImplTest test initialization errors.

Fix IllegalAccessException from Preferences when this
test is run "stand alone".

The java.util.prefs.Preferences class is normally already
initialized by the time this test runs (and initialized
when there is no system property). However, in
standalone cases the system property is pointing to a
class that cannot be instantiated by ServiceLoader.

The normal fallback process when the system property is
not set would lead to FilePreferencesFactoryImpl being
instantiated directly by java.util.prefs.Preferences,
which is legal.

Removing the system property fixes the issue. The
FilePreferencesFactoryImpl is not intended to be created
by ServiceLoader and so it is reasonable that the class
is declared as package-protected. This test is for
the implementation so it's reasonable just to bypass
Preferences entirely.

Bug: 17515057
Change-Id: I02ea38b4a50fc3b7299a35d0a1050455cb9ca970
Merge "Fix FilePreferencesImplTest test initialization errors."
Merge "libcore changes to support ConnectionPool cache flushing"