Lines Matching refs:c
185 static string GetFlagFor(const CodeGeneratorContext& c) { in GetFlagFor() argument
186 if (c.is_return_value) { in GetFlagFor()
193 bool WriteToParcelFor(const CodeGeneratorContext& c) { in WriteToParcelFor() argument
196 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
197 c.writer << c.parcel << ".writeInt(((" << c.var << ")?(1):(0)));\n"; in WriteToParcelFor()
200 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
201 c.writer << c.parcel << ".writeBooleanArray(" << c.var << ");\n"; in WriteToParcelFor()
204 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
205 c.writer << c.parcel << ".writeByte(" << c.var << ");\n"; in WriteToParcelFor()
208 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
209 c.writer << c.parcel << ".writeByteArray(" << c.var << ");\n"; in WriteToParcelFor()
212 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
213 c.writer << c.parcel << ".writeInt(((int)" << c.var << "));\n"; in WriteToParcelFor()
216 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
217 c.writer << c.parcel << ".writeCharArray(" << c.var << ");\n"; in WriteToParcelFor()
220 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
221 c.writer << c.parcel << ".writeInt(" << c.var << ");\n"; in WriteToParcelFor()
224 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
225 c.writer << c.parcel << ".writeIntArray(" << c.var << ");\n"; in WriteToParcelFor()
228 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
229 c.writer << c.parcel << ".writeLong(" << c.var << ");\n"; in WriteToParcelFor()
232 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
233 c.writer << c.parcel << ".writeLongArray(" << c.var << ");\n"; in WriteToParcelFor()
236 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
237 c.writer << c.parcel << ".writeFloat(" << c.var << ");\n"; in WriteToParcelFor()
240 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
241 c.writer << c.parcel << ".writeFloatArray(" << c.var << ");\n"; in WriteToParcelFor()
244 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
245 c.writer << c.parcel << ".writeDouble(" << c.var << ");\n"; in WriteToParcelFor()
248 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
249 c.writer << c.parcel << ".writeDoubleArray(" << c.var << ");\n"; in WriteToParcelFor()
252 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
253 c.writer << c.parcel << ".writeString(" << c.var << ");\n"; in WriteToParcelFor()
256 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
257 c.writer << c.parcel << ".writeStringArray(" << c.var << ");\n"; in WriteToParcelFor()
260 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
261 if (c.type.IsGeneric()) { in WriteToParcelFor()
262 const string& contained_type = c.type.GetTypeParameters().at(0)->GetName(); in WriteToParcelFor()
265 c.writer << c.parcel << ".writeStringList(" << c.var << ");\n"; in WriteToParcelFor()
267 c.writer << c.parcel << ".writeBinderList(" << c.var << ");\n"; in WriteToParcelFor()
270 const AidlDefinedType* t = c.typenames.TryGetDefinedType(contained_type); in WriteToParcelFor()
273 c.writer << c.parcel << ".writeTypedList(" << c.var << ");\n"; in WriteToParcelFor()
277 c.writer << c.parcel << ".writeList(" << c.var << ");\n"; in WriteToParcelFor()
281 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
282 if (c.type.IsGeneric()) { in WriteToParcelFor()
283 c.writer << "if (" << c.var << " == null) {\n"; in WriteToParcelFor()
284 c.writer.Indent(); in WriteToParcelFor()
285 c.writer << c.parcel << ".writeInt(-1);\n"; in WriteToParcelFor()
286 c.writer.Dedent(); in WriteToParcelFor()
287 c.writer << "} else {\n"; in WriteToParcelFor()
288 c.writer.Indent(); in WriteToParcelFor()
289 c.writer << c.parcel << ".writeInt(" << c.var << ".size());\n"; in WriteToParcelFor()
290 c.writer << c.var << ".forEach((k, v) -> {\n"; in WriteToParcelFor()
291 c.writer.Indent(); in WriteToParcelFor()
292 c.writer << c.parcel << ".writeString(k);\n"; in WriteToParcelFor()
295 c.writer, in WriteToParcelFor()
296 c.typenames, in WriteToParcelFor()
297 *c.type.GetTypeParameters()[1].get(), in WriteToParcelFor()
298 c.parcel, in WriteToParcelFor()
300 c.is_return_value, in WriteToParcelFor()
301 c.is_classloader_created, in WriteToParcelFor()
302 c.filename, in WriteToParcelFor()
305 c.writer.Dedent(); in WriteToParcelFor()
306 c.writer << "});\n"; in WriteToParcelFor()
308 c.writer.Dedent(); in WriteToParcelFor()
309 c.writer << "}\n"; in WriteToParcelFor()
311 c.writer << c.parcel << ".writeMap(" << c.var << ");\n"; in WriteToParcelFor()
315 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
316 c.writer << c.parcel << ".writeStrongBinder(" << c.var << ");\n"; in WriteToParcelFor()
319 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
320 c.writer << c.parcel << ".writeBinderArray(" << c.var << ");\n"; in WriteToParcelFor()
323 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
324 c.writer << c.parcel << ".writeRawFileDescriptor(" << c.var << ");\n"; in WriteToParcelFor()
327 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
328 c.writer << c.parcel << ".writeRawFileDescriptorArray(" << c.var << ");\n"; in WriteToParcelFor()
331 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
334 c.writer << "if ((" << c.var << "!=null)) {\n"; in WriteToParcelFor()
335 c.writer.Indent(); in WriteToParcelFor()
336 c.writer << c.parcel << ".writeInt(1);\n"; in WriteToParcelFor()
337 c.writer << c.var << ".writeToParcel(" << c.parcel << ", " << GetFlagFor(c) << ");\n"; in WriteToParcelFor()
338 c.writer.Dedent(); in WriteToParcelFor()
339 c.writer << "}\n"; in WriteToParcelFor()
340 c.writer << "else {\n"; in WriteToParcelFor()
341 c.writer.Indent(); in WriteToParcelFor()
342 c.writer << c.parcel << ".writeInt(0);\n"; in WriteToParcelFor()
343 c.writer.Dedent(); in WriteToParcelFor()
344 c.writer << "}\n"; in WriteToParcelFor()
347 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
348 c.writer << c.parcel << ".writeTypedArray(" << c.var << ", " << GetFlagFor(c) << ");\n"; in WriteToParcelFor()
351 [](const CodeGeneratorContext& c) { in WriteToParcelFor() argument
354 c.writer << "if (" << c.var << "!=null) {\n"; in WriteToParcelFor()
355 c.writer.Indent(); in WriteToParcelFor()
356 c.writer << c.parcel << ".writeInt(1);\n"; in WriteToParcelFor()
357 c.writer << "android.text.TextUtils.writeToParcel(" << c.var << ", " << c.parcel << ", " in WriteToParcelFor()
358 << GetFlagFor(c) << ");\n"; in WriteToParcelFor()
359 c.writer.Dedent(); in WriteToParcelFor()
360 c.writer << "}\n"; in WriteToParcelFor()
361 c.writer << "else {\n"; in WriteToParcelFor()
362 c.writer.Indent(); in WriteToParcelFor()
363 c.writer << c.parcel << ".writeInt(0);\n"; in WriteToParcelFor()
364 c.writer.Dedent(); in WriteToParcelFor()
365 c.writer << "}\n"; in WriteToParcelFor()
368 const string type_name = AidlBackingTypeName(c.type, c.typenames); in WriteToParcelFor()
371 found->second(c); in WriteToParcelFor()
373 const AidlDefinedType* t = c.typenames.TryGetDefinedType(c.type.GetName()); in WriteToParcelFor()
374 CHECK(t != nullptr) << "Unknown type: " << c.type.GetName() << endl; in WriteToParcelFor()
376 if (!c.type.IsArray()) { in WriteToParcelFor()
379 c.writer << c.parcel << ".writeStrongBinder((((" << c.var << "!=null))?" in WriteToParcelFor()
380 << "(" << c.var << ".asBinder()):(null)));\n"; in WriteToParcelFor()
383 if (c.type.IsArray()) { in WriteToParcelFor()
384 c.writer << c.parcel << ".writeTypedArray(" << c.var << ", " << GetFlagFor(c) << ");\n"; in WriteToParcelFor()
388 c.writer << "if ((" << c.var << "!=null)) {\n"; in WriteToParcelFor()
389 c.writer.Indent(); in WriteToParcelFor()
390 c.writer << c.parcel << ".writeInt(1);\n"; in WriteToParcelFor()
391 c.writer << c.var << ".writeToParcel(" << c.parcel << ", " << GetFlagFor(c) << ");\n"; in WriteToParcelFor()
392 c.writer.Dedent(); in WriteToParcelFor()
393 c.writer << "}\n"; in WriteToParcelFor()
394 c.writer << "else {\n"; in WriteToParcelFor()
395 c.writer.Indent(); in WriteToParcelFor()
396 c.writer << c.parcel << ".writeInt(0);\n"; in WriteToParcelFor()
397 c.writer.Dedent(); in WriteToParcelFor()
398 c.writer << "}\n"; in WriteToParcelFor()
407 static string EnsureAndGetClassloader(CodeGeneratorContext& c) { in EnsureAndGetClassloader() argument
408 CHECK(c.is_classloader_created != nullptr); in EnsureAndGetClassloader()
409 if (!*(c.is_classloader_created)) { in EnsureAndGetClassloader()
410 c.writer << "java.lang.ClassLoader cl = " in EnsureAndGetClassloader()
412 *(c.is_classloader_created) = true; in EnsureAndGetClassloader()
417 bool CreateFromParcelFor(const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
420 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
421 c.writer << c.var << " = (0!=" << c.parcel << ".readInt());\n"; in CreateFromParcelFor()
424 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
425 c.writer << c.var << " = " << c.parcel << ".createBooleanArray();\n"; in CreateFromParcelFor()
428 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
429 c.writer << c.var << " = " << c.parcel << ".readByte();\n"; in CreateFromParcelFor()
432 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
433 c.writer << c.var << " = " << c.parcel << ".createByteArray();\n"; in CreateFromParcelFor()
436 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
437 c.writer << c.var << " = (char)" << c.parcel << ".readInt();\n"; in CreateFromParcelFor()
440 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
441 c.writer << c.var << " = " << c.parcel << ".createCharArray();\n"; in CreateFromParcelFor()
444 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
445 c.writer << c.var << " = " << c.parcel << ".readInt();\n"; in CreateFromParcelFor()
448 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
449 c.writer << c.var << " = " << c.parcel << ".createIntArray();\n"; in CreateFromParcelFor()
452 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
453 c.writer << c.var << " = " << c.parcel << ".readLong();\n"; in CreateFromParcelFor()
456 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
457 c.writer << c.var << " = " << c.parcel << ".createLongArray();\n"; in CreateFromParcelFor()
460 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
461 c.writer << c.var << " = " << c.parcel << ".readFloat();\n"; in CreateFromParcelFor()
464 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
465 c.writer << c.var << " = " << c.parcel << ".createFloatArray();\n"; in CreateFromParcelFor()
468 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
469 c.writer << c.var << " = " << c.parcel << ".readDouble();\n"; in CreateFromParcelFor()
472 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
473 c.writer << c.var << " = " << c.parcel << ".createDoubleArray();\n"; in CreateFromParcelFor()
476 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
477 c.writer << c.var << " = " << c.parcel << ".readString();\n"; in CreateFromParcelFor()
480 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
481 c.writer << c.var << " = " << c.parcel << ".createStringArray();\n"; in CreateFromParcelFor()
484 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
485 if (c.type.IsGeneric()) { in CreateFromParcelFor()
486 const string& contained_type = c.type.GetTypeParameters().at(0)->GetName(); in CreateFromParcelFor()
489 c.writer << c.var << " = " << c.parcel << ".createStringArrayList();\n"; in CreateFromParcelFor()
491 c.writer << c.var << " = " << c.parcel << ".createBinderArrayList();\n"; in CreateFromParcelFor()
494 const AidlDefinedType* t = c.typenames.TryGetDefinedType(contained_type); in CreateFromParcelFor()
497 c.writer << c.var << " = " << c.parcel << ".createTypedArrayList(" in CreateFromParcelFor()
498 << JavaNameOf(*(c.type.GetTypeParameters().at(0)), c.typenames) in CreateFromParcelFor()
503 const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c)); in CreateFromParcelFor()
504 c.writer << c.var << " = " << c.parcel << ".readArrayList(" << classloader << ");\n"; in CreateFromParcelFor()
508 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
509 if (c.type.IsGeneric()) { in CreateFromParcelFor()
510 c.writer << "{\n"; in CreateFromParcelFor()
511 c.writer.Indent(); in CreateFromParcelFor()
512 c.writer << "int N = " << c.parcel << ".readInt();\n"; in CreateFromParcelFor()
513 c.writer << c.var << " = N < 0 ? null : new java.util.HashMap<>();\n"; in CreateFromParcelFor()
515 auto creator = JavaNameOf(*(c.type.GetTypeParameters().at(1)), c.typenames) + ".CREATOR"; in CreateFromParcelFor()
516 c.writer << "java.util.stream.IntStream.range(0, N).forEach(i -> {\n"; in CreateFromParcelFor()
517 c.writer.Indent(); in CreateFromParcelFor()
518 c.writer << "String k = " << c.parcel << ".readString();\n"; in CreateFromParcelFor()
519 c.writer << JavaNameOf(*(c.type.GetTypeParameters().at(1)), c.typenames) << " v;\n"; in CreateFromParcelFor()
521 c.writer, in CreateFromParcelFor()
522 c.typenames, in CreateFromParcelFor()
523 *c.type.GetTypeParameters()[1].get(), in CreateFromParcelFor()
524 c.parcel, in CreateFromParcelFor()
526 c.is_return_value, in CreateFromParcelFor()
527 c.is_classloader_created, in CreateFromParcelFor()
528 c.filename, in CreateFromParcelFor()
531 c.writer << c.var << ".put(k, v);\n"; in CreateFromParcelFor()
533 c.writer.Dedent(); in CreateFromParcelFor()
534 c.writer << "});\n"; in CreateFromParcelFor()
536 c.writer.Dedent(); in CreateFromParcelFor()
537 c.writer << "}\n"; in CreateFromParcelFor()
539 const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c)); in CreateFromParcelFor()
540 c.writer << c.var << " = " << c.parcel << ".readHashMap(" << classloader << ");\n"; in CreateFromParcelFor()
544 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
545 c.writer << c.var << " = " << c.parcel << ".readStrongBinder();\n"; in CreateFromParcelFor()
548 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
549 c.writer << c.var << " = " << c.parcel << ".createBinderArray();\n"; in CreateFromParcelFor()
552 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
553 c.writer << c.var << " = " << c.parcel << ".readRawFileDescriptor();\n"; in CreateFromParcelFor()
556 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
557 c.writer << c.var << " = " << c.parcel << ".createRawFileDescriptorArray();\n"; in CreateFromParcelFor()
560 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
563 c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n"; in CreateFromParcelFor()
564 c.writer.Indent(); in CreateFromParcelFor()
565 …c.writer << c.var << " = " << "android.os.ParcelFileDescriptor.CREATOR.createFromParcel(" << c.par… in CreateFromParcelFor()
567 c.writer.Dedent(); in CreateFromParcelFor()
568 c.writer << "}\n"; in CreateFromParcelFor()
569 c.writer << "else {\n"; in CreateFromParcelFor()
570 c.writer.Indent(); in CreateFromParcelFor()
571 c.writer << c.var << " = null;\n"; in CreateFromParcelFor()
572 c.writer.Dedent(); in CreateFromParcelFor()
573 c.writer << "}\n"; in CreateFromParcelFor()
576 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
577 c.writer << c.var << " = " << c.parcel in CreateFromParcelFor()
581 [](const CodeGeneratorContext& c) { in CreateFromParcelFor() argument
583 c.writer << "if (0!=" << c.parcel << ".readInt()) {\n"; in CreateFromParcelFor()
584 c.writer.Indent(); in CreateFromParcelFor()
585 c.writer << c.var << " = android.text.TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(" in CreateFromParcelFor()
586 << c.parcel << ");\n"; in CreateFromParcelFor()
587 c.writer.Dedent(); in CreateFromParcelFor()
588 c.writer << "}\n"; in CreateFromParcelFor()
589 c.writer << "else {\n"; in CreateFromParcelFor()
590 c.writer.Indent(); in CreateFromParcelFor()
591 c.writer << c.var << " = null;\n"; in CreateFromParcelFor()
592 c.writer.Dedent(); in CreateFromParcelFor()
593 c.writer << "}\n"; in CreateFromParcelFor()
596 const auto found = method_map.find(AidlBackingTypeName(c.type, c.typenames)); in CreateFromParcelFor()
598 found->second(c); in CreateFromParcelFor()
600 const AidlDefinedType* t = c.typenames.TryGetDefinedType(c.type.GetName()); in CreateFromParcelFor()
601 CHECK(t != nullptr) << "Unknown type: " << c.type.GetName() << endl; in CreateFromParcelFor()
603 if (!c.type.IsArray()) { in CreateFromParcelFor()
604 c.writer << c.var << " = " << c.type.GetName() << ".Stub.asInterface(" << c.parcel in CreateFromParcelFor()
608 if (c.type.IsArray()) { in CreateFromParcelFor()
609 c.writer << c.var << " = " << c.parcel << ".createTypedArray(" in CreateFromParcelFor()
610 << JavaNameOf(c.type, c.typenames) << ".CREATOR);\n"; in CreateFromParcelFor()
614 c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n"; in CreateFromParcelFor()
615 c.writer.Indent(); in CreateFromParcelFor()
616 c.writer << c.var << " = " << c.type.GetName() << ".CREATOR.createFromParcel(" << c.parcel in CreateFromParcelFor()
618 c.writer.Dedent(); in CreateFromParcelFor()
619 c.writer << "}\n"; in CreateFromParcelFor()
620 c.writer << "else {\n"; in CreateFromParcelFor()
621 c.writer.Indent(); in CreateFromParcelFor()
622 c.writer << c.var << " = null;\n"; in CreateFromParcelFor()
623 c.writer.Dedent(); in CreateFromParcelFor()
624 c.writer << "}\n"; in CreateFromParcelFor()
631 bool ReadFromParcelFor(const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
634 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
635 c.writer << c.parcel << ".readBooleanArray(" << c.var << ");\n"; in ReadFromParcelFor()
638 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
639 c.writer << c.parcel << ".readByteArray(" << c.var << ");\n"; in ReadFromParcelFor()
642 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
643 c.writer << c.parcel << ".readCharArray(" << c.var << ");\n"; in ReadFromParcelFor()
646 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
647 c.writer << c.parcel << ".readIntArray(" << c.var << ");\n"; in ReadFromParcelFor()
650 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
651 c.writer << c.parcel << ".readLongArray(" << c.var << ");\n"; in ReadFromParcelFor()
654 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
655 c.writer << c.parcel << ".readFloatArray(" << c.var << ");\n"; in ReadFromParcelFor()
658 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
659 c.writer << c.parcel << ".readDoubleArray(" << c.var << ");\n"; in ReadFromParcelFor()
662 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
663 c.writer << c.parcel << ".readStringArray(" << c.var << ");\n"; in ReadFromParcelFor()
666 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
667 if (c.type.IsGeneric()) { in ReadFromParcelFor()
668 const string& contained_type = c.type.GetTypeParameters().at(0)->GetName(); in ReadFromParcelFor()
671 c.writer << c.parcel << ".readStringList(" << c.var << ");\n"; in ReadFromParcelFor()
673 c.writer << c.parcel << ".readBinderList(" << c.var << ");\n"; in ReadFromParcelFor()
676 const AidlDefinedType* t = c.typenames.TryGetDefinedType(contained_type); in ReadFromParcelFor()
679 c.writer << c.parcel << ".readTypedList(" << c.var << ", " in ReadFromParcelFor()
680 << JavaNameOf(*(c.type.GetTypeParameters().at(0)), c.typenames) in ReadFromParcelFor()
685 const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c)); in ReadFromParcelFor()
686 c.writer << c.parcel << ".readList(" << c.var << ", " << classloader << ");\n"; in ReadFromParcelFor()
690 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
691 if (c.type.IsGeneric()) { in ReadFromParcelFor()
692 c.writer << "if (" << c.var << " != null) " << c.var << ".clear();\n"; in ReadFromParcelFor()
693 c.writer << "java.util.stream.IntStream.range(0, " << c.parcel in ReadFromParcelFor()
695 c.writer.Indent(); in ReadFromParcelFor()
696 c.writer << "String k = " << c.parcel << ".readString();\n"; in ReadFromParcelFor()
697 c.writer << JavaNameOf(*(c.type.GetTypeParameters().at(1)), c.typenames) << " v;\n"; in ReadFromParcelFor()
699 c.writer, in ReadFromParcelFor()
700 c.typenames, in ReadFromParcelFor()
701 *c.type.GetTypeParameters()[1].get(), in ReadFromParcelFor()
702 c.parcel, in ReadFromParcelFor()
704 c.is_return_value, in ReadFromParcelFor()
705 c.is_classloader_created, in ReadFromParcelFor()
706 c.filename, in ReadFromParcelFor()
709 c.writer << c.var << ".put(k, v);\n"; in ReadFromParcelFor()
711 c.writer.Dedent(); in ReadFromParcelFor()
712 c.writer << "});\n"; in ReadFromParcelFor()
714 c.writer.Dedent(); in ReadFromParcelFor()
715 c.writer << "}\n"; in ReadFromParcelFor()
717 const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c)); in ReadFromParcelFor()
718 c.writer << c.var << " = " << c.parcel << ".readHashMap(" << classloader << ");\n"; in ReadFromParcelFor()
722 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
723 c.writer << c.var << " = " << c.parcel << ".createBinderArray();\n"; in ReadFromParcelFor()
726 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
727 c.writer << c.var << " = " << c.parcel << ".createRawFileDescriptorArray();\n"; in ReadFromParcelFor()
730 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
731 c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n"; in ReadFromParcelFor()
732 c.writer.Indent(); in ReadFromParcelFor()
733 …c.writer << c.var << " = " << "android.os.ParcelFileDescriptor.CREATOR.createFromParcel(" << c.par… in ReadFromParcelFor()
734 c.writer.Dedent(); in ReadFromParcelFor()
735 c.writer << "}\n"; in ReadFromParcelFor()
738 [](const CodeGeneratorContext& c) { in ReadFromParcelFor() argument
739 c.writer << c.parcel << ".readTypedArray(" << c.var in ReadFromParcelFor()
743 const auto& found = method_map.find(AidlBackingTypeName(c.type, c.typenames)); in ReadFromParcelFor()
745 found->second(c); in ReadFromParcelFor()
747 const AidlDefinedType* t = c.typenames.TryGetDefinedType(c.type.GetName()); in ReadFromParcelFor()
748 CHECK(t != nullptr) << "Unknown type: " << c.type.GetName() << endl; in ReadFromParcelFor()
750 if (c.type.IsArray()) { in ReadFromParcelFor()
751 c.writer << c.parcel << ".readTypedArray(" << c.var << ", " << c.type.GetName() in ReadFromParcelFor()
754 c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n"; in ReadFromParcelFor()
755 c.writer.Indent(); in ReadFromParcelFor()
756 c.writer << c.var << ".readFromParcel(" << c.parcel << ");\n"; in ReadFromParcelFor()
757 c.writer.Dedent(); in ReadFromParcelFor()
758 c.writer << "}\n"; in ReadFromParcelFor()