2983 Commits

Author SHA1 Message Date
Bill Yi
293513a59d Merge commit '0b62467b142b61ee1e449ba958ba37dfd961ef56' into HEAD 2014-04-29 16:07:29 -07:00
Mark Salyzyn
c6a410164e jni: android_util_Process 64 bit issues
- critical issue with using %lld to scanf into a jlong
- subsidiary issues with mix jint, jsize and jlong printing

Change-Id: I77c6b3d3a202fec741cacc540fc39ad6cba25f52
2014-04-24 13:09:15 -07:00
Mark Salyzyn
5b6da1aee8 jni: binder ptrdiff_t compile issues
Change-Id: Ibdd82479d3f9fb53cf1d6793c4f7353e8f1c3646
2014-04-17 17:25:36 -07:00
Mark Salyzyn
cfd91e7852 jni: binder 64-bit compile issues
Change-Id: I8a3083e7e9389bbb84c2dd061fef059e0595800d
2014-04-17 15:40:01 -07:00
Mark Salyzyn
853940331f frameworks: 64 bit compile issues
ToDo: core/jni/com_android_internal_net_NetworkStatsFactory.cpp (merge issues)

Change-Id: I5cf0bbb868e6c18e86c97c6491b6ee983a8ee1a2
2014-04-16 10:43:48 -07:00
Narayan Kamath
80413c9fe1 Merge "Re-implement native library search and copies." 2014-04-10 09:19:38 +00:00
Ramin Zaghi
1378aba7ae Re-implement native library search and copies.
We now use a two step approach :

- First we look through the list of shared libraries in an
  APK, and choose an ABI based on the (priority)  list of ABIs
  a given device supports.
- Then we look through the list of shared libraries and copy
  all shared libraries that match the ABI we've selected.

This fixes a long-standing bug where we would sometimes copy
a mixture of different ABIs to the device, and also allows us
to clearly pick an ABI to run an app with.

The code in NativeLibraryHelper has been refactored so that all
file name validation & matching logic is done in a single place
(NativeLibrariesIterator). This allows us to avoid a lot of
redundant logic and straightens out a few corner cases (for eg.
where the abi determination & copying logic do not agree on
what files to skip).

bug: https://code.google.com/p/android/issues/detail?id=65053
bug: 13647418

Change-Id: I34d08353f24115b0f6b800a7eda3ac427fa25fef
Co-Authored-By: Zhenghua Wang <zhenghua.wang0923@gmail.com>
Co-Authored-By: Ramin Zaghi <ramin.zaghi@arm.com>
Co-Authored-By: Narayan Kamath <narayan@google.com>
2014-04-09 17:16:40 +01:00
Mark Salyzyn
ecdf9b199a Merge "jni: liblog reading error API incorrect" 2014-04-09 16:07:48 +00:00
Narayan Kamath
22ec1eefa4 Clean up argc / argv processing for runtime args.
- Make copies of argc, argv before argv is potentially
  overwritten with the process name.
- Allow multiple command line arguments to be passed to
  ZygoteInit (this is required for some of the 64 bit
  zygote work).
- Add an explanatory comment about how these argments
  are processed.

Change-Id: I752be69c5c0f97ed17d1a3dded19f46ee00929b0
2014-04-09 13:39:41 +01:00
Mark Salyzyn
b519aeca47 jni: liblog reading error API incorrect
- return value contains -errno on error.

Bug: 13907124
Change-Id: I91f12db5749fac2ae8ed5b0f033d4eaf83e666f5
2014-04-08 16:17:51 -07:00
Narayan Kamath
a23fcd7be8 Remove ProcessState::mArgc,mArgV,mArgLen
These look like historical oddities, and weren't really being
used for anything useful.

Process:setArgV0 was being called by android.util.Process, but
that functionality can be moved directly into the implementation
of that class.

bug: 13647418

Change-Id: I216c8f8a4c065f0cf3a61f19f9e32decd26f93f6
2014-04-03 12:29:07 +00:00
Narayan Kamath
973b4663b0 Move zygote startup logic to the frameworks.
The Zygote class is now in com.android.internal.os. It is
responsible for the vast majority of work before and after
the call to fork(). It calls back into the Runtime via
the new dalvik.system.ZygoteHooks class to allow the Runtime
to perform pre fork cleanup and post fork initialization.

