[GNSS] SUPL early data connection fix

if GPS started before data connection is alive, SUPL will be broken for entire power cycle.
This is fixed disabling SUPL Network Feature when network is not available.

Change-Id: Ib390689c8977d4476cd4f12736e053e52d916f5d
Orig-Change-Id: If505521a4f850309fd2f9315ce44bd21663fcaae
Signed-off-by: Fabien Peix <fabien.peix@intel.com>
Signed-off-by: jerome Pantaloni <jeromex.pantaloni@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 30370
frameworks: extrat class JNICameraContext for extension

Currently, Class JNICameraContext is defined in android_hardware_Camera.cpp.
Other components can't use the class directly.

Extract the class JNICameraContext to a seperate file android_hardware_Camera.h

Change-Id: Ib6c7e0e0b334c4ce953f98f4ea9154190332422a
Signed-off-by: Hu Gang <gang.a.hu@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 52300
[HTML5] Implementation of WebSockets (framework).

Added binding to android port for Html5 WebSockets.
Added external API for enabling\disabling from browser.
SSL Web Sockets are not implemented in the current version.

Change-Id: I8b7a42780410cb9f043e1f16570ea50db68e00ea

Conflicts:
	core/java/android/webkit/WebSettings.java
Forward compatibility fix

Change-Id: Ib031372d43881a9bb7af1e51fb2c7cf55e03a326
[GNSS] Extend framework to accomodate GLONASS reporting

-Changes in GpsStatus to report Glonass flags correctly to Android framework
-Fixes bug where Glonass SVs are reported to Android, but are never shown as being used
-Fixes bug where SV79 was falsely identified as being used in fix

Change-Id: I7d8917a0d2d819cae0aed4dcbcd1c2f138ac6eb2
Orig-Change-Id: Ibc59b805805e1477ebbbe5de18cc0d77b8a81916
Signed-off-by: jerome Pantaloni <jeromex.pantaloni@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 64022
Prevent nullPointerException by updateBondedBluetoothDevices

In some very rare cases difficult to identify, it seems that the
IBluetooth.getBondedDevices() returns a Set with a null element.

This patch will prevent calling getBondState() if the device is null to
avoid a nullPointerException.

Change-Id: I9bcad60c37e03c77ec39227e5c947c002a3ae2c7
Orig-Change-Id: I8845f0e6b8fdcda679bc71e2b5c33fd4a52f3ac5
Signed-off-by: Patrick Combes <patrick.combes@intel.com>
Reviewed-on: http://android.intel.com:8080/116592
Reviewed-by: Bondier, CedricX <cedricx.bondier@intel.com>
Reviewed-by: Chen, HuaqiangX <huaqiangx.chen@intel.com>
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Aquilone, RaffaeleX <raffaelex.aquilone@intel.com>
Tested-by: Lestienne, ChristopheX <christophex.lestienne@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 90085
update SystemUI's proguard.flags

Change-Id: I5aa73eddd3fea6cddeddaf94e202d8de870e7df5
Missing break in switch statement

Change-Id: I1b7e7a94df8d39e162050911e31e510d2ce5447e
Removed useless test

Change-Id: I6269e4ca4ced5c9d2ef68522d26e94e419980c0a
Javacrash java.lang.NullPointerException in com.android.browser.

Provide a WebView interface in WebSettings, for BrowserSettings need to access it.

Change-Id: I8a4b9c9a746c9c0b2a1a6adec35943de9fb2f9b0
Author: Yijun Zhu <yijunx.zhu@intel.com>
Signed-off-by: Yijun Zhu <yijunx.zhu@intel.com>
Signed-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: 34962
AbsListView: Fix to consider adapter's areAllItemsEnabled

ListAdapter offers areAllItemsEnabled to indicate if all items
are selectable and if so, there isn't any need to check the
specific item's selectability. Fix AbsListView to give first
preference to areAllItemsEnabled.

Change-Id: I5d0b48765a5594099c8b2b6ba29f8476e636b246
Report right battery status on lock screen.

Currently, the UI shows 'charging' in lock screen though the charging
has been stopped due to some reason. But it should actually check
the battery status also to find out if the device is actually 'charging'.
This patch is to show 'plugged in, not charging' if the device is not
charging while plugged in.

Orig-Change-Id: I77f560f9ae5b53f0e88a47beaa4b07ffbad21411

Change-Id: I3a392c5dfc0fa6f6d6eda7f26926c12e0978e3d8
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 55683
ShutdownThread: Turn screen on during shutdown

Screen should wake up from low power mode during shutdown,
to notify the user that the phone is shutting down.
This will result in better user experience.

Orig-Change-Id: I06b2c5c7a56795a65c6f49470d9b68b03b65c669

Change-Id: I265cfbb939e1109fbba609b133bcc3f418ef0bcd
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 103672
Document that OnSharedPreferenceChangeListener is weakly referenced

A SharedPreferences object stores the listeners inside a WeakHashMap.
This is untypical for a listener pattern. Users may use an anonymous
inner class to create the listener which gets gc-ed after a short period
of time.

This patch describes this behaviour in the official documentation. Fixes
AOSP issue #6052.

Change-Id: If9c0235205fbff990d67a0cd6729677f16a75313
BatteryStatsImpl: Avoid memory corruption due to Parcel Recycling

While processing batterystatsfile, in present code there is a race where a parcel
might be recycled while it is being written to disk in another thread.

The write process is done in 2 steps:
- write into a Parcel (memory block)
- then write this Parcel to disk using Journaled API.
The Journaled API ensures robustness against file-system issues due to power cut.
The writing is done in batch using a thread running commitPendingDataToDisk().
This function writes the parcel to disk but this parcel is a global variable
initialized by writeLocked(). If the writing takes too long time and two write
threads are launched, the parcel is freed by the second writeLocked() call;
which could cause the memory corruption.

Hence, change global Parcel variable by a Parcel parameter to commitPendingDataToDisk()
and only this function will be allowed to recycle the parcel.

Orig-Change-Id: I0e76441399f1ce74b83566edb8cf4f977dce58bf

Change-Id: I1884141d7d9c61601e2c8e07523a6e9aa6709afc
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 47466
EM/PowerUI: Screen will be turned on at low battery status

When Screen is off, then low battery popup is not visible to user.
With this patch we make the screen turn on just before popup and
it will remain in this state for 3 sec.
Also, if in silent-mode, then vibra will be turned on for 0.5 sec.

Orig-Change-Id: If665f47f27d933f59ce5f5895dac91091e7f2fdf

Change-Id: I618c8544229adb71870010f26407022450137a98
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 52107
Do not set the content description on the icon tab when not necessary

It is not necessary to set the content description of a tab's icon
when the icon is not actually visible. Based on the implementation,
the tab's icon is only visible when not null and its visibility is
set to true.

Change-Id: I4430dfc7d1faa0ae00fdc789745e7cae7b453a89
fix some CTS problems

Some CTS test cases which are to test a long-click availability on a
view fail if "long_press_timeout" would be changed. For instance, if
we would change "Touch & hold delay" setting to "medium" or "long",
the following test cases fail.
  - GestureDetectorTest#testOnTouchEvent
  - View_UsingViewsTest#testSetupListeners
  - AbsListViewTest#testGetContextMenuInfo
These test cases call TouchUtils.longClickView(). ThelongClickView()
uses ViewConfiguration.getLongPressTimeout() to get
"long_press_timeout". However the method will always return a
default value '500' if it would be called from non-main thread.
CTS test case runs on non-main thread. So longClickView() should
read the value from SettingProvider.

Change-Id: I19465678a1f6a10b93262263975d612b386856f9