Commit graph

39 commits

Author SHA1 Message Date
Andreas Gampe
e2452b4bf3 LibNativeBridge: Version 2
Add a callback function to retrieve "signal handler" from the bridge,
if the bridge wants it to be managed by the runtime. The signal handler
will be invoked after the runtime's own one, and before any other
chained handler.

Add a callback function to check compatibility of the bridge with the
library.

Add a function to expose the native bridge version. Add a test for this
function.

Bug: 20217701

(cherry picked from commit a6ac9ce98b)

Change-Id: Ic23a60b949f119c7d8b0e7cb27a61e6c16532a23
2015-05-31 16:58:24 -07:00
Narayan Kamath
851f3aa51c am 0d385d1c: Merge "Track renaming of initUnchangeableSystemProperty."
* commit '0d385d1c625a5ef3ffdeab3f63a2171eecbb1e44':
  Track renaming of initUnchangeableSystemProperty.
2015-02-10 16:54:35 +00:00
Narayan Kamath
484c55b37f Track renaming of initUnchangeableSystemProperty.
It's now setUnchangeableSystemProperty.

Change-Id: Ib42f8ac9f074230dfb7af2eb633e0a536ab7d4b7
2015-02-10 15:43:41 +00:00
Nick Kralevich
1935663248 am 24dfaac4: am c6dead70: Merge "maybe fix mac build"
* commit '24dfaac494de3a31e1cd106becc2b2ad38e13bbe':
  maybe fix mac build
2014-11-02 14:32:19 +00:00
Nick Kralevich
24dfaac494 am c6dead70: Merge "maybe fix mac build"
* commit 'c6dead707de7c03bd9759b61143dd33cb1435cbc':
  maybe fix mac build
2014-11-02 14:25:08 +00:00
Nick Kralevich
bcd1a834d4 maybe fix mac build
system/core/libnativebridge/tests/CodeCacheExists_test.cpp:30:15: error:  use of undeclared identifier 'ENOENT'
      ASSERT_EQ(ENOENT, errno);

Change-Id: I188074b878a7ec3955a9f4b5dc7d1bfc56e2ccbc
2014-11-02 06:13:53 -08:00
Calin Juravle
792e269127 resolved conflicts for merge of 7a1abfe3 to lmp-mr1-dev-plus-aosp
Change-Id: Ie5db9f745e01bd24faa317af0cd8874e1099ebdf
2014-10-29 19:51:04 +00:00
Calin Juravle
83c29aea2f resolved conflicts for merge of 4de4e6de to lmp-mr1-dev-plus-aosp
Change-Id: Ie5c1c814ccd819a592d834879173edb8af15a52d
2014-10-29 17:32:31 +00:00
Calin Juravle
7a1abfe3b5 am 64989126: Merge "Add code cache tests to libnativebridge."
* commit '649891267f3b0db1c6c37152fc570a4824d6aa39':
  Add code cache tests to libnativebridge.
2014-10-29 12:32:21 +00:00
Narayan Kamath
182f33db82 am 8cf2ce10: Merge "Don\'t allow SUPPORTED_ABIs to be set by the native bridge."
* commit '8cf2ce1064847d5fed0ec728ef6e916e238767c0':
  Don't allow SUPPORTED_ABIs to be set by the native bridge.
2014-10-28 19:28:30 +00:00
Calin Juravle
4de4e6defc resolved conflicts for merge of e3c22c41 to stage-aosp-master
Change-Id: I566aeb2e2de15813ee199d4635098029457fdf3d
2014-10-28 19:09:50 +00:00
Calin Juravle
9ef4fa4c2c Add code cache tests to libnativebridge.
Bug: 18027433

(cherry picked from commit 59a719c466)

Change-Id: I32bcf3ae0d4569d4d8b88168e6c36ddff70b8f7d
2014-10-28 16:06:43 +00:00
Calin Juravle
649891267f Merge "Add code cache tests to libnativebridge." 2014-10-28 16:06:15 +00:00
Calin Juravle
59a719c466 Add code cache tests to libnativebridge.
Bug: 18027433
Change-Id: Ie5369c0d5bd147af412174dc0753d8a314196643
2014-10-28 16:02:38 +00:00
Narayan Kamath
8cf2ce1064 Merge "Don't allow SUPPORTED_ABIs to be set by the native bridge." 2014-10-27 16:16:02 +00:00
Calin Juravle
1402fbb135 Handle code_cache dir creation in libnativebridge
Also:

