ProcessCpuTracker: Fix ArrayIndexOutofBoundsException in tempSpeeds

If time_in_state file is not available mCpuSpeeds is created with size 0
and subsequent call if the file becomes available there is an
ArrayIndexOutofBoundsException.
This change avoids the crash by breaking out of the loop, also adds error
logging

CRs-Fixed: 553569
Change-Id: Id5e219ca1cd3f058f714aecd5902ec2f6c11ae03
Appears black screen fix for a while

This issue is side-effect of added google patch on KK MR1.

Fix a couple of issues with mOpeningApps.
https://android.googlesource.com/platform/frameworks/base/+/a8ee262c04749db4f32f73d2b9e7f58989c4638b%5E%21/#F0

[Reproduce path]
Settings -> Location -> Location OFF -> Location ON -> "Location consent Dialog" Popup-> "Agree btn" press
-> Black screen appears for a while

Change-Id: I14efdce87e8d78d38f9aae48568f69937e4fe1fa
Perform NTP lookup at Mobile data connections

If NITZ isn't supported by the current carrier the Android framework
relies instead on a remote NTP server to set the system clock. The
NetworkTimeUpdateService class polls for NTP time during the first 4
minutes after boot, failing to get NTP time within these minutes will
increase the polling interval to 24 hours. Hence, if a data connection
isn't activated directly after boot it can take a long time for the
system clock to be updated. To prevent this situation, NTP lookup is
scheduled as soon as a Mobile data connection has been established.

Change-Id: I046e0330147e7ace4b720a7e70f9d5047d42cfe6
Webkit: add to support file uploading

This change adds one function in WebChromeClient for supporting
uploading file in browser. In Android 4.4, browser is based on
chromium not webkit engine, chromium engine support uploading file
and will callback to client to show file chooser, but android_webview
client has empty implementation within this callback for file chooser.

So we solve this issue by adding implementation in framework chromium
client which extends android_webview client, function in framework
webkit client and corresponding functions in browser app.

Change-Id: I6baef44eef28eb2b380ab6181200bf0b9cc0316c
FLAG_PRIVILEGED disappears if privileged app is updated and rebooted

Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.
Cherry-picked from AOSP: https://android-review.googlesource.com/#/c/79511/

Change-Id: Ic24b5882f65dabdfae9cc39da3d68661bed4fc31
Remove dead code.

This hasn't been used since at least 2011, and we're no longer
shipping the data supporting it either.

Change-Id: Ibe42057650b49794c65d6f0d54ed7a492f3b594b
Fix incorrect name in eglSwapBuffers log wrapper

Change-Id: Ica8bae5540e51ce96ab35523049d61a9c621a2da
ProcessList: use different polling interval when screen off

We are using the same time interval for both screen off and screen on.
For process on top: ActivityManager.PROCESS_STATE_TOP, we will poll PSS
information every 120 sec.
During polling PSS, we are grep /proc/%d/smaps which is a 10k lines file.
This cost quite a lot of CPU resource. But when screen off, we don't need to update
TOP process PSS so frequently since we are not operating it. Lower polling
circle to every 15min to reduce power.

Change-Id: Ia4cd26290d44d066f034d5270ce5523650a3c493
Keyguard: don't refresh ui when screen off

KeyguardStatusView is doing refresh all the time,
which cause high power when screen off.

Change-Id: Ifabdde4419a23e919cd52fe77e78ec3160575af1