WLAN configuration (static address): reject IPv6 addresses.

Without this, entering an IPv6 address as the interface address (or possibly
also others, such as gateway address) will, on connection to that WLAN,
trigger an uncaught exception:

*** FATAL EXCEPTION IN SYSTEM PROCESS: WifiStateMachine
java.lang.IllegalArgumentException: command '59 interface setcfg wlan0 2001:db8::ffff 24 up' failed with '501 59 Flag unsupported'
	at com.android.server.NetworkManagementService.setInterfaceConfig(NetworkManagementService.java:546)
	at android.net.wifi.WifiStateMachine$ObtainingIpState.enter(WifiStateMachine.java:3449)
	at com.android.internal.util.StateMachine$SmHandler.invokeEnterMethods(StateMachine.java:958)
[etc.]

followed by a restart of the UI then another connection attempt. So long as
the misconfigured-for AP is present (and preferred?), this will continue to
happen.

Change-Id: I524480339c37ad079fd21d90a6b1fc5864089cb5
Fix NullPointerException at RunningState

getServiceInfo returns null if you have a service defined in the
manifest as: <service android:name=".Xxx" android:exported="false" />
or and in an <application> with no label or icon.
Dont crash the Settings application because of that.

Change-Id: I6f9f69c130e610b7e4ab66426177b7bade1e1515
Check if the Activity is finishing before showDialog()

Check if the Activity is going through its finishing phase before
displaying the Dialog, because Showing dialog once the activity
is no longer in context will cause BadTokenException.

Change-Id: I58940e694f61cd79536abe2df60a0b745a7b806f