Merge tag 'android-5.0.1_r1' into HEAD

Android 5.0.1 release 1

Change-Id: Id44d5168fc8a77c4a30a86729c7fd7194e97bc1b
Signed-off-by: ayysir <ayysir@aospal.com>
tethering: update connectivity intent

use immediate intent in place of delayed in order to
react promptly for underlying network changes.

Change-Id: I387d5dff7dfca01094177518a5936c6e600081f6
CRs-Fixed: 752832

(cherry picked from commit 4f77a4140afd9fa9269874a73b3f760fa5cc393b)
Make sure emulated storage path index is 0

MediaProvider blindly assumes that path index 0 of the array returned by
StorageManager::getVolumePaths() is the emulated storage.
However, this is not true when you have multiple users.
This patch modifies StorageVolume::getVolumeList(). to make sure that
assumption is always true.

Change-Id: I4650478274a87adfed91fe53097c1e47fb2f10c7
Signed-off-by: Fernando Guzman Lugo <fernando.guzman.lugo@intel.com>
Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>

(cherry picked from commit 30def9e7fac025f68c540492be9be8bdd2afda5a)
ExternalStorageProvider: SD card's name in Document UI is unreadable

The SD card's title used in Document UI is storage volume's user label.
some times, storage volume's user label may be null or something that
is not human readable, in this case, descripition will be much better
than user label.

If we could get a non-null description, use this description as title.
Otherwise, use storage volume's user label as title.

Change-Id: Ie1adc6ff39293642ebb72d45d8896a273c515205
CRs-fixed: 740100

(cherry picked from commit 5c25d5cc0aeed43bca506edc179fd2bb12a1766c)
Storage: Add secondary storage support for app installation

Add secondary external storage APIs for app installation. And
change the logic to allow app to be installed into external
storage.

Change-Id: If2f67af7508d020c1d041bb955e3d55136a34acc

(cherry picked from commit 99d3b9b80628f93a0b467a8c66c12012245b46d4)
Hide new methods instead of modifying the public API

Change-Id: I8a1b316f70a0dd76eb6c900d9c1a74e8e1765af3

(cherry picked from commit a852ea56574092a2de0714404aacf455300f5f02)
Add support for QC's time_daemon

Enabled by BOARD_USES_QC_TIME_SERVICES=true, it requires the device
to provide its own time_daemon executable and libtime_genoff.so
proprietaries. The library should be copied by the device's setup
config to $OUT/obj/lib for linkage (and pushed to the final build,
obviously)

Change-Id: Ie6964dbe2692dc33fc04093a5b89b6922d8443c8

(cherry picked from commit fc8c502d005719435b34eb1995e3ad4380312fee)
ExternalStorageProvider: String mismatch with system language

Text of phone storage does not change when locale changes.

Obtain the string each time by querying the database.

CRs-fixed: 739290

Change-Id: Ic6f5292f8eef9c9438e80fa876b8f276f21e26c8
UsbSettings: Add UMS mode support.

Add Usb Mass storage mode support for Android device;
Fix SD card can not be mounted to device when usb cable
is plugged in or unplugged fast and frequently.

Change-Id: Iff6de6b1b3e066f4a4ab610ae3fe10b22f5b0822
UsbSettings: Adjust UMS mode code logic.

Not to update UMS status in every iteration of client listener.

Change-Id: I5fbc0145c798c468f2ae943b251700f1a71e00d8
Screenshot: Add delete action through notification

* Forward port to lollipop.

Change-Id: I73d160766c232266f98badc1340b506e873c1ad5
Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

(cherry picked from commit 4d111e8ed44bae54ef27e937af53bc6dddd11488)
SystemUI: Use material delete icon

Change-Id: I11df5713486672e4f5c4784e6f94a893cf36b4dd
SystemUI: make clock and time clickable in statusbar

Clicking clock opens alarms, clicking the date will open the calendar.

Change-Id: I622527c1f144a8867aa543348b70a4fefe3f6403
Signed-off-by: Roman Birg <roman@cyngn.com>

(cherry picked from commit c7a4aa7d96d236835b187c72a82d7e6bf1231c3a)

(cherry picked from commit bfbedca0c4caf09746084e4300bb7153ca1c38b3)
SystemUI: make alarm text selector less blocky

It now matches the rest of the selectable items in the expanded header.
None of them had these boundries and neither should this.

Change-Id: I92041ee685a0c16f80c003658abbfd0a6143c07c
Signed-off-by: Roman Birg <roman@cyngn.com>

(cherry picked from commit 7a9c11f4396c07e1d6fd5e5913f4b8e500a9555e)

(cherry picked from commit f1cc4949f03b3940b4a82257ef0acf2cd7b9e6ce)
Environment: Unbreak public API

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Environment: Return external dir if secondary is not defined

If the device doesn't define a secondary storage, then return external storage
as secondary storage

Patchset 2: do not break the api

Change-Id: I9d94a01881f47977ef1a26c3648b3da1d8c63b57
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
PackageManager: allow build-time disabling of components

Allow components to be specified as disabled at build time
(applied on boot).

This allows stock OTA components to be marked as disabled in
CM builds.

Change-Id: I6e4499cc40a779792a5ea97a10137399dad7d69f

Conflicts:
	core/res/res/values/symbols.xml
frameworks/base: Fix to avoid UI freeze issue.

Due to some race condition in WindowManagerService, Screenshot
layer remains as topmost and buffers are not flipped hence
no updates seen on the screen. So, trying to destroy persistent
layer explicitly if freeze timeout expires 6sec.

Change-Id: Ibe295550a7431a4f633a57e7dfab0cbda102ab87

(cherry picked from commit f8146d56eab71245cf6b86d0c5a4725c528d8a0b)

(cherry picked from commit c6789fe6da4e6855e9409851a6469d20561cbe49)
MediaMuxer: handle expection for add track

Native addTrack call throws IllegalArgumentException on failure.
Catch this exception in MediaMuxer and throw IllegalArgumentException
that calling function can trap.

Change-Id: I97239ee2272c754ef6d7d54c5a27d1889ac01b80

(cherry picked from commit 1dd6f42412fb6a15c64acb71028798432ff06ba9)

(cherry picked from commit 7fc3e90b3f4aece035cfedb2790d35ef3938d7a6)
SystemUI: Remove unnecessary mobile data activity icon update

The unnecessary mobile data activity icon update causes activity
icon is 0 when mobile data is not actually used. As a result, data
icon will not show even if data connected.

As mobile data activity icon has updated in updateDataIcon, do not
update it again in refreshViews. Remove unnecessary mobile activity
indicator icon update.

Change-Id: Ib39c55a39a0623cc9a2d14508d487f86e3a0f82f
CRs-Fixed: 745386

(cherry picked from commit b30569b021d81a0598dbc5f131ef5f1de31f2d0d)

(cherry picked from commit 46a0e182b4f833c7ff771679958a1cacb43d0d57)