Deactivate multi-thread in multi-dex mode

It should already have been the case, but it wasn't and it crashed.

Change-Id: Icb461d6e43ef2d113f59038d8c2327f3cfaff86c
(cherry picked from commit cf069ca52f2af9f70fcbeac99443f00401d43b4a)
Fix synchronization when preparing ids.

Synchronized blocks were using different locks.
Replaced by a safer version: marking intern method synchronized.
This means synchronizing more than necessary but it had no
mesurable perfomance impact.

Bug 11744785

Change-Id: I35e691232cd6971d13735be9b72969739ef71e09
(cherry picked from commit 5c4883e75b26a002c67bfa1c0053c50e17dbac90)
Fix BufferOverflowException when merging dexes

Bug: 11519714

The bug was due to the fact that when merging 2 dexes, not enough size may be reserved for the "typeLists" section.
This is because we only aligned the sum of the size of both sections.
If both typeLists sections were aligned with 2 and not with 4, we are 4 bytes short when writing.

Change-Id: I73b51eb25434a622143011741a69b88d42507f43
(cherry picked from commit 2241dbe132cf90b58f93c014bdd807405b7f82f5)
Merge "Fix synchronization when preparing ids." into klp-dev
Merge "Deactivate multi-thread in multi-dex mode" into klp-dev
Changed dvmDexCacheStatus to check for odex file first.

This prevents the generation of a new dexfile when an odex file already
exists when switching between Art and Dalvik.

Bug: 13463154
Change-Id: I55ef9abe1fe172ee656550e78556381f95698c33
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
Prevent occasional post-dexopt brain damage that required re-dalvik-wiping and a four leaf clover to recover from?

Revert "Re-AOSP-ify id synchronization"

This reverts commit d5ccc2ecf0984fe8cb74fe45d29c30e69abac54c.
Use libziparchive for dalvik zip processing.

The API was similar enough that we could just delegate
to existing zip functions. The existing ZipArchiveHandle /
ZipEntry types have been reused instead of defining new
types.

The old ZipArchive type has been removed because it serves
no useful purpose, and no code was using it anyway.

Change-Id: I47f12344d1e6efc234fed50b1613f9f179a9b03f
Fix libutils dependencies for dexdump & dexlist.

We should always use a libutils SHARED_LIBRARY on the target &
a STATIC_LIBRARY on the host.

(cherry picked from commit 2ac78805e1b4d80308c5c4a48a997abc3a2ac37b)

Change-Id: I06c9b8f0cf663e00da0eeba54c893d8eec1d8a9f
Revert "Use libziparchive for dalvik zip processing."

Bug: 12173498

This reverts commit ac4202a846965a6b5a88001a8ad3d5321edeb81c.

Change-Id: Ie48d873bded13e0f73cb1e926dbcd30a66933176
Revert "Revert "Use libziparchive for dalvik zip processing.""

This reverts commit 52dacd58ac8735ffdcd6bbe952586a38ad70e6a5.

Change-Id: Ifbb3556449d000a53c2304d998d5ecce82e4940d
Fix a few bugs introduced by the move to zip_archive.

- mmap failures because the output file was opened with
  O_WRONLY instead of O_RDWR

- In two instances, we were passing the wrong handle
  to CloseArchive(ZipArchiveHandle). The issue is code
  like this:

  ZipArchiveHandle h;
  OpenArchive(&h);
  CloseArchive(&h);

  This compiles, but isn't correct. ZipArchiveHandle is
  a typedef for (void *) and the compiler won't complain
  because void** is also void*. Some of this code was written
  before the API was changed from CloseArchive(ZipArchiveHandle&)
  to CloseArchie(ZipArchiveHandle) but continued to compile
  even after the API change. I'll change the API in the follow up
  to catch errors like this at compile time.

bug: 12173498
bug: 12176258
bug: 12178641

Change-Id: I71ac36654311f582b5ab633e1ed0d13e00053c84
Fix libutils dependencies for dexdump & dexlist (again).

We managed to get into a bad state because the change that
fixed dependencies on dalvik-dev was cherry-picked on to
master-aosp and then the change that needed this was
reverted.

Git got confused as a result.

Change-Id: Idef607a676cff85d00e95a94a9be09d791b2fa96
Merge branch '4.4.3_r1.1' into HEAD  --- Possible taint between 110-130

Conflicts:
	vm/JarFile.cpp --- Possible taint between 110-130

Change-Id: I25dae98506ca619f0fbe4b5ed04696ceb5d28cf1
Signed-off-by: DHOMD <DHO@dho.im>
Fix boot

Change-Id: I1ed77b43282c5e4b006eb1bec6a0dd857a33d8f2
Merge remote-tracking branch 'vanir/kk44' into kk-mr2