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
Revert "wifi: Get full scan results"

This reverts commit b301684e954b6a1659bf7395b1732b658f2fc27e
CRs-fixed: 509553

Change-Id: Idafcf1ae25c2b9af42f71ee417cf73601c3199a7
P2P: Set wifi preferred channels when the supplicant is started.

Set wifi preferred channels when the supplicant is started, if
there are any safe channels from the previous LTE event received
from RIL. This is to ensure that p2p GO is always started on one
safe channels.

Change-Id: Ib0c36dbc4dfdec3721adb2f72d604158eeff9a87
CRs-Fixed: 523207
wifi: Fix for connection between GO and p2p device

When GO sends an invitation request to the p2p device without
persistent profile, GO gets an invitation result=8 which means
unknown group, when GO receives invitation result 8, its tries
to remove persistent profile of the client but it will not be able
find the profile so it does continue with sending the invitation
so the connection fails. To address this, ignore if there are no
persistent profiles found for the client and continue with sending
the Invitation request to the client to make connection succesful
connection. As GO has single profile saved unlike client which
saves multiple profiles of GO.

CRs-Fixed: 511282
Change-Id: I78f54d4bb2f0d603bc2170ec2c3ef55a91050236
Show PIN on Peer device on receiving PIN display request.

P2P provision discovery would request the peer to display a PIN.
The PIN is displayed handling the request, the PIN need to be
entered on keypad of requested peer device to achieve the
connection.

Change-Id: I8b6487681d78eb10c558983a08dec1ac8a8eee65
CRs-fixed: 382608
P2P: Fix for GO inviting a p2p device.

A p2p device on an invitation request from the peer invokes
p2p_peer command to know if the peer is a p2p device / GO.
Due to the cached entries there would be a possibility of
not getting the updated information, ending up in the wrong
negotiation with the invited peer. Thus do not rely on
p2p_peer command, rather assume that the peer is a GO on an
invitation request, provided there is no persistent network
configured.

Change-Id: Ic70c4147d8b34bcddf4bf70811a5aeb4ea0650bc
CRs-Fixed: 486437

Conflicts:

	wifi/java/android/net/wifi/p2p/WifiP2pService.java
P2P: Do not restart SAP/P2P Go if its operating in 5G.

In case of LTE Coex since RIL always passes 2.4G channels,
if the SAP or P2P Go are operating on 5G channels when LTE
is camped, no need to restart SAP or P2P GO.

Change-Id: I5b0b5452a94bcbc0beeb44b25c34daf9e17ee482
CRs-Fixed: 531439
p2p: Fix for discovery failure until AP is connected in WFD client.

When station is connecting to AP i.e wifi state is either
connecting or obtaing ip address, Wi-Fi state machine will
send BLOCK_DISCOVERY event to P2P service manager and discovery
is postponed until DHCP success/failure. During this if we
receive DISCOVER_PEERS command then p2p service manager will
return discovery failure because "mDiscoveryPostponed"
variable is not getting updated properly due to improper
condition checking.

To mitigate this issue modified the conditions to update
the variable "mDiscoveryPostponed".

CRs-Fixed: 532138
Change-Id: Ie92a42b17d264cfca5ec2af2dfb4db542deddaac
frameworks/base/: Fix black wallpaper issue when home pressed.

In the specified usecase, there is a completely new set of
windows that appear on the screen during rotation. And the
existing code in the framework ignores the drawstate of the
hidden windows.

Wait till the drawState is ready for the hidden windows also.

CRs-Fixed: 521758

Change-Id: Ibd96502059c84210ad84ecb03aac5eca28f3c9fe
Camera: Video HDR Feature Integration.

Added framework support for camera applications to query supported
video HDR modes and set the required mode.

Change-Id: Ie318e586838a2f035e59e30fa51af35b52f7c886
Camera: Adds support for meta data callbacks

- This change adds a new type of callback
  that will be called when there are pending
  meta data notifications.

Change-Id: I84f5cbafe4f023c7b0efa9ec8620756b0eaa428d
Frameworks: Enhance face detection

Add support for facial processing features:
smile detection, gaze detection and blink detection

Change-Id: Ic186ff0658e755a8b5287cffa1dd58d9eafebc9a
Frameworks: QCFace framework added

Add framework support for extended face detect

Change-Id: I2a1c477ee6d11f2b9764966abbb85ede9100fe91
Camera: Adds support for longshot configuration

- The Camera API is extended with one additional
  call for longshot mode configuration.

Change-Id: If3bcad003facae22ec2bd690480dc3db63f0b28a
Fix compilation for non QCOM hardware after 'Enhance face detection' commit

Change-Id: I337a7a2e8b124aac76f52abcc0edd8af9b0b0e29
MediaRecorder: add pause interface

--add pause in java level
--add pause in jni level

Change-Id: I7f2d5d5ebb97716458b55a5780fd6cc3d09e9f11
Telephony: Add new apn.sim.operator_numeric property

Use new property to filter apns. We need this new property
because icc.operator_numeric property is also used in cdma
and ApnSetting UI might display wrong set of apns if the
peroperty value used was set by RuimRecords
CRs-Fixed: 362846

Change-Id: I3831a703a2fdc69df8552af57e0bb981d0c7e46f
Telephony: Add functionality to handle ICC IO error

At present in Android all ICC Card states other than
ICC PRESENT are treated as ICC ABSENT.Adding functionality
to handle ICC IO error card state.
CRs-Fixed: 184479

Change-Id: Id6a8cf8c7bb2ed441bf8db15b84c4e426537fdb1
Telephony: Managed Roaming feature re-design.

Change-Id: I79c7ea2e647617e58526b5b550406214455a58aa
Telephony: Few PIN/PUK fixes

Following changes have been made as part of this:
-> Changes done to display retry counter on wrong entry of
   PIN1,and message to indicate Code accepted/PIN1 blocked
   during PIN1 verification as per certain carrier requirements.
->The current APIs that are used to verify the PIN and PUK only convey
  whether the operation succeeded or failed. As a result on ANY failure
  clients ask the user to re-enter the PIN.
  Add 2 new APIs that report the actual error code in case of failure.
->Display the complete text including attempts remaining to
 unlock PIN on SimUnlockScreen if user entered incorrect PIN.
 On some devices the display text is ellipsized when trying to
 display on a single line.
CRs-Fixed: 184479, 260481, 181402, 181380, 181401, 326286, 441001,
479414, 479417

Change-Id: I73718c9e6a8aa7244097e0dd4593a6226ff0ac08