The native code in Zygote.cpp is a direct and straightforward
port of the existing code in art. Most differences are
superficial, for example :
- We use C style logging (ALOGE) instead of stream based
  logging.
- We call env->FatalError() instead of using LOG(FATAL)

Change-Id: Ia101fb2af12d23894fe57e4134d2bc6d142e5059
2014-04-02 10:18:43 +01:00
Ashok Bhat
f5df700e6c AArch64: Make frameworks/base code more portable
Changes in this patch include

[x] Use %zu for size_t, %zd for ssize_t

[x] Some minor changes have been done to conform with
    standard JNI practice (e.g. use of jint instead of int
    in JNI function prototypes)

Change-Id: Id1aaa7894a7d0b85ac7ecd7b2bfd8cc40374261f
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2014-03-27 12:30:42 +00:00
Narayan Kamath
ab9efda69f am ea96d791: am 5f0d44f6: Merge "Fix scaleNinePatch."
* commit 'ea96d791c7eca3eb5d003b8559b89a573f81dac9':
  Fix scaleNinePatch.
2014-03-25 14:31:45 +00:00
Narayan Kamath
02eb6bfd66 Fix scaleNinePatch.
Use yDivs for yDivs, and not xDivs.

bug: 13394494

(cherry picked from commit 42a51ae8812bccde7ff370cc2688f7955e489ad4)

Change-Id: Ia0a7d701a170945216ab247a483e7f972b6fe17e
2014-03-24 12:35:01 +00:00
Victoria Lease
3486659584 am cfd46dc4: am 610d401c: am e9c7fd2f: am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit 'cfd46dc4847d5ef1ed14484717cf857ae5f67cae':
  malloc some advances
2014-03-20 15:41:49 +00:00
Narayan Kamath
a2275b9869 am c850102d: am 0da4ad42: Merge "Don\'t register methods when there\'s nothing to register."
* commit 'c850102d5c4b1fad47c221911c7be5567cebe8b1':
  Don't register methods when there's nothing to register.
2014-03-20 10:18:46 +00:00
Victoria Lease
610d401cb5 am e9c7fd2f: am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit 'e9c7fd2f2ee7840c61dc66ead3737e437f4e8c10':
  malloc some advances
2014-03-19 22:27:06 +00:00
Victoria Lease
e9c7fd2f2e am 55371beb: am 754bf6ab: am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit '55371beb024ae402831898f8788e4293f52dd832':
  malloc some advances
2014-03-19 15:21:09 -07:00
Victoria Lease
754bf6abc0 am c8868db2: am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit 'c8868db2a025a97e439f8a9adde565c9c83f2204':
  malloc some advances
2014-03-19 15:08:32 -07:00
Victoria Lease
c8868db2a0 am 737d3e5d: am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit '737d3e5da366124d164555009fa5ee4552143cc8':
  malloc some advances
2014-03-19 15:03:28 -07:00
Victoria Lease
737d3e5da3 am 6b96ecca: am 32753f4f: am 31912122: am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit '6b96ecca90555e04da8a4477d6dc6de83e7b9ee1':
  malloc some advances
2014-03-19 14:57:36 -07:00
Victoria Lease
3191212259 am 6eb28103: am 183f97b7: am 1c12f9e7: malloc some advances
* commit '6eb2810318262ff36014c52384ed3cdea19bd34e':
  malloc some advances
2014-03-19 14:40:17 -07:00
Victoria Lease
6eb2810318 am 183f97b7: am 1c12f9e7: malloc some advances
* commit '183f97b72faf7a0f45ad66e1b3fd9a4343cc7482':
  malloc some advances
2014-03-19 14:32:15 -07:00
Victoria Lease
183f97b72f am 1c12f9e7: malloc some advances
* commit '1c12f9e76298c757423155ad812890d27effafe8':
  malloc some advances
