IPV6 tethering: Check info for null before removeUpstreamV6Interface

When tethering on dual stack networks such as verizon wireless and
sending or recieving MMS you get an null pointer exception and hard
reboot.

It starts to go wrong here:
10-14 19:11:51.375: E/Mms/smil(28035): Failed to parse SMIL document.
10-14 19:11:51.375: E/Mms/smil(28035): org.xml.sax.SAXParseException:
expected start tag notEND_DOCUMENT null@1:1 in java.io.InputStreamReader
@4192ada0

And then:
10-14 19:11:55.559: E/AndroidRuntime(23125): java.lang.NullPointerException
10-14 19:11:55.559: E/AndroidRuntime(23125):    at com.android.server.
connectivity.Tethering$TetherMasterSM$TetherModeAliveState.processMessage
(Tethering.java:1573)

Which is line 1573 of:

https://github.com/CyanogenMod/android_frameworks_base/blob/cm-10.2/services/java/com/android/server/connectivity/Tethering.java#L1573

CMD_UPSTREAM_CHANGED's message.obj can be null (line 776).

Change-Id: I13d531d398f2e33a828c6e81f25f4b2a27518d34
server: add enhanced routing support

Add support for policy and metric based routing APIs to
NetworkManagementService. This functionality is used for WQE, IMS, and
Android QoS features.

Change-Id: I5e50185c9ac1cf72c9366815c2ecf590842edfca
base: IPV6 tethering support

Added two APIs addUpstreamV6Interface and removeUpstreamV6Interface,
required to pass the interfaces to use to the Router Advertisement
Proxy.
Added a dun entry to the networkAttributes value in
res/values/config.xml.
This is to allow tethering to work with the dunRequired property.
Added dun to allowable tether upstream type.
Enabled debug flags for debug logging inside framework components.
Regardless of MOBILE_TYPE_DUN APN being available, if dun_required
flag is not set, fall back to HIPRI as a preferred APN for the
embedded data call.
Debug logging was enabled by default which was causing security
vulnerabilities. This patch disables debug logging.

CRs-fixed: 555006
Change-Id: Idb0971449473554bcd749d478563db7ba351d55d
Acked-by: Subash Abhinov Kasiviswanathan <subashab@qti.qualcomm.com>
(cherry picked from commit 43bac130e4bab1c12792d29042f85c6a10372553)
(cherry picked from commit be8491aa9d82177c200eab1af713244a7bbbdcfc)
base: Fix for wifi tethering crash

Pass network info along with CMD_UPSTREAM_CHANGED
Added a NULL check for Network info in CMD_UPSTREAM_CHANGED

CRs-fixed: 562910
Change-Id: I98bd37205255d9d4025cfb95b0688c68bce3c9bd
Allow override of DUN settings

Allow override of system DUN settings by setting
persist.sys.dun.override
to one of the following values:
2 = not set, 0 = DUN not required, 1 = DUN required
If the prop is not set or is set to an invalid value the system setting
will be used.

Change-Id: I296f303a23351e4ab29898895abfcd313c747db9
Tethering: fix NPE when retrieving active interfaces

When in airplane mode getActiveNetworkInfo() may return null.

Change-Id: Icba37abb51b9378c8af73d9f6587e04c588dd85e
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Tethering: Add missing import

Change-Id: I6a0a454168a15b2d8e137125f0073636cac92003