Using a static Pattern in UriMatcher prevents compile-time
initialization.
It is also not efficient, as String.split has a fast path for simple
splits.
Bug: 19542228
Change-Id: Ie9e5bfe6da04c6d05ec10b1426d0cd136ef46ef2
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
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>
add the following functions to make it more symmetric to copyFrom().
- copy1DRangeToUnchecked, copy1DRangeTo
- copy2DRangeToUnchecked, copy2DRangeTo
- copy3DRangeToUnchecked, copy3DRangeTo
- setFromFieldPacker, 2D and 3D variants
- copyElementTo, (1D, 2D & 3D)
Change-Id: I6b896123e1c00cead552aa5b31a701b15dd70f85
This adds the classes for creating and serializing arguments and results
from keymaster as well as the enum values from
hardware/libhardware/include/hardware/keymaster_defs.h which will be
needed for argument creation as well as converting keymaster error
codes into Java exceptions.
Change-Id: I61046756361d43d9f02eea370c2cbd07c3638ea3
Corresponding frameworks/native change:
https://android-review.googlesource.com/#/c/134491/
Since this fixes the int-to-pointer cast issues, stop ignoring that
warning.
Change-Id: I85134dc151ba368e4619e36125264b2b3f104202
This commit removes a couple of apostrophes from the word "UEvents" as
the apostrophes would only be needed if something that belongs to the
UEvent was being talked about. Instead, the UEvents are being talked
about themselves - as a bunch.
Change-Id: I6a7908c6b73c0739102b632d2499e0f1e3c2d47f