Skip to content

Commit ee448a9

Browse files
fix(android): set correct class loader on receive rpc resp
1 parent e12f805 commit ee448a9

File tree

26 files changed

+53
-124
lines changed

26 files changed

+53
-124
lines changed

goldenmaster/counter/counter_android_client/src/main/java/counter/counter_android_client/CounterClient.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ public void handleMessage(Message msg)
268268
case RPC_IncrementResp: {
269269

270270
Bundle data = msg.getData();
271-
272-
// all structs (even from other modules) are known at compile time (see gradle files) and share same PathClassLoader, any class loader provides access to it.
273-
data.setClassLoader(externTypes.externTypes_android_messenger.MyVector3DParcelable.class.getClassLoader());
271+
data.setClassLoader(externTypes.externTypes_android_messenger.MyVector3DParcelable.class.getClassLoader());
274272
int callId = data.getInt("callId");
275273

276274
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -288,9 +286,7 @@ public void handleMessage(Message msg)
288286
case RPC_IncrementArrayResp: {
289287

290288
Bundle data = msg.getData();
291-
292-
// all structs (even from other modules) are known at compile time (see gradle files) and share same PathClassLoader, any class loader provides access to it.
293-
data.setClassLoader(externTypes.externTypes_android_messenger.MyVector3DParcelable.class.getClassLoader());
289+
data.setClassLoader(externTypes.externTypes_android_messenger.MyVector3DParcelable.class.getClassLoader());
294290
int callId = data.getInt("callId");
295291

296292
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -308,9 +304,7 @@ public void handleMessage(Message msg)
308304
case RPC_DecrementResp: {
309305

310306
Bundle data = msg.getData();
311-
312-
// all structs (even from other modules) are known at compile time (see gradle files) and share same PathClassLoader, any class loader provides access to it.
313-
data.setClassLoader(customTypes.customTypes_android_messenger.Vector3DParcelable.class.getClassLoader());
307+
data.setClassLoader(customTypes.customTypes_android_messenger.Vector3DParcelable.class.getClassLoader());
314308
int callId = data.getInt("callId");
315309

316310
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -328,9 +322,7 @@ public void handleMessage(Message msg)
328322
case RPC_DecrementArrayResp: {
329323

330324
Bundle data = msg.getData();
331-
332-
// all structs (even from other modules) are known at compile time (see gradle files) and share same PathClassLoader, any class loader provides access to it.
333-
data.setClassLoader(customTypes.customTypes_android_messenger.Vector3DParcelable.class.getClassLoader());
325+
data.setClassLoader(customTypes.customTypes_android_messenger.Vector3DParcelable.class.getClassLoader());
334326
int callId = data.getInt("callId");
335327

336328
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbEnum/tbEnum_android_client/src/main/java/tbEnum/tbEnum_android_client/EnumInterfaceClient.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ public void handleMessage(Message msg)
298298
case RPC_Func0Resp: {
299299

300300
Bundle data = msg.getData();
301-
302-
data.setClassLoader(Enum0Parcelable.class.getClassLoader());
301+
data.setClassLoader(Enum0Parcelable.class.getClassLoader());
303302
int callId = data.getInt("callId");
304303

305304
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -317,8 +316,7 @@ public void handleMessage(Message msg)
317316
case RPC_Func1Resp: {
318317

319318
Bundle data = msg.getData();
320-
321-
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
319+
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
322320
int callId = data.getInt("callId");
323321

324322
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -336,8 +334,7 @@ public void handleMessage(Message msg)
336334
case RPC_Func2Resp: {
337335

338336
Bundle data = msg.getData();
339-
340-
data.setClassLoader(Enum2Parcelable.class.getClassLoader());
337+
data.setClassLoader(Enum2Parcelable.class.getClassLoader());
341338
int callId = data.getInt("callId");
342339

343340
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -355,8 +352,7 @@ public void handleMessage(Message msg)
355352
case RPC_Func3Resp: {
356353

357354
Bundle data = msg.getData();
358-
359-
data.setClassLoader(Enum3Parcelable.class.getClassLoader());
355+
data.setClassLoader(Enum3Parcelable.class.getClassLoader());
360356
int callId = data.getInt("callId");
361357

362358
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbNames/tbNames_android_client/src/main/java/tbNames/tbNames_android_client/NamEsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public void handleMessage(Message msg)
267267
case RPC_SomeFunctionResp: {
268268

269269
Bundle data = msg.getData();
270-
270+
data.setClassLoader(VoidParcelable.class.getClassLoader());
271271
int callId = data.getInt("callId");
272272

273273
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -285,7 +285,7 @@ public void handleMessage(Message msg)
285285
case RPC_SomeFunction2Resp: {
286286

287287
Bundle data = msg.getData();
288-
288+
data.setClassLoader(VoidParcelable.class.getClassLoader());
289289
int callId = data.getInt("callId");
290290

291291
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbRefIfaces/tbRefIfaces_android_client/src/main/java/tbRefIfaces/tbRefIfaces_android_client/ParentIfClient.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ public void handleMessage(Message msg)
295295
case RPC_LocalIfMethodResp: {
296296

297297
Bundle data = msg.getData();
298-
299-
data.setClassLoader(SimpleLocalIfParcelable.class.getClassLoader());
298+
data.setClassLoader(SimpleLocalIfParcelable.class.getClassLoader());
300299
int callId = data.getInt("callId");
301300

302301
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -314,8 +313,7 @@ public void handleMessage(Message msg)
314313
case RPC_LocalIfMethodListResp: {
315314

316315
Bundle data = msg.getData();
317-
318-
data.setClassLoader(SimpleLocalIfParcelable.class.getClassLoader());
316+
data.setClassLoader(SimpleLocalIfParcelable.class.getClassLoader());
319317
int callId = data.getInt("callId");
320318

321319
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -333,9 +331,7 @@ public void handleMessage(Message msg)
333331
case RPC_ImportedIfMethodResp: {
334332

335333
Bundle data = msg.getData();
336-
337-
// all structs (even from other modules) are known at compile time (see gradle files) and share same PathClassLoader, any class loader provides access to it.
338-
data.setClassLoader(tbIfaceimport.tbIfaceimport_android_messenger.EmptyIfParcelable.class.getClassLoader());
334+
data.setClassLoader(tbIfaceimport.tbIfaceimport_android_messenger.EmptyIfParcelable.class.getClassLoader());
339335
int callId = data.getInt("callId");
340336

341337
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -353,9 +349,7 @@ public void handleMessage(Message msg)
353349
case RPC_ImportedIfMethodListResp: {
354350

355351
Bundle data = msg.getData();
356-
357-
// all structs (even from other modules) are known at compile time (see gradle files) and share same PathClassLoader, any class loader provides access to it.
358-
data.setClassLoader(tbIfaceimport.tbIfaceimport_android_messenger.EmptyIfParcelable.class.getClassLoader());
352+
data.setClassLoader(tbIfaceimport.tbIfaceimport_android_messenger.EmptyIfParcelable.class.getClassLoader());
359353
int callId = data.getInt("callId");
360354

361355
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbRefIfaces/tbRefIfaces_android_client/src/main/java/tbRefIfaces/tbRefIfaces_android_client/SimpleLocalIfClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ public void handleMessage(Message msg)
212212
case RPC_IntMethodResp: {
213213

214214
Bundle data = msg.getData();
215-
216215
int callId = data.getInt("callId");
217216

218217
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbSame1/tbSame1_android_client/src/main/java/tbSame1/tbSame1_android_client/SameEnum1InterfaceClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ public void handleMessage(Message msg)
217217
case RPC_Func1Resp: {
218218

219219
Bundle data = msg.getData();
220-
221-
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
220+
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
222221
int callId = data.getInt("callId");
223222

224223
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbSame1/tbSame1_android_client/src/main/java/tbSame1/tbSame1_android_client/SameEnum2InterfaceClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ public void handleMessage(Message msg)
246246
case RPC_Func1Resp: {
247247

248248
Bundle data = msg.getData();
249-
250-
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
249+
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
251250
int callId = data.getInt("callId");
252251

253252
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -265,8 +264,7 @@ public void handleMessage(Message msg)
265264
case RPC_Func2Resp: {
266265

267266
Bundle data = msg.getData();
268-
269-
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
267+
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
270268
int callId = data.getInt("callId");
271269

272270
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbSame1/tbSame1_android_client/src/main/java/tbSame1/tbSame1_android_client/SameStruct1InterfaceClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ public void handleMessage(Message msg)
217217
case RPC_Func1Resp: {
218218

219219
Bundle data = msg.getData();
220-
221-
data.setClassLoader(Struct1Parcelable.class.getClassLoader());
220+
data.setClassLoader(Struct1Parcelable.class.getClassLoader());
222221
int callId = data.getInt("callId");
223222

224223
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbSame1/tbSame1_android_client/src/main/java/tbSame1/tbSame1_android_client/SameStruct2InterfaceClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ public void handleMessage(Message msg)
246246
case RPC_Func1Resp: {
247247

248248
Bundle data = msg.getData();
249-
250-
data.setClassLoader(Struct1Parcelable.class.getClassLoader());
249+
data.setClassLoader(Struct1Parcelable.class.getClassLoader());
251250
int callId = data.getInt("callId");
252251

253252
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);
@@ -265,8 +264,7 @@ public void handleMessage(Message msg)
265264
case RPC_Func2Resp: {
266265

267266
Bundle data = msg.getData();
268-
269-
data.setClassLoader(Struct1Parcelable.class.getClassLoader());
267+
data.setClassLoader(Struct1Parcelable.class.getClassLoader());
270268
int callId = data.getInt("callId");
271269

272270
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

goldenmaster/tbSame2/tbSame2_android_client/src/main/java/tbSame2/tbSame2_android_client/SameEnum1InterfaceClient.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ public void handleMessage(Message msg)
217217
case RPC_Func1Resp: {
218218

219219
Bundle data = msg.getData();
220-
221-
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
220+
data.setClassLoader(Enum1Parcelable.class.getClassLoader());
222221
int callId = data.getInt("callId");
223222

224223
Consumer<Bundle> foundCall = mpendingCalls.remove(callId);

0 commit comments

Comments
 (0)