2014-03-19 14:27:19 -07:00
Narayan Kamath
f83c73ec2f Don't register methods when there's nothing to register.
Change-Id: I6d0233f79bb90089426d702b4076ec5750e82475
2014-03-19 14:13:27 +00:00
Victoria Lease
1c12f9e762 malloc some advances
Bug: 13506939
Change-Id: I87ad616960c4f16bc55d8b906049dbd4f001d6a5
(cherry picked from commit 3af2a37e057b31617b8f4eeb22ac3ef85c3fd5aa)
2014-03-18 16:22:20 +00:00
Narayan Kamath
ddcaf0d178 am d2133079: am 7c0dfed5: Merge "Pass int32_t for JNI calls to java Input/Output streams."
* commit 'd2133079c085cb0879facc8ee72678524d22571a':
  Pass int32_t for JNI calls to java Input/Output streams.
2014-03-18 09:41:20 +00:00
Ashok Bhat
2bb39d7a43 Pass int32_t for JNI calls to java Input/Output streams.
Passing size_t is problematic on 64 bit platforms where
it's 8 bytes in size. Conversion to int32_t is safe because
the size argument is always clamped to fCapacity, which is
4 bytes wide.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Change-Id: I58558561a4f56451485f1a5fc6cdeda677247071
2014-03-17 10:13:16 +00:00
Dave Allison
0d70d336b4 am 788fb96d: am 47653f2d: Merge "Move options buffers to top scope"
* commit '788fb96d7f1cfe27cf8dd56a053258964427286f':
  Move options buffers to top scope
2014-03-14 21:21:59 +00:00
Dave Allison
07a1e2323b Move options buffers to top scope
It is important that the char buffers for options do
not go out of scope as the mOptions.add() does not copy
the buffer.  This moves all the buffers to the top
level scope of the function to prevent accidental
overwriting when they go out of scope.

Bug: 13448497
Change-Id: I5a97ddd32ff34f237915927906e1e1f833ff036e
2014-03-14 21:15:08 +00:00
Narayan Kamath
acccf83616 am b071a07d: am a79af364: Merge "Remove java.io.tmpdir assignment in AndroidRuntime (again)."
* commit 'b071a07da89a8736fa4fd757f9a6c6e990d0e858':
  Remove java.io.tmpdir assignment in AndroidRuntime (again).
2014-03-13 01:55:28 +00:00
Brian Carlstrom
a77df79c17 am ec4c7752: am ab97d617: Merge "Only pass -Xprofile-* options to ART"
* commit 'ec4c7752c22ae26924378d953a6f4a0e8e8b036d':
  Only pass -Xprofile-* options to ART
2014-03-11 18:52:23 +00:00
Narayan Kamath
a742ca4017 am bbf82665: am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."
* commit 'bbf826659e8e5d0be683b2459207c495303d53b6':
  LP64: Make 9 patches architecture agnostic.
2014-03-11 18:52:07 +00:00
Dave Allison
2fddd6cd2e am b94904ab: am 3fc3b9fd: Merge "ART profiler usage."
* commit 'b94904ab6dfbb9db7e8042f10886042a295857d4':
  ART profiler usage.
2014-03-11 18:51:42 +00:00
Brian Carlstrom
2d0bd7d36b am 485e3b45: am 5c126c3d: Merge "Add dex2oat-flags plumbing to AndroidRuntime"
* commit '485e3b459491267ae1390e1df5ff8f7d4695f819':
  Add dex2oat-flags plumbing to AndroidRuntime
2014-03-11 18:29:52 +00:00
Narayan Kamath
2d895e6344 am 8fb22ae7: am eee2c72f: Merge "Various format string fixes for 64bit"
* commit '8fb22ae772fc62a10db6a06f283140d9233e8704':
  Various format string fixes for 64bit
2014-03-11 18:16:59 +00:00
Narayan Kamath
30420d58e2 am 2525acf5: am e4dae5f2: Merge "AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY"
* commit '2525acf5a9855d748c008268bb26d6f6d5045d84':
  AArch64: Make eglGetDisplay(int) work for EGL_DEFAULT_DISPLAY
