Set empty string to the property if value is null

Issue is if the received value is null, then while
preparing complete property value for MSIM the null
value is converting to "null" string. Fix the issue
by adding null check to the received value.

Change-Id: Ib7a8ea5ce5b1341df6155ec34c25a016eb4ec667
CRs-Fixed: 622695
Validity Period support for MO SMS in 3gpp

Add Telephony framework support for Validity Period in 3gpp
for MO SMS

CRs-Fixed: 627981

Conflicts:

	telephony/java/com/android/internal/telephony/ISms.aidl

Change-Id: Iee7358ca1971441f0567e428b587562294fe29bb
Add support for default data subscription setting.

Default data subscription setting holds the default preference for data
subscription. It will be updated when user changes data preference,
sub deactivated or card removal.

Current set preferred data subscription API does not update the default
data subscription preference. This change is to handle temporary DDS switch
by apps like MMS.

New APIs to update and retrieve the default data subscription are added.

Change-Id: I495266cff2a5319c57279d9decb77d6a87bbfae8
CRs-Fixed: 642210
SignalStrength: Hotfix TD-SCDMA take 2

The previous approach worked for 3G, but failed with TD-LTE. Let's
try something different to make them both work, and use the derpy
LTE checks only if a GSM signal is present.

Change-Id: I77e3b5a1e0f99df30c32b102918af418a20077c1
MountService: Handle UUID in list response

Change-Id: Ifee8905ae01c17c79b218ec131650c25f6e977d6
GLSurfaceView: add property to default to RGB565

Some legacy devices (like the Xoom) are not capable of handling
RGB888 surfaces, which is now the default. This results in some
OpenGL apps crashing with "No config chosen" errors.

Set ro.opengles.surface.rgb565=true to go back to the old default
of RGB565 surfaces.

Credit to dreamcwli for the original patch.

Change-Id: I5ad9aa8e98eb6fd554b01022439141fe4a55bd70
audio: Fixed dead lock in AudioService during volume change

- AudioService goes into dead lock when there is a volume
  change for source stream and the respective aliased stream
  simultaneously from multiple threads
- When setIndex is called for source stream, it also updates
  the index for the aliased streams. Meantime, setAllIndexes
  is called on aliased stream. Initially, it gets index of
  default device of source stream. It requires lock on the
  source stream. This is leading to a dead lock
- Fix is to avoid locking parent while updating child
  streams. Removing lock from method and synchronizing
  parent only when it is updating member variable.

Change-Id: Id38e539e2ec178ea25548312a1dd62d2de3043da
CRs-fixed: 635789
audio: Inform audio HAL if it is a voice call initiated by Telephony

setMode() API with IN_CALL mode can be called by any of the Apps.
In HAL, it is required to distinguish if it is a real voice call
or not. Inform to audio HAL if it is a voice call by checking
getPhonestate() updated by telephony.

CRs-Fixed: 662804
Change-Id: I20a661f49f6566bdd1e23d6de18b509e2728ef19
frameworks/base: Fix binder parcel leak with getMetadata() API

When VideoView calls getMetadata API of MediaPlayer, parcel object
is getting allocated by MediaPlayer and metadata is created over
parcel object. This metadata object is returned to the VideoView
which is being GC without calling recycle on parcel which was
creating leak in binder virtual memory.

CRs-fixed: 669303
Change-Id: I1e265909ee42d4fabd8b2552668b3d84af994294
MSIM: Add support for cell info

Add suport for getAllCellInfo in MSIM

Change-Id: I9d61723b4c73f595dafd18275532f80a9a6390ff
CRs-Fixed: 654445
server: clear forwarding rules when tethering is disabled

Since disabling NAT needs tethered iface's address info,
but sometimes the iface goes down before disabling NAT, this fix
just caches the iface's address.

Change-Id: Ie3f14093e8673c34821a3c86d1470c7dda3f3a42
CRs-fixed: 672354
Use a content observer for getting the default APN

Instead of executing a query of the database for the
default APN on every network state change, an observer
is used on the database to be notifited when the apn
has changed. This prevents unneccesary queries on the
the database.

CRs-fixed: 662137

Change-Id: I3155bd8b53a1877413ed54a861df1bfb1853b9e4
ConnectivtyService : Execute connectivityCheck in thread pool

