StatusBar: Add icons for Chinese carriers

1. Add icons for CMCC DSDS staus bar.
2. Add 4G signal strength icons.
3. Add 4G data arrows icons.
4. Change 1x to 2G signal strength icons.

Change-Id: I2409a8f5cd2b598cccf4a2f385b6a681b0b8e2a2
WindowManager: Toast message is not visible in some scenarios

Issue: Toast does not get displayed if it is displayed from an
Activity which runs in a process different from the process of the
package to which the activity belongs.

Fix: While adding a window a check is done to ensure that the uid
of the activity matches the uid of the package to which the activity
belongs. This change will bypass the above check for Toast message.

CRs-Fixed: 720701

Change-Id: I29c5d30a8f11c2d132066c77bd038abc444cedb4
usb: Show notification in 'charging only' mode.

Show correct notification in 'charging only' mode.

Change-Id: I93a04efe52e8280da95438ceb02b4054610a4d6e
USB: Don't add adb function when usb disconnected

When USB is disconnected, "adb" functions will be added even in
"charging" mode. This breaks "charging" mode's design.

Change-Id: I7ab62194a0acb97620e33da4839e0f6c87f60917
Telephony: Do not display the data icon if data is not connected

When updating the status bar for the bluetooth reverse tether
connected status, even if the mobile data state is in
disconnected state, and it shows the data icon based on the
data network type.
Changes made to check the mobile data connected condition while
updating the data icon.

CRs-Fixed: 356684
cherry picked from commit Iabd6269cc23c1e0ebd5fc140fc14c9ec67883148

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java

Change-Id: Id52bd04340ebafb6206162a5808e0f7d3e8e0d75
Telephony: Do not send Radio Power Off on SIM_RESET

Changes made to not to send radio power off during refresh app
reset.

CRs-Fixed: 441924

Conflicts:
	core/res/res/values/symbols.xml

Change-Id: I83b7063a86ce9b380c7aeb0c140a4967d205d93b
AppOps: add Chinese support for AppOps popup dialog

Add Chinese support for AppOps popup dialog.

Conflicts:
        core/res/res/values-zh-rCN/strings.xml

Change-Id: I2ac3664640d1adba2e1b14016856f36d50eb2ed3
PhoneWindowManager: Changes for WFD.

- WFD now sends WIFI_DISPLAY_VIDEO intent to set UI orientation.
- PhoneWindowManager to listen for WFD intents.
- Display on WFD should be same as seen on the HDMI, so set the
  orientation to HDMI orientation

Conflicts:
core/java/android/content/Intent.java
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I446ab768200f9b9f59759e52071bcaca7d6f836c
framework: update WFD session orientation based on UIBC rotation

User Input Back Channel (UIBC) support in Wifi Display stack
allows the sink to send control/commands/preferences to the source
e.g. touch, keyboard/mouse entry, or orientation/rotation.

PhoneWindowManager needs to listen for UIBC rotation
intents and update the preferred rotation when WFD is active.

Note: HDMI rotation lock overrides WiFi Display UIBC rotation.

Change-Id: I1869b21c3c03b5b36c5381933b50dfbfeca88db6
Conflicts:
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Prevent SD-card from Un-mounting if cancelled during erase

If User cancels during the formatting stage
of "Erase SD Card", make sure you do not
Un-Mount the Volume

CRs-Fixed: 616156

Conflicts:
        core/java/com/android/internal/os/storage/ExternalStorageFormatter.java

Change-Id: I8d7e1cf64917ee3628a1a682e2f3fb32443f3a2e
Keyguard: Add config to always enable emergency call button

As the original design, emergency call button will be hidden on slide
lock screen. Add config_showEmergencyButton to control emergency call
button on slide lock screen.

CRs-Fixed: 640998
Change-Id: Ica29e1ec9043272e9d507307fb8744e8eef57b2e
SystemUI: Enhancement for 4G icons

Add 4G LTE icons with sim IDs.

Change-Id: I1608b18cf6cc1652138162cc51f9c088841892d2
frameworks/base: add app launch timeline instrumentation

Displayed Activity is often being used to measure application
launch times. However Displayed Activity only accounts for a
subset of the app launch. This additional instrumentation will
allow for more accurate measurements of applications launch
times.

ActivityManager: Update timeline debug statements
Update the timeline debug messages so that
'ActivityManager' is not used as the tag in log
messages as it interferes with some CTS tests.
CRs-fixed: 628703

This commit combines the changes from KK gerrit 668250 & 543988

Change-Id: I0af42520dc30d89a910e60aebdddf0c4fdd32b3e
AppOps: Check user permission before audio recording.

Add permission check before audio recording.

Change-Id: I55c8397df3169e031bba951cf180fa8c5f4c4ce0
Conflicts:
media/java/android/media/AudioRecord.java
Telephony: Add 7bit Ascii support for long messages

Add config item for 7bit Ascii encoding and decoding
support for long messages

Change-Id: I54080a5c63fd2dc470f38edeffbe58729c22adf9
core: jni: fix memory leak in SoundTrigger JNI

jExtras object created in android_hardware_SoundTrigger
JNISoundTriggerCallback::onRecognitionEvent()
is not deleted causing a memory which depletes JNI
JNI local storage during back-to-back SoundTrigger
detections.
Delete jExtra after storing in return object.

Change-Id: Ib7048917b7538a27d4519504b30252879acc5447
CRs-fixed: 733969
Statusbar: Show wifi status when wifi enabled

Now, Wifi status is only shown on StatusBar when connected to AP.
To satisfy the security requirement, we need show wifi status when
AppOps enabled.

Change-Id: Iae803025e17fd7fb90931f39e8f9841b659ed8ee
base: App crash when select suggestion's length more than specified.

App crashed by catch IndexOutOfBoundsException which raised
by check span range when select suggested string.The root
cause is that the editor will truncate the suggested string
which length is more than it specified, but it also set span
use the suggestion's original length.

Update the suggestion's real length after editor replace the
original string to suggested.

Change-Id: I2d765701934a9e68be172cb87a104590f3cdeceb
CRs-Fixed: 532211
Media process is crashing with NullPointer exception

Sometime, while creating thumnails list of media files in
compose MMS->attach file,  filepath may be null due to
synchronization issue.
Adding NULL check to avoid NUllPointer exception.

Change-Id: Id6cf5612a959b3ae15b44bc60dbbcbe40c624f09
CRs-Fixed: 636494
Add looper to the thread to fix system_server crash

Toast message internally creates handler and we can't create
handler inside thread that has not called Looper.prepare().
Thus, we added looper to the thread to avoid system_server
carsh.

Change-Id: I09b9c4923c109f0b2707f8346e091efbd24b5089
CRs-Fixed: 669467