Make the LED colors when charging customizable by the vendor

This commit will make the default LED colors in the NotificationManager
for battery charge customizable via overlays. The blink on/off
times are customizable in the same manner.

Change-Id: I57ce93656cc4080f5b99554df0ada44c5b31e959
Fix compile errors in telephony tests

Simple fix of package names for two test cases, currently
they do not compile in an IDE.

Change-Id: Ia7cd4df70ff37875a02563cfddbe8dd4a16a5b01

Conflicts:
	telephony/tests/telephonytests/src/android/telephony/PhoneNumberUtilsTest.java
bootanimation: Don't open non-existing bootanimation.zip

While booting from AOSP image, logcat always complains as following:
W/zipro   ( 1001): Unable to open zip '/data/local/bootanimation.zip':
No such file or directory
W/zipro   ( 1001): Unable to open zip '/system/media/bootanimation.zip':
No such file or directory

This patch avoids opening non-existing files.

Change-Id: I54cc03f125a5e16dbc930515bd2e43c623b63f8f
frameworks/base: Swap width and height of temporary buffer only with
orientation change

Current code swaps the width and height by assuming that aspect
ratio of the buffer width and height will be same as that of the
layout clip width and height. That is not always true.
Change the check to orientation change.

Change-Id: Ie387f3a7369025427484e4173cbde7a08df2b9d7
In CW Interrogation service class is not sent.

As per 3GPP TS 24.083, section 1.6 UE doesn't need to send service class
parameter in call waiting interrogation  to network. Some networks return error
if service class is sent. So setting service class to SERVICE_CLASS_NONE.

Change-Id: I396963d568573b88795ad2cf1844eb2e047b459e
BluetoothHeadset.java:
Added ACTION_VENDOR_SPECIFIC_HEADSET_EVENT,
EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD,  EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS.

BluetoothAssignedNumbers.java (new file):
A home for BT assigned numbers, beginning with the company IDs.

HeadsetBase.java:
Reformatted some code.

AtCommandHandler.java:
Fixed comment typos.

Change-Id: I34d6f248166305d72be66632779fc963b894379c

Added EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID.
Fixed a minor comment typo.

Change-Id: I8550692c13510a853c894b2d108bef4520d931c2

Conflicts:
	core/java/android/bluetooth/HeadsetBase.java
Adds the ability to Android to initiate a 2 Digit Call.

Over here the phone number to the switch-board is "99". Trying
to call "99" on an Android device dont work as expected (it
works on other devices though).

Exception (1) to Call initiation is:
  If the user of the device is already in a call and enters a
  Short String without any #-key at the end and the length of
  the Short String is equal or less than 2 the phone shall
  initiate a USSD/SS commands.

Exception (2) to Call initiation is:
  If the user of the device enters one digit followed by the
  #-key. This rule defines this String as the "#-String" which
  is a USSD/SS command. The phone shall initiate a USSD/SS
  commands.

Change-Id: I950ac10b347b8e9d113d208b08c3e2c7cdb50221
Support changing style parent in overlays

Package overlays makes it possible for vendors to tweak the look of
the platform and the applications without touching any platform or
application code directly. This makes package overlays an important
mechanism in the Android build system.

There is currently a limitation that forbids changing the parent of a
style. If vendors could change the parent of e.g. ‘CalendarTheme’
from Android’s vanilla ‘Theme’ to ‘VendorTheme’, then vendor
specific adjustments could be done without changing any code directly.

From looking at the code it can be seen that the parent value of a
style is stored temporarily in ResourceTable::Entry::mParent while
overlays are gone through in buildResources(), and processed (in
ResourceTable::Entry::assignResourceIds()) at first after all overlays
have been handled, so there aren’t any obvious reasons why changing
parent in an overlay should be forbidden.

Change-Id: I5969bb8aab90df437e1967fc504cc0da79107d13
Crash when powering off.

Fixing a race condition. If "confirm" is true and the shutdown
dialog is shown it may take some time before the user presses the
ok button. During this time a new call to shutdown may be made with
confirm=false. When this happens the shutdown thread is started by
the second call, and later when the users presses the ok button. This
results in ShutdownThread.beginShutdownSequence() being called
twice. I.e., the beginShutdownSequence lacks the proper protection
for this error case.

