AppOps: Don't apply OP_ALARM_WAKEUP to system components

System can freely invoke and manage alarms. Preventing it from doing
so interferes with remote components like the backupmanager (backing up alarms)
due to the mismatched uids between the invoking app and the running
service that takes the action.

Change-Id: I079df8d2522642d6d9194781207df7dd67b715b2
audio: Volume can't adjust during HFP call when screen is off.

PhoneWindowManager don't pass the key to the application when screen is
off. In handleVolumeKey(), the STREAM_VOICE_CALL volume was set, so the
STREAM_BLUETOOTH_SCO volume can't be adjusted.
Add a judgement to choose the correct stream to adjust when screen is off.

CRs-Fixed: 649548

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

Change-Id: I1ab06617d59b9bf2eabed9ed8b6892bc20db75b9
audio: no notification sound when adjusting volume bar twice.

Notification sound won't take effect when the previous track hasn't
finished.
Need explicitly stop the previous ongoing track to alow the current one.

Change-Id: Ib344a8b14ecc47a5c8fdd9c11ae48a3541ea9a55
CRs-Fixed: 652236
Bluetooth: Unbind only in case of OFF state

In MESSAGE_SAVE_NAME_AND_ADDRESS,BT manager
calls unbindandfinish without checking BT
adapter state which if not OFF, will lead
to improper cleanup. Unbind will get called
but cleanup will not happen.

Change-Id: Ibfc70c51a95f8b80f331090e322ba3ebb88f6c03
CRs-Fixed: 652260
Bluetooth: Adds check to verify Bluetooth adapter state

This checks whether bluetooth is turned ON or not in BLE
start scan process.BLE scan apis are called from applications
so need to check if BT adapter state is ON to avoid Bluetooth
crash

CRs-fixed: 649274
Change-Id: Ic075e1560bba2cabbfac2e1477932f9ad3144067
BT: HF: Control verbose logging at runtime.

Verbose logging in BluetoothHeadset can be
controlled from adb shell.

Change-Id: If63974402a4fc91065c8007a224388af12f49cf7
CRs-Fixed: 601899
Clear cached locations when location providers disabled Bug: 12118307

(cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e)

Change-Id: Ief869b9e38858092bfa3f8d6d090a278dee7d86c
AlarmMangerService: Fix the delay of ACTION_TIME_CHANGED for time-services

After boot completed, if low memory condition happens or some ordered
broadcasts have time out, it will cause delay for some receivers to
receive ordered broadcasts. Adding FLAG_RECEIVER_FOREGROUND into
time changed action will make TimeServiceBroadcastReceiver receive
ACTION_TIME_CHANGED in time.

CRs-Fixed: 630982
Change-Id: Id789d0b3c969af6b92f62612602ba119613382ab
ExtMediaPlayer: Increase parcel pool size to 30

Increase MAX_NUM_PARCELS to 30. This is to handle
parcel override issue when textsamples are sent at
a fast pace from mediaplayer.
Usecase: With CEA CC streams, dashplayer sendTextPacket
embedded in each video sample as soon as decoded.
No realtime offset delay sync logic for text samples
as with A/V samples. When samples drained in batch,
can have more than 5 textsamples sent in flurry

Change-Id: I4c4c63b9c9c296dbb387c4da9e70c040b75f92b6
AppOps: fix framework reboot issue when AppOps enabled

When AppOps security feature enabled, there will be a prompt when
someone call the protected operation. If no user click on the
dialog button, it will be always blocked there. This action may
cause watchdog timeout in some service.

Change-Id: I114bfef22502b81887a84b218e1548de29be3f69
Fix socket descriptor leak from Zygote to child app

Due to an API change in LocalSocket, Zygote must now
manually close the FileDescriptor it created when it
registered a LocalServerSocket.  The LocalSocket.close()
routine will no longer do so.
Bug: 12114500
(cherry picked from commit 70ef29b04ee4ef7d7acfec79041dbe800961195e)

Change-Id: Ief23a3c99e007dc4aa6f94dfb47a1b2b6c854dad
AppOps: don't make delay for permission dialog

Permission dialog is unclickable for 1 sec. To remove this delay
for better user experience.

Change-Id: I9dfc90c1fe5b057d4379a8acb05ac21b913b7360
Themes: Map themed icon to app after upgrade

Before this patch, applying an icon theme and then upgrading an app would
cause the app to lose its themed icon.

Change-Id: Ia76a33d0fb731720aa735e9dd9596bc5d2e75d9f

Patchset: 2
http://review.cyanogenmod.org/#/c/64571/
CM11 Themes: load wp from apk if uri is null

When setting a default theme on first start, the provider may
not have processed the theme and the uri for the wp will be null.
If this happens try to load the wallpaper from the themes assets.

Change-Id: I883b9dd796920e66e4729e78d41cd8899916fa42
Saunalahti considered non-roaming on Elisa

Change-Id: I51b554cf578c6027d52ad6e111e41d269c1f579f
Tele2 considered non-roaming on T-Mo

Change-Id: Ibb05f277b701861b8716168b54e96f63127e686d
add a getter for the x and y offsets of the wallpaper window

Change-Id: I35294bcac664e85cc5d344b50b5c4335a60d3f37
Automatic translation import

Change-Id: Ie73ec7956594b8a5892507e3c6b49aa5748a23aa
Make KeyguardMultiUserAvatar fully themeable

Create the animation color for the username text based on the final
color.

Change-Id: I4b1beb70160e178264c32f3b33c6c0c7c51f70c5
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
CM11 Themes: Use package name from AndroidManifest

It is possible for an apk to have a different package
name for the resources than what is defined in the
AndroidManifest.xml of the apk.  Using the resource's
package name for the base package name causes themed
resources to not be properly loaded.

Instead of returning the resource package name we return
the apps package name from AssetManager.

A good example of this is Trebuchet.  The system sees
it as com.cyanogenmod.trebuchet but it's resources use
com.android.launcher3.

Change-Id: Id57e68b27b3c7509e3358a7fd12ae73a03dd6cdf