- add kPreInitiliazed state to native bridge with check transition:
kOpened->kPreInitialized->kInitialized
- made sure we free the memory for the code_cache_path
- tidy up some error messages
- tidy up tests
- add a dummy native bridge to test with

Bug: 18027433
Bug: 18097480

(cherry picked from commit f9d9e2a2d9)

Change-Id: I9ce578949dbe522d5033465df7ca49fdd3aa3cbf
2014-10-27 15:37:32 +00:00
Calin Juravle
f9d9e2a2d9 Handle code_cache dir creation in libnativebridge
Also:

- add kPreInitiliazed state to native bridge with check transition:
kOpened->kPreInitialized->kInitialized
- made sure we free the memory for the code_cache_path
- tidy up some error messages
- tidy up tests
- add a dummy native bridge to test with

Bug: 18027433
Bug: 18097480

Change-Id: I39f74c93580f2e224080dd3df2ffaa9cf9f8cd9c
2014-10-27 15:03:13 +00:00
Narayan Kamath
dd22aeff73 Don't allow SUPPORTED_ABIs to be set by the native bridge.
SUPPORTED_ABIs is a prioritized list of all ABIs a device
support, and must not vary depending on whether or not an app
is emulated.

bug: 18061712

(cherry picked from commit 66f0d93c26)

Change-Id: I99cea3a56228dac43ae310c295881881e5a77c31
2014-10-22 18:56:32 +01:00
Narayan Kamath
66f0d93c26 Don't allow SUPPORTED_ABIs to be set by the native bridge.
SUPPORTED_ABIs is a prioritized list of all ABIs a device
support, and must not vary depending on whether or not an app
is emulated.

bug: 18061712
Change-Id: I3ec3897d23e37c645b4d9d9e6e32aae9afff952c
2014-10-21 18:33:27 +01:00
Calin Juravle
c3eb4314b7 Use initUnchangeableSystemProperty for initializing os.arch.
Bug: 17713104

(cherry picked from commit 00851a53be)

Change-Id: Ibddc535248a10e3534586eafb76c074332e025c4
2014-10-01 21:16:16 +01:00
Calin Juravle
00851a53be Use initUnchangeableSystemProperty for initializing os.arch.
Bug: 17713104
Change-Id: Ic847579981efcd2fd0526c994d786ee8b7a8a316
2014-10-01 18:57:59 +01:00
Calin Juravle
c00994df05 Fix mac build for nativebridge tests.
Bug: 17671501

(cherry picked from commit 2e5e8cc92081da6b0af658d12a60334acea441a1)

Change-Id: Id0d729a25a5cea2fed5005cdea750e9e94f46d21
2014-09-29 07:58:15 -07:00
Calin Juravle
7e5a0aca2c Fix mac build for nativebridge tests.
Bug: 17671501

Change-Id: Id0d729a25a5cea2fed5005cdea750e9e94f46d21
2014-09-29 15:57:43 +01:00
jgu21
b3facbfdec LibNativeBridge: Add early init & env setup
Add a method to set up /proc/cpuinfo with enough privileges. Set
up the environment for an app in InitializeNativeBridge().

Turn on -Wall for libnativebridge.

(cherry picked from commit 962eb40abb)
(cherry picked from commit ab0da5a9a6)
(cherry picked from commit 2f71cb24fa)
(cherry picked from commit 04054e28e2)
(cherry picked from commit 4390a63236)

Bug: 17671501
Change-Id: Id4f4127d82737b5e56a77175e1068ff5cea60f9d
2014-09-26 13:04:36 -07:00
Andreas Gampe
04054e28e2 LibNativeBridge: Add testing
Change PreInitializeNativeBridge to have a different path for
the host to allow testing. Add a test (needs root privileges).

Add a test for NeedsNativeBridge.