Change-Id: Ib9b01c5a43f4dc23de09057f3fc1507000317faf

Conflicts:
	core/java/com/android/internal/app/ShutdownThread.java
Fix compilation errors in libmedia, libstagefright.
(invalid conversion from 'const char*' to 'char*')

Change-Id: Idef85606b7cff629b2778ed8134c79c892af54c2

Conflicts:
	media/libstagefright/HTTPDataSource.cpp
Add an API to request route to an IPv6 host.

Add API to create a route to an IPv6 host through a particular
interface.

Change-Id: I7649051e94832576e02b5f5ad17abe093d21d48e

Conflicts:
	core/java/android/net/NetworkStateTracker.java
Fix time zone info in kernel is nothing after reboot

If sys_tz is not set correctly, the timestamp of
filesystem will be in-consistent with android's time,
until time zone is set from android's UI. Set kernel
timezone while initializing AlarmManagerService.

Change-Id: Ic85def954fc9388e943e3dee45767d8179825a49
Added overload methods for DatabaseUtils.queryNumEntries

Now you can filter the count statement with a selection
and selection args
UnitTests for this new methods are added to the cts project

Change-Id: Id9233aec0eaac08839041ae7cbaba203470ad3d8

Conflicts:
	api/current.xml
Telephony: Remove references to mExitECMRunnable object.

Free mExitECMRunnable object while destroying CDMA phone.

Change-Id: I411b3e5e41a9cc76c3571a98f13f91d84523f623
Fix the layouting of the checkbox.

Sometimes (very rarely) the checkbox is not layouted correctly
(it's partly visible only). The reason is that the checkbox
(and the hint text below it) has layout_width set to
"wrap_content" as well, which means it needs more then one
layout runs to get the final layout.

Change-Id: I460bb29e2d9b4fdcf3df314e2baf9c45b2a6259b
Shutdown when capacity is 0% and no charging or when battery is dead

Android framework does not shutdown when battery capacity is 0% and a
charger is attached (USB or AC). This handling is incomplete since a
charger might very well be attached but charging has stopped because
USB suspended or the charging algorithm has stopped because of
battery safety handling. Also shutdown when battery is reported 'dead'.
This might happen although charging is present.

Change-Id: If328260ebf4d38f912e4d2fad204431cbb19c993
Telephony: Control operator selection using EF_CSP data.

As per CPHS4_2.WW6, CPHS B.4.7.1, the most significant bit of
Value Added Services Group(0xC0) info, controls operator selection menu.
   -If this bit is set, display operator selection menu to user.
   -If this bit is not set do not display operator selection menu to user,
	 set Network Selection Mode to Automatic.

Change-Id: Icca4898abced0b0beb94c3434448a26eae72008b

Conflicts:
	telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
Revert "Shutdown when capacity is 0% and no charging or when battery is dead"

This reverts commit fd04143a47770256dabcfa4d8447127b3ec8b2bf.

This break most automated tests because with this change, if the
device is fully charged, it will simply turn off the screen, regardless
if USB is connected to hsot PC or not; so for our tests, most of them
are always connected to host PC, and fully charged 99% of the time,
as soon as the screen turns off, the front-end test Activity will be
suspended.

Change-Id: I1e6590611af43812f1bac223dd31570d1d90cfc5
  Initial contribution from Sony Corporation.

  Add DRM Framework to support DRM content playback
  together with StageFright.

  - DRM Framework code is added
     - include/drm
     - drm
  - api/current.xml is updated to include DRM Framework Java APIs
  - cmds/servicemanager/service_manager.c is modified
    to add drmManager and drmIOService.

Change-Id: I6d7bc9c7067362b500e530988a9ce241761866fb

Conflicts:
	api/current.xml
	cmds/servicemanager/service_manager.c
Bug 3361124 Remove drmioserver

Change-Id: I64cba4be8a38b60bf3873836b4cd0d1039e19706

Conflicts:
	drm/drmioserver/Android.mk
	drm/drmioserver/DrmIOService.cpp