Common: Add the api to parse the string to current language

These APIs are used to parse the text to local languange.
For example, if the carrier name in English is got from network or SIM card, we will
use these APIs to parse it to local language and display it to the user.

Change-Id: Id4922c526d77f434b43c5ac013472b6a1cd5069c
DownloadManager: add to pause/resume download by user

We add pause and resume APIs here to make application can
pause and resume downloads by DownloadManager.

Code change contains:
  - add pause and resume download APIs.
  - add another paused status for this case.

Change-Id: I5bf4f15b2464009595f7926522ca6d5f1b0e2b8d
frameworks/base: move the traces file to avoid data loss.

If an ANR comes just after the framework reboot, the traces for
the framework reboot will get over-written with the ANR traces.
So, We are missing the traces for the framework reboot which
makes debugging the framework reboot difficult.

This patch will rename and will append a unique timestamp
this trace file name for the framework reboot once the
ActivityManager collects the traces. In case of multiple
Watchdog Kills the trace file generated will have diffrent
timestamp so that it does not get overwritten on multiple
Watchdog kills.

Change-Id: I90cb400d06aa909c1560328de4751aa02dbb6858
Audio: Fix title of system ringtone contains messy meta

Title in the Meta information of Bootest.ogg contains
junk characters which is displayed in Settings->Sound-
>Phone ringtones.

Correct the binary file to solve this issue.

Change-Id: I91c0519bb55ee5e74f783b0c147acbde641f6502
CRs-Fixed: 569976
frameworks/base: creating sperate files for ANRs traces

If an ANR comes just after the framework reboot, the traces for the
framework reboot will get over-written with the ANR traces. So, We
are missing the traces for the framework reboot which makes debugging
the framework reboot difficult.
Even for multiple ANRs in different apps, we will get the traces for
the last ANR.
Most of the time traces show that the call is stuck in some native call
and we do not have any info about the native call stack becuase we do
not collect the tombstones for teh ANR.
This patch will create one trace file for each application in case of ANR
and the filename would be traces_<app_name>.txt and the traces for
framework reboot will be stored in traces.txt
Change-Id: I5b78ce62b26f25d3dc14097e2988ba12c2d77826
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
TelephonyTests: Fix runtime errors for clean run

methods not accessible from test classes

Change-Id: Ic0c379be15b951e92a80fe575f4b5d4fa7874cca
IME: Fix Happened IllegalArgumentException 315 times during monkey test

The method startInputInnerLocked() sometimes throw IllegalArgument
Exception. There are 3 places invoked this method, but one of them
forgot to catch this exception.

Catch the IllegalArgumentException when invoke startInputInnerLocked().

CRs-Fixed: 563388

Change-Id: I315cb46b1d16c2862989cb9c0c10ed6613884522
audio: use fixed volume on proxy devices

- Use fixed volume on proxy devices(WFD audio)

Change-Id: I298f0284c5de235ca5ede179417c0f7b97e9ed38
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
Fixing IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within the loop may delete
the elements from History stack.

Change-Id: I0fdf098973fb167958959fc49a65a7130fad02d5
Disable generation of tombstone on an ANR The commit: I5b78ce62b26f25d3dc14097e2988ba12c2d77826 (creating seperate files for ANRs traces) provided the following two debug capabilities: (1) renames traces.txt and (2) generates tombstones(for native traces) The second functionalatity is not needed any more since the traces.txt now includes the native traces as well. Generating tombstones for system server causes framework reboot and that should be avoided. This change will prevent dumping of tombstones during ANR.

Change-Id: Ia6785261b8fe536d4aacc78e2f8be552e9335f0e
audio: add support for incall music

- Add AUDIO_STREAM_INCALL_MUSIC to support
  incall music

Change-Id: I84ac4658107d9f9abba2b496d0a1fd1430ced0d6
Alarm: Add one more RTC alarm type for poweroff alarm.

Now we use type of RTC_WAKEUP for the poweroff alarm.
Actually lots of other applications also use this type.
But these applications never expect the device will
power on after it has been shut down. So we need to
add dedicated alarm type for the Deskclock or similar
applications.

Change-Id: Ib515d8a737ab73cdd809597ad8cde57030c0a0a1
alarm: add JNI interface for clearing alarm

Add the JNI for clearing cancelled alarm, otherwise kernel driver
would know nothing about the alarm status. E.g. power-off alarm
would not be really cleared in alarm driver even it is cancelled
in the apps/framework.

Change-Id: I65579336240e992a7e6c7ec33325ce4627fd9bec
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.

Change-Id: I20a661f49f6566bdd1e23d6de18b509e2728ef19
Get proper network type when records loaded

Get preferred netwotk type based on phone ID when records loaded.

Change-Id: I3899a4287edbebf7228e8ed53e4b406ad2c9ef93