Change error reporting to use strerror.

Change-Id: Id2d488f0484ff8b0438863b48ef43770e784505f
2014-09-25 23:18:31 -07:00
Andreas Gampe
2f71cb24fa LibNativeBridge: Fix two bugs
Instruction set comparison must include the termination character
so that prefixes are not identified as equal.

Mount argument order was wrong.

Change-Id: Ib70e36ce2ea5af158ebc9d7fafd00e978348d73d
2014-09-25 21:34:25 -07:00
Andreas Gampe
25bacb3ab7 Revert "DO NOT MERGE Libnativebridge: Temporarily change back to late dlopen"
This reverts commit f00de413ed.

Bug: 17645833
Change-Id: Ie5480de9cf4da2c9167db2e6137679019a29f867
2014-09-25 21:46:56 +00:00
Andreas Gampe
4390a63236 LibNativeBridge: Fix mac build warning
Change-Id: I5a819cb5edb064b8a7288b5f2b3100c515421adf
2014-09-24 20:14:28 -07:00
Andreas Gampe
962eb40abb LibNativeHelper: No bind mount on mac
Cannot bind-mount /proc/cpuinfo on the mac.

Change-Id: Id5f0cd46ba0eba484477c56bbecf14d95e88d6f2
2014-09-24 16:36:17 -07:00
jgu21
ab0da5a9a6 LibNativeBridge: Add early init & env setup
Add a method to set up /proc/cpuinfo with enough privileges. Set
up the environment for an app in InitializeNativeBridge().

Turn on -Wall for libnativebridge.

Change-Id: I0b93da93251c6b4638de786bf98cf99df07c3fc2
2014-09-23 20:08:25 -07:00
Andreas Gampe
f00de413ed DO NOT MERGE Libnativebridge: Temporarily change back to late dlopen
Bug: 17440362
Change-Id: Ifceeecd39d4ffd948f62212ebb5280ebec9bf6ff
2014-09-10 05:09:21 +00:00
Andreas Gampe
41df668c7b NativeBridge: Refactor for new initialization flow
Setup becomes Load, have explicit Initialize and Unload.

(cherry picked from commit 035bd7541e)

Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
2014-09-08 11:12:13 -07:00
Andreas Gampe
035bd7541e NativeBridge: Refactor for new initialization flow
Setup becomes Load, have explicit Initialize and Unload.

Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
2014-09-04 12:57:54 -07:00
Andreas Gampe
049249ce7a NativeBridge: Tighten security on libnativebridge
Do not allow arbitrary paths for the native bridge - only allow
simple names.

Do not allow re-setup of the native bridge.

Bug: 16404669

(cherry picked from commit cd2ef4c1af)

Change-Id: Ie22de356d2307fe2758f9094a85d44e61a4098a1
2014-08-22 01:44:06 -07:00
Andreas Gampe
cd2ef4c1af NativeBridge: Tighten security on libnativebridge
Do not allow arbitrary paths for the native bridge - only allow
simple names.

Do not allow re-setup of the native bridge.

Bug: 16404669
Change-Id: Ie22de356d2307fe2758f9094a85d44e61a4098a1
2014-08-21 14:33:44 -07:00
Calin Juravle
db2127b662 Switch libnativebridge to clang
This fixes the mac build.

(cherry picked from commit 935708be6f)

Change-Id: I246a1c0af2124ed1cec653f2f44ca256f26534ff
2014-08-18 11:05:26 +01:00
Calin Juravle
935708be6f Switch libnativebridge to clang
This fixes the mac build.

Change-Id: Icaca0e3bb959072633caf6bfad828a429ff71140
2014-08-15 18:48:53 +01:00
Calin Juravle
4914fcd91b Move native bridge library in system/core
Bug: 16884833

(cherry picked from commit 961ae12dea)

Change-Id: I67f037ea81d2a4ede4294afd8b84b7640e534a13
2014-08-15 12:40:45 +01:00
Calin Juravle
961ae12dea Move native bridge library in system/core
Bug: 16884833

Change-Id: I73aab8e212860ba5aee9444d801806d3da326a41
2014-08-12 22:39:25 +01:00