Commit b5d1639
Make signal callbacks work similar as regular callbacks in JNI (#8048)
**Reason**
- Emitting on the signal generated with bindgen didn't work while
scheduling with the scheduler from C++. It happened that on activation
we tried to findClass using the `attachedEnv` which had different
classLoader due to the fact it was called from C++ context and callback
class couldn't be resolved. Which menat that if a schedule emission from
different thread JNI silently crashed
**Content**
- Make signal to generate callback the similar way we generate the
callbacks for `callback` type, meaning that instead of retrieving the
callback class dynamically when the callback invoked we store the
callback objects class as static ref
- We statically store this class metadata only one and it's unique per
type not per instance, so it's accepatable overhead, following the
regular callbacks patter
cc @mapbox/nav-core-sdk
cc @mapbox/core-sdk
cc @mapbox/gl-native
cc @mapbox/maps-android
GitOrigin-RevId: b8eefe5c0beec056dd3474c628986ff4803803c61 parent 7abf366 commit b5d1639
File tree
1 file changed
+8
-9
lines changed- app/src/main/java/com/mapbox/maps/testapp/examples
1 file changed
+8
-9
lines changedLines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 42 | | |
47 | 43 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 44 | + | |
| 45 | + | |
51 | 46 | | |
52 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| 56 | + | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
0 commit comments