Revert "Merge "CM11 Themes: Clear wallpaper mixnmatch entry on external change" into cm-11.0"

This reverts commit 7283f7102d80edf139b1bff1bcfc7a188a40f786.
Revert "Merge "Notify callbacks on "any" wallpaper change" into cm-11.0"

This reverts commit 68180223ed30f16303cc0fcf25993e82c16b4e51.
SignalStrength: Hotfix TD-SCDMA take 2

The previous approach worked for 3G, but failed with TD-LTE. Let's
try something different to make them both work, and use the derpy
LTE checks only if a GSM signal is present.

Change-Id: I77e3b5a1e0f99df30c32b102918af418a20077c1
(cherry picked from commit 37e3d46deb81ed1bf54052b47363238a48e4f1fe)
Themes: Fix bad idmaps for system themes

For a system installed theme or a user who cleared his resource-cache,
there were empty idmaps for some packages.

[Details]
During startup PM could reach the theme package first before the target app was scanned in yet. This
would cause aapt to be skipped. Then when the target app is being installed in startup,
PM would try to create idmap pairs but it would fail since the resources from the theme
were not compiled for that target app.

Also cleaned up PM idmap/aapt creation a little bit more

Change-Id: I6a7dbd7c5d51a2d1336e3289c1e03bb3ed5d762e

Conflicts:
	services/java/com/android/server/pm/PackageManagerService.java

(cherry picked from commit fabfb1734c3bad4c9b11ef16e5132e0f8565e5db)

Conflicts:
	services/java/com/android/server/pm/PackageManagerService.java
Avoid calling idmap w/ trailing whitespace [1/2]

installd performs a buffer over-read if trailing ws is sent to it.
No observable effect found yet for idmap, but until installd is
fixed upstream, best to play it safe.

Change-Id: I56c9b4bd956ca6f59935253c6d2c90c4dba0ae94
(cherry picked from commit 288770289926138209b95a2ec2a0f760add1c06f)
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
(cherry picked from commit b528fea482a5e5dd37b980be4a0e820d564bcdc7)
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
(cherry picked from commit 0aee91b17d68a444ff779ead8ca7fd98a1b12e46)
Bluetooth: use  virtual sco calls for VOIP

 - use virtualvoicesco connection set-up for VOIP calls
 - cannot simply revert c18c9138cee0f0859bcab636a004ce92ca4a9ab5
and 25fc29b3691a1d2a84164988dc74b2e7d301868e changes because
of aidl modifications involved.

Change-Id: Ib49cb01151a9cea2e94bc7a51ad1f58e877271aa
CRs-Fixed: 598072
(cherry picked from commit 6b8a356e07ed170975f334b93d40d1ccbfc25369)
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
(cherry picked from commit e27017ecc3e2d05e9877eb19eabd6eede319f819)
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
(cherry picked from commit f32a228c6265ac8af86bffaf878ebe9782992661)
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
(cherry picked from commit 5f77e51671ca6df35915d6cfdc7d8c031132630b)
BT: HF: Control verbose logging at runtime.

Verbose logging in BluetoothHeadset can be
controlled from adb shell.

Change-Id: If63974402a4fc91065c8007a224388af12f49cf7
CRs-Fixed: 601899
(cherry picked from commit 7ca809f2d295ad0645a545c16bd5364aa4c6884b)
Clear cached locations when location providers disabled Bug: 12118307

(cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e)

Change-Id: Ief869b9e38858092bfa3f8d6d090a278dee7d86c
(cherry picked from commit ca713fbea484dab1349f00a0ef381e61d3e45004)
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
(cherry picked from commit faabd6aa62ff74492a1b038085da5ab403288d34)
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
(cherry picked from commit a1a13cbc7a287260c1af3ae65f6e2582492f80af)
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
(cherry picked from commit 608f0f9b48d917158ae26640732fce48d8e265af)
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
(cherry picked from commit d3eafb08063e8fbdb1317e3d1f759841563030bc)
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
(cherry picked from commit a81fd935a4733499c059a03046cba5e7762b1675)
Revert "Kill floating activities running in the same thread when tapping outside"

This reverts commit 187b499f0b077a58fb5eda454a8300de19156503.

(cherry picked from commit 820dbeb79be03c33794eb3e45fd2f76751b08d8b)
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/
(cherry picked from commit 8db1eafe487e06f862db3744f3d92c533a2d8ba1)