Since this async task takes long when doing things like waiting for
network connectivity...etc, rather than holding up the single executor
of async task for the framework (app_process), run it on a thread from
the pool so other tasks can execute in parallel.

Change-Id: I7b88a4837c7e117ef47014a20c57f828b811edfb
server: start cne service

Connectivity Engine (CnE) provides advanced network selection per socket,
reduced signalling traffic, and increased power savings.
The service implements the interface defined by CNEManager which Android
applications may use.

Change-Id: I9ffd1f5d60f5e9e185ab482a35b3b07f29a4124c
(cherry picked from commit 3a4e3ba1bc67c460ec3c2fd4ef169ae25e3e69b1)
(cherry picked from commit 1bb0036652318ac8bbecf3e6c810bbc779387c61)
(cherry picked from commit 3c8af4a2546d9b71d113072d680107cb56651e71)
(cherry picked from commit 861a4b062196020bf24a5b3731c717b5b95a7d77)
(cherry picked from commit e3dba9799892f13c5bc2376b81cf5dceae17492c)

Add Connectivity Engine (CnE) WQE support

Enhanced connectivity features viz. Wifi Quality Estimation.
Supports dual network mode - wifi & mobile simultaneously.
Use QcConnectivityService when CnE is enabled for all CnE features.

Change-Id: I14b02e21515bfc1b5fd2fc4f28e5190fa80f83f8

server: Initialize ConnectivityService on low memory device

Skip initialization of QcConnectivityService and
use ConnectivityService.java for a low memory device

CRs-Fixed: 531430

Change-Id: I2111ec32f6e40ca79b7fc91ec4cef97ac27f3b3a

Update CNE feature values.

Start QcConnectivityServices for the new
application traffic profiling feature too.

Change-Id: I52ae76420ebd098d43fe0663f41ce622a407b90e

connectivity: allow inheritance to subclass

set modifier to protected in order to allow
subclass to use the same data and avoid redefinition.

Change-Id: I2dc688d3e433775cb073ec6faae3981807212cc9

Change visibility of methods

Change the visibility of some methods so that
they are accessible to the child class.

Change-Id: Ie1a45978b42742cac0aaedba29fb2375882c0ae4
CRs-Fixed: 611347

Conflicts:
	services/java/com/android/server/SystemServer.java
Fix for the invalid Global Proxy Setting

Adding validation for Global Proxy setting before it is
being set.

Proxy is validated at the boot time also to make sure
the value set is valid.

Signed-off-by: Raj Mamadgi <rmamadgi@sta.samsung.com>
bug:11598568

Conflicts:

	services/java/com/android/server/ConnectivityService.java

Change-Id: Idff5ae81119d8143da096b5291ecbfbc5875cbd4
server: Handle broadcast intent and receiver

Ensure the receivers of broadcast intent is not launched before boot
completion by adding an intent flag, since connectivity events can
happen before boot has completed.

Change-Id: Id6fc9e34c89d947d768def38e5c5bb0df54a3a7b
Add an option to change the device hostname (1/2).

This adds an option to modify the device hostname used
in ip resolution. This is useful when connecting to the
android device in a dynamic dhcp environment.

Change-Id: I44e4771f4415a32fe66867d4dd90f1ad138341e1
Update LinkProperties with MTU value

Use the MTU provided by network as part of Data Call Response.
If it is not present, use the static value from config file

Change-Id: I9d03cc9b355d09a93883fbf4ddc93fae0077641c
CRs-Fixed: 634747
Connectivity: Set TCP delayed ACK and User Configuration Flag

Provide a Mechanism to set tcp delayed ack settings from
Connectivity Service. The tcp_use_userconfig flag is set to
override the default tcp delayed ack configuration in tcp stack.
tcp_use_userconfig flag is reset when the TCP stack is required
to use default delayed ack settings. Currently the delayed ack
settings are overridden for Wifi and LTE networks only. Other
network types continue to use default delayed ack settings

CRs-Fixed: 628139

Conflicts:

	services/java/com/android/server/ConnectivityService.java

Change-Id: I282ef0f6b6278b6efcef3870242974f7ee93e508
services: change default sampling interval to -1

Change default sampling interval to -1 to avoid sampling to resolve
power consumption issue. Original implement will keep UE wake up every
12 minutes, which will cause issue when doing power standby test.

Change-Id: I018e22a44259e94bce87ceaf04ff523f035183f8