Using a static Pattern in ActivityThread prevents compile-time
initialization of ActivityThread and GestureDetector, which depends
on the former.
It is also not efficient, as String.split has a fast path for simple
splits.
Bug: 19542228
Change-Id: I5bb843c08c81e0d259bb8afafa87a8467bb1730e
In KeySetManagerService, use ArraySet more explicitly. Avoid for-each
loops.
Collections API methods on ArraySet are not very efficient. Iterators
incur two object allocations: a helper and the actual iterator object.
During boot, about 4.5K such calls are made. Using the ArraySet more
explicitly like an ArrayList/array avoids the overhead.
Bug: 19617481
Change-Id: I25df334fa1d4be3210667fb1404e3c43f2585049
Add a simple ArraySet.removeAll(ArraySet) method. This avoids two
allocations, a MapCollections helper and an Iterator object, over
the removeAll(Collection) code.
KeySetManagerService heavily calls removeAll during boot (about 9K
times in AOSP). This reduces GC stress and optimizes the removal
(about half the time the removed collection has only one element).
The removal method in KeySetManagerService is also done under a lock,
so that it gates parallelization efforts in PackageManagerService.
Bug: 19498314
Change-Id: Ib0e483adfd09831cd66ab19a820ebf6544a2b66f
The pattern of #include and using namespace std here fails to build
with GCC. At first glance it's a GCC bug rather than libc++ doing
something wrong. Regardless, it can be worked around by just
specifying std:: where appropriate.
Bug: 19606303
Change-Id: I5652682eae7ca7559cf2a9307909859013440781
Symptom:
Report broadcast ANR on a dead process.
Detail and sample:
http://code.google.com/p/android/issues/detail?id=158329
Root cause:
app.curReceiver can only remember the last running.
If an application is both receiving FG and BG broadcast,
only one of queue can discard, the remain one will still
count as timeout.
Solution:
Select the skip-tartget-receiver by comparing the skipping app
to the first record of mOrderedBroadcasts of each broadcast queues.
Change-Id: Ic68d56f21b417a34f2d30d64ecfbed09c5e1764d
* commit 'caa8a8fb9849f1d44ffab3117950ac1e7b02cd4d':
[Renderscript] JAVA API update for Allocation.CopyTo add the following functions to make it more symmetric to copyFrom().
The current SELinuxPolicyInstallReceiver logic can yield a partial
or mixed (old and new) set of policy files under /data/security/current
if there is an error or a crash at certain points before completing
the installation of the update.
Rewrite the logic to avoid the possibility of such partial or mixed
policy updates by using rename on the entire directory of policy
files rather than operating on a per-file basis. Also separate
the extraction of the policy files from the bundle into their own
temporary directory. Make sure we delete any previous temporary directory
or backup directory before using them for this update. Drop the
use of a symlink for /data/security/current altogether; it provides
no benefit.
Change-Id: I564af01c2c3ca1531c216013b8724c7511f32de8
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>