Fix code problem in writePidDns

When app call startUsingNetworkFeature() to keep alive, there is a
code problem in writePidDns() to update the net.dnsX.<pid> property.

Change-Id: I83b02da4808f106c9ca00e350ad38e4bd5cba689
Properly handle quick switch between Home button and Gallery app

This change fixes the following bug:

1. Playing a movie (especially Full HD) by Gallery.
2. Press the Home button.
3. Press the Gallery shortcut on Launcher.
4. Very quickly repeat #2 and #3 several times.

Result: "Sorry, this video cannot be played" alert is shown.

Change-Id: Idf9d222ca1e0bb90bfe06f6dc807dfbc71b6415b
Signed-off-by: Yuriy Zabroda <yuriy.zabroda@ti.com>
Switch widget: Fix ON/OFF option update error

When calling setChecked() from a listener which is invoked by
the Switch toggle, setChecked() will be called recursively,
causing the value of mThumbPosition overridden by the outer
setChecked(). This make the nested setChecked() unable to update
the "Thumb" position correctly.

Set mThumbPosition to sync up with the exact checked state of
the Switch to avoid update error.

Issue 34748

Change-Id: Id4aa389114dcc590430b11626c80d29c9c6016a0
Signed-off-by: Yu Haonong <yuhaonong@gmail.com>
SystemUI: Fix data activity overlay not being removed when data is disabled

If mobile data connection is disabled while there is active data
activity, the data activity overlay will not be removed and will
be stuck there. This patch fixes that.

Change-Id: I4cc1a14bb2e2d85687752657608e5989adfe9af1
WifiWatchdog: handle exception from ArpPeer

Sometimes IllegalArgumantException can happen in constructor of ArpPeer
class when IPv6 address is provided. This causes crash of systemserver.

Fixing it by adding appropriate exception handler

Change-Id: I4bb7bbca790745a1bf56ece96dd91b84b1f70cad
Signed-off-by: Andrii Beregovenko <a.beregovenko@ti.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Change StringTokenizer to TextUtils.StringSplitter

Replacing StringTokenizer to TextUtils.StringSplitter,
since TextUtils.StringSplitter is more suitable for basic splitting tasks.
Also increased initial values for HashMap and StringBuilders to avoid
unnecessary buffer enlargement operations. This improves the performance
of these operations.

Change-Id: If9a5b68e6596ba9a6d29597876b6164ef34b57ac
Added check of ActivityInfo launch mode when starting activity.

When starting a singleTop activity from a singleInstance activity,
the onNewIntent() callback was not called when expected. The
reason for this was that only the launchMode specified on the
intent was checked and not the launchMode specified in the manifest.

Fixes issue 17137.

Change-Id: I1a9bc1007d6f5145bf93a6161534732bf5214b7a
ProviderMap: remove hashmap when entire user specific entries are removed

User specific entries in  mProvidersByNamePerUser and mProvidersByClassPerUser
isn't cleared when entire user specific providers are removed. Fix is to remove
the user specific hashmap in such cases.

Change-Id: I6edf211ced873e59f3b89ffceb9eceec13ea8f3f
Tests/RS: Add RS context check for RsBalls setAccel()

mRS could be null when lock and unlock screen by pressing power key
several times, it causes RsBalls crash. Add null pointer check to fix.

Change-Id: If37dee8609420daaff17772d5194cad5531f98e6
Author: Yong Chen <yong.a.chen@intel.com>
Signed-off-by: Yong Chen <yong.a.chen@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 31271
To avoid the JNI memory leaks in video editor codes

There is a protential memory leak in video editor JNI codes.
When importing so many video clips, the number of local reference
will exceed 512, which will cause the Dalvik virtual machine
crash. The patch will free each local reference when it's no
longer used to avoid memory leaks.

Change-Id: Iecd986c83f05a1103641746d6d43eef0a9c5ee40
Author: Wei Feng <wei.feng@intel.com>
Signed-off-by: Wei Feng <wei.feng@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 40786
[Audio]Press camera button during Http live Audio playing, then return Browser, DUT display abnormal.

When long press camera key, dispatchKeyEvent function will add control surface after the control view hide,
actually, we needn't show control view after we press camera key.

Change-Id: I45175c4eb97b3f13469cd9d8bacb295c9c5803dd
Author: Bin Xu <bxu10X@intel.com>
Signed-off-by: Bin Xu <bxu10X@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 28344
Fix for updating TCP buffer size when switching network type

When PDP connects in GSM network, the TCP buffer window size is
set to max 8760. If the phone swicthes to UMTS, the TCP buffer
size is not updated to UMTS, i.e. GPRS buffer size is still
used with limited data transfer spead as a result.
This fix makes sure the TCP buffer size is updated when
switching network type.

Change-Id: Iaa527c84f56cae108f4c7276bbed10552faaff6c
Merge "Fix for updating TCP buffer size when switching network type"
Release JNI local references as soon as possible.

The JNI layer has a fix amount (512) of jni references.
They should be released as soon as possible. In for
and while loops they can quickly reach the limit.

Change-Id: Id984345e1cc4f7aa6eb31a263b796c3da9edf773
DO NOT MERGE - Fix readback lengths

Change-Id: I4c5f29af03ed3babceef741aa3a982244cfc65d1
ActivityThread: Avoid creating duplicate handlers and reuse mH

sMainThreadHandler is used for notification of changes in
SharedPreferences and refers to a new instance of Handler instead
of the existing instance, mH, of the ActivityThread. Fix to reuse
existing handlers associated with main looper.

Change-Id: I794a5802a9eacdb188bd0619db5e70e3ae89a07d
VibratorService: Fix to ensure actual delay in a vibrate pattern

delay might timeout early as value of duration isn't updated
correctly in the loop, should the wait be interrupted, to reflect
the elapsed time. Fix is to update duration in the loop.

Change-Id: I525b0e97799b288f46ae3a056cff7dcc69701bb0
restorecon /data/anr directory.

Restore the security contexts of anr directory
when initially created.

Change-Id: Ia731414ccbcdc7369d24be6db0003c53abcf6ef4
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
Merge "ProviderMap: remove hashmap when entire user specific entries are removed"
Merge "Release JNI local references as soon as possible."