2014-03-11 18:16:20 +00:00
Narayan Kamath
b3802a8e23 Remove java.io.tmpdir assignment in AndroidRuntime (again).
This was brought back by a bad merge conflict resolution
in change 0efbd9a463c848118c7685f4bfc8765a82caa761.

Change-Id: I0c7cbe8ee396293619eabf4d0a3c2f06c76bdd6e
2014-03-11 15:02:10 +00:00
Narayan Kamath
3ba975e75d am 7fe5978b: am 2ba70fd4: Merge "Use reinterpret_cast when an integer is cast to a pointer"
* commit '7fe5978bf7c4b473d8f6db5a12cfdcd110511331':
  Use reinterpret_cast when an integer is cast to a pointer
2014-03-11 00:53:11 +00:00
Narayan Kamath
5bf28c1ec8 am a88abfb3: am 6ab07fac: Merge "Use long for pointers in opengl/EGL classes"
* commit 'a88abfb3a5dccdad6210b294843fa2e21a27d378':
  Use long for pointers in opengl/EGL classes
2014-03-11 00:53:08 +00:00
Greg Hackmann
5468a5c117 am 9e413bf4: am bbfc08b3: Merge changes I6d4fdada,Ia34899a4
* commit '9e413bf4e562d98b6efeb157369f152edd5f0261':
  open("/dev/rtc0") failure in AlarmManagerService.setTime() should be non-fatal
  Move time setting code from SystemClock to AlarmManagerService
2014-03-10 18:04:47 +00:00
Brian Carlstrom
98ba7bd5d1 Only pass -Xprofile-* options to ART
Bug: 13391896
Change-Id: I5d6a3b900c9b20f02e1d4ccb73f712e9260c7dfd
2014-03-10 10:22:10 -07:00
Narayan Kamath
6381dd4ff2 LP64: Make 9 patches architecture agnostic.
The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.

These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.

Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.

This change also removed the unused patch_equals function
from aapt's Image.cpp.

Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
2014-03-10 10:00:02 +00:00
Narayan Kamath
6c18e8adf2 am 911b2ce3: am 4a642ee5: Merge "Remove unused JNITest class"
* commit '911b2ce3da7dbd8b6335d1092fc6c9e880147104':
  Remove unused JNITest class
2014-03-08 01:51:43 +00:00
Dave Allison
0efbd9a463 ART profiler usage.
This is a change to add args to some of the profiler related
functions, including installd commands.

Also read properties and set command line options for the runtime
profiling parameters.

Changed calls to isDexOptNeeded() to isDexOptNeededInternal().  This
needs additional arguments passed for profiles.

Bug: 12877748
Change-Id: I1a426c9309d760bac0cf92daa298defee62287c1

Conflicts:
	core/jni/AndroidRuntime.cpp
2014-03-07 12:32:44 -08:00
Narayan Kamath
b2235d5db7 am fca204a4: am 05cebdc2: Merge "Fix several bad function definitions."
* commit 'fca204a4b8771b800383c91465a48eb2cd8b3ba2':
  Fix several bad function definitions.
2014-03-07 19:41:27 +00:00
Narayan Kamath
cde7868356 am b152473f: am 9fce8535: Merge "AArch64: Make AssetAtlasService 64-bit compatible"
* commit 'b152473f46d8176e7eb2c55b54342a7a29c525cf':
  AArch64: Make AssetAtlasService 64-bit compatible
2014-03-07 19:41:24 +00:00
Narayan Kamath
ae69111e23 am 96ddea41: am 7c710936: Merge "Remove java.io.tmpdir assignment in AndroidRuntime."
* commit '96ddea413dcf266d996877d3fc2d81738c5316c8':
  Remove java.io.tmpdir assignment in AndroidRuntime.
2014-03-07 19:40:30 +00:00
Narayan Kamath
d556b42909 am 3bec0fbb: am fa8f95e9: Merge "AArch64: Use long for pointers in SurfaceSession class"
* commit '3bec0fbb349a969934828ee726956877a3a21dee':
  AArch64: Use long for pointers in SurfaceSession class
2014-03-07 19:34:28 +00:00