User defined wifi/usb tether network. [1/2]

Change-Id: I1989c5332ba598a04094b03d6a5de32d72f7fa1c
tether: tethering chooses wrong upstream when mobile_dun is required

When mobile_dun is required, the default mobile type will
be deleted from upstream list, this makes wifi become
the highest priority upstream even whne wifi is not available.

Change-Id: I2c12f6cd6d52331220dce900609ad072f9ec3fbc
CRs-fixed: 671675
Broadcast upstream interface change event independently for IPv4 & IPv6

On change in tethering upstream interface for IPV4 or IPV6 address,
broadcast an intent with the information viz iface name, ip address
type and update type(i.e add or delete).

Change-Id: I69339dc0cfe3ceb566eb1891e264ccfd07785b48
CRs-Fixed: 680728
Broadcast tethered client inteface along with upstream interface name

On change in tethering upstream interface for IPV4 of IPV6 address,
broadcast an intent with both tethered client interface as well as
upstream interface name, ip address type and update type.

Change-Id: I2f23e2b8ec125339bedd454446accb23e33cacae
Show devices connected to the WiFi hotspot(1/2)

Change-Id: I8378e0ae07332f62b92a1681951f1236f6ef5ff9
wifi: show devices behind a firewall that are connected to the  WiFi hotspot

* Clients that are behind a firewall, in particular Windows-PCs tend
to not respond to the request invoked by the isReached(val)-method.
Executing a ping instead and evaluating the outcome enables us to
bypass the firewall.

Change-Id: If857545c7a4d5fbc9d2dc919096a9c84e64d6877
Only start one WifiClientScanner

*) Fixes unexpected soft reboots.
E/AndroidRuntime(18586): *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiClientScanner
E/AndroidRuntime(18586): java.lang.IllegalStateException: Cannot execute task: the task is already running.
E/AndroidRuntime(18586):     at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:576)
E/AndroidRuntime(18586):     at android.os.AsyncTask.execute(AsyncTask.java:535)
E/AndroidRuntime(18586):     at com.android.server.connectivity.Tethering$WifiClientScanner.handleMessage(Tethering.java:596)
E/AndroidRuntime(18586):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18586):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(18586):     at android.os.HandlerThread.run(HandlerThread.java:61)

*) Remove unnecessary mDoScan class member variable.

Change-Id: I17ab368366b9a3456a625974c461783c428efec2
Tethering: Enable NAT only when tether and upstream ifaces are different.

When enabling WIFI hostspot, chooseUpStreamInterface will choose WIFI
interface as it is still up. It will result in both tethered and upsteam
interfaces are same one. netd will reject this command and tethering
will fail this time.

This fix will not send NAT command to netd when it found these two
interfaces are same one. Later when the real upstream interface is
brought up by ConnetivityService, Tethering.java will continue the NAT
procedure.

CRs-Fixed: 692285
Change-Id: I1ecd700ad64748c3745fffc76b7ac0e7d7b9b96b

Telephony: Avoid Infinite loop problem in Tethering

1. Whenever data is enabled we will try to establish the tethered
call (USB tethering enabled case) for 5 fixed number of retries.
After reaching maximum number of retries we are turning off the
upstream connection. whenever the CONNECTIVTY_ACTION received
(because of USB cable disconnected and then connected case or
some changes), it can try to bring up the dun/hipri PDP again.

2. There is no retry in case of data disabled case.

Change-Id: I16af4d2983a8bf9ce0ce904877f86169bca549b4
CRs-Fixed: 401829
(cherry picked from commit 4c923c8537fdc49ef491b964adc1871c77bfd730)
(cherry picked from commit 3135e6a89ac14008df04fe6e068bd8dd95b4ee40)
(cherry picked from commit 137b7004f716a559c7249be20e25544fe10330b6)

Broadcast tethered client inteface along with upstream interface name

On change in tethering upstream interface for IPV4 of IPV6 address,
broadcast an intent with both tethered client interface as well as
upstream interface name, ip address type and update type.

Change-Id: I2f23e2b8ec125339bedd454446accb23e33cacae

base: Add P2P interface "p2p0" to tethering support list

Dnsmasq is running as singleton pattern, P2P GO start DHCP server fail
if dnsmasq has been started by USB tethering. Tethering management
feature in Tethering.java just support soft AP and USB tethering. Add
P2P interface "p2p0" to tethering support list.

CRs-Fixed: 719930
Change-Id: If3a07e6cac1678dfedf361abf99f52bc12a2f697

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

Tether: fix the retry issue in Tethering

Since StartUsingNetworkFeature will always return success, it's
not a good place to set retry. With this modification, the retry
will work.

Change-Id: Ia2ea489ea57f99617004093bfedc8e7e6dba46ed
CRs-fixed: 667865
 MTU should be 1358 as per 3GPP standards, especially for LTE radio interfaces.

Change-Id: I5d3601b05a41d4c59cff3b39ddfb66d00cb23c45
Signed-off-by: Stacy Devino <swylie@oceusnetworks.com>