• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2015, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "tests/test_data.h"
18 
19 namespace android {
20 namespace aidl {
21 namespace test_data {
22 namespace example_interface {
23 
24 const char kCanonicalName[] = "android.test.IExampleInterface";
25 
26 const char kJavaOutputPath[] = "some/path/to/output.java";
27 
28 const char* kImportedParcelables[] = {
29   "android.foo.ExampleParcelable",
30   nullptr,
31 };
32 
33 const char* kImportedInterfaces[] = {
34   "android.bar.IAuxInterface",
35   "android.test.IAuxInterface2",
36   nullptr,
37 };
38 
39 const char kInterfaceDefinition[] = R"(
40 package android.test;
41 
42 import android.foo.ExampleParcelable;
43 import android.test.CompoundParcelable;
44 import android.bar.IAuxInterface;
45 import android.test.IAuxInterface2;
46 
47 @SystemApi
48 @UnsupportedAppUsage
49 interface IExampleInterface {
50     const int EXAMPLE_CONSTANT = 3;
51     boolean isEnabled();
52     int getState();
53     String getAddress();
54 
55     /* Test long comment */
56     @UnsupportedAppUsage
57     @SystemApi
58     ExampleParcelable[] getParcelables();
59 
60     // Test short comment
61     boolean setScanMode(int mode, int duration);
62 
63     /* Test long comment */
64     // And short comment
65     void registerBinder(IAuxInterface foo);
66     IExampleInterface getRecursiveBinder();
67 
68     int takesAnInterface(in IAuxInterface2 arg);
69     int takesAParcelable(in CompoundParcelable.Subclass1 arg,
70                          inout CompoundParcelable.Subclass2 arg2);
71 }
72 )";
73 
74 const char kInterfaceDefinitionOutlining[] = R"(
75 package android.test;
76 
77 import android.foo.ExampleParcelable;
78 import android.test.CompoundParcelable;
79 import android.bar.IAuxInterface;
80 import android.test.IAuxInterface2;
81 
82 interface IExampleInterface {
83     const int EXAMPLE_CONSTANT = 3;
84     boolean isEnabled();
85     int getState(int a, int b);
86     String getAddress();
87 
88     /* Test long comment */
89     ExampleParcelable[] getParcelables();
90 
91     // Test short comment
92     boolean setScanMode(int mode, int duration);
93 
94     /* Test long comment */
95     // And short comment
96     void registerBinder(IAuxInterface foo);
97     IExampleInterface getRecursiveBinder();
98 
99     int takesAnInterface(in IAuxInterface2 arg);
100     int takesAParcelable(in CompoundParcelable.Subclass1 arg,
101                          inout CompoundParcelable.Subclass2 arg2);
102 }
103 )";
104 
105 const char kExpectedJavaDepsOutput[] =
106     R"(some/path/to/output.java : \
107   android/test/IExampleInterface.aidl \
108   ./android/bar/IAuxInterface.aidl \
109   ./android/foo/ExampleParcelable.aidl \
110   ./android/test/CompoundParcelable.aidl \
111   ./android/test/IAuxInterface2.aidl
112 
113 android/test/IExampleInterface.aidl :
114 ./android/bar/IAuxInterface.aidl :
115 ./android/foo/ExampleParcelable.aidl :
116 ./android/test/CompoundParcelable.aidl :
117 ./android/test/IAuxInterface2.aidl :
118 )";
119 
120 const char kExpectedJavaOutput[] =
121     R"(/*
122  * This file is auto-generated.  DO NOT MODIFY.
123  */
124 package android.test;
125 @android.annotation.UnsupportedAppUsage
126 @android.annotation.SystemApi
127 public interface IExampleInterface extends android.os.IInterface
128 {
129   /** Default implementation for IExampleInterface. */
130   public static class Default implements android.test.IExampleInterface
131   {
132     @Override public boolean isEnabled() throws android.os.RemoteException
133     {
134       return false;
135     }
136     @Override public int getState() throws android.os.RemoteException
137     {
138       return 0;
139     }
140     @Override public java.lang.String getAddress() throws android.os.RemoteException
141     {
142       return null;
143     }
144     /* Test long comment */
145     @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
146     {
147       return null;
148     }
149     // Test short comment
150 
151     @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
152     {
153       return false;
154     }
155     /* Test long comment */// And short comment
156 
157     @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
158     {
159     }
160     @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
161     {
162       return null;
163     }
164     @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
165     {
166       return 0;
167     }
168     @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
169     {
170       return 0;
171     }
172     @Override
173     public android.os.IBinder asBinder() {
174       return null;
175     }
176   }
177   /** Local-side IPC implementation stub class. */
178   public static abstract class Stub extends android.os.Binder implements android.test.IExampleInterface
179   {
180     private static final java.lang.String DESCRIPTOR = "android.test.IExampleInterface";
181     /** Construct the stub at attach it to the interface. */
182     public Stub()
183     {
184       this.attachInterface(this, DESCRIPTOR);
185     }
186     /**
187      * Cast an IBinder object into an android.test.IExampleInterface interface,
188      * generating a proxy if needed.
189      */
190     public static android.test.IExampleInterface asInterface(android.os.IBinder obj)
191     {
192       if ((obj==null)) {
193         return null;
194       }
195       android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
196       if (((iin!=null)&&(iin instanceof android.test.IExampleInterface))) {
197         return ((android.test.IExampleInterface)iin);
198       }
199       return new android.test.IExampleInterface.Stub.Proxy(obj);
200     }
201     @Override public android.os.IBinder asBinder()
202     {
203       return this;
204     }
205     @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
206     {
207       java.lang.String descriptor = DESCRIPTOR;
208       switch (code)
209       {
210         case INTERFACE_TRANSACTION:
211         {
212           reply.writeString(descriptor);
213           return true;
214         }
215         case TRANSACTION_isEnabled:
216         {
217           data.enforceInterface(descriptor);
218           boolean _result = this.isEnabled();
219           reply.writeNoException();
220           reply.writeInt(((_result)?(1):(0)));
221           return true;
222         }
223         case TRANSACTION_getState:
224         {
225           data.enforceInterface(descriptor);
226           int _result = this.getState();
227           reply.writeNoException();
228           reply.writeInt(_result);
229           return true;
230         }
231         case TRANSACTION_getAddress:
232         {
233           data.enforceInterface(descriptor);
234           java.lang.String _result = this.getAddress();
235           reply.writeNoException();
236           reply.writeString(_result);
237           return true;
238         }
239         case TRANSACTION_getParcelables:
240         {
241           data.enforceInterface(descriptor);
242           android.foo.ExampleParcelable[] _result = this.getParcelables();
243           reply.writeNoException();
244           reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
245           return true;
246         }
247         case TRANSACTION_setScanMode:
248         {
249           data.enforceInterface(descriptor);
250           int _arg0;
251           _arg0 = data.readInt();
252           int _arg1;
253           _arg1 = data.readInt();
254           boolean _result = this.setScanMode(_arg0, _arg1);
255           reply.writeNoException();
256           reply.writeInt(((_result)?(1):(0)));
257           return true;
258         }
259         case TRANSACTION_registerBinder:
260         {
261           data.enforceInterface(descriptor);
262           android.bar.IAuxInterface _arg0;
263           _arg0 = android.bar.IAuxInterface.Stub.asInterface(data.readStrongBinder());
264           this.registerBinder(_arg0);
265           reply.writeNoException();
266           return true;
267         }
268         case TRANSACTION_getRecursiveBinder:
269         {
270           data.enforceInterface(descriptor);
271           android.test.IExampleInterface _result = this.getRecursiveBinder();
272           reply.writeNoException();
273           reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null)));
274           return true;
275         }
276         case TRANSACTION_takesAnInterface:
277         {
278           data.enforceInterface(descriptor);
279           android.test.IAuxInterface2 _arg0;
280           _arg0 = android.test.IAuxInterface2.Stub.asInterface(data.readStrongBinder());
281           int _result = this.takesAnInterface(_arg0);
282           reply.writeNoException();
283           reply.writeInt(_result);
284           return true;
285         }
286         case TRANSACTION_takesAParcelable:
287         {
288           data.enforceInterface(descriptor);
289           android.test.CompoundParcelable.Subclass1 _arg0;
290           if ((0!=data.readInt())) {
291             _arg0 = android.test.CompoundParcelable.Subclass1.CREATOR.createFromParcel(data);
292           }
293           else {
294             _arg0 = null;
295           }
296           android.test.CompoundParcelable.Subclass2 _arg1;
297           if ((0!=data.readInt())) {
298             _arg1 = android.test.CompoundParcelable.Subclass2.CREATOR.createFromParcel(data);
299           }
300           else {
301             _arg1 = null;
302           }
303           int _result = this.takesAParcelable(_arg0, _arg1);
304           reply.writeNoException();
305           reply.writeInt(_result);
306           if ((_arg1!=null)) {
307             reply.writeInt(1);
308             _arg1.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
309           }
310           else {
311             reply.writeInt(0);
312           }
313           return true;
314         }
315         default:
316         {
317           return super.onTransact(code, data, reply, flags);
318         }
319       }
320     }
321     private static class Proxy implements android.test.IExampleInterface
322     {
323       private android.os.IBinder mRemote;
324       Proxy(android.os.IBinder remote)
325       {
326         mRemote = remote;
327       }
328       @Override public android.os.IBinder asBinder()
329       {
330         return mRemote;
331       }
332       public java.lang.String getInterfaceDescriptor()
333       {
334         return DESCRIPTOR;
335       }
336       @Override public boolean isEnabled() throws android.os.RemoteException
337       {
338         android.os.Parcel _data = android.os.Parcel.obtain();
339         android.os.Parcel _reply = android.os.Parcel.obtain();
340         boolean _result;
341         try {
342           _data.writeInterfaceToken(DESCRIPTOR);
343           boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
344           if (!_status && getDefaultImpl() != null) {
345             return getDefaultImpl().isEnabled();
346           }
347           _reply.readException();
348           _result = (0!=_reply.readInt());
349         }
350         finally {
351           _reply.recycle();
352           _data.recycle();
353         }
354         return _result;
355       }
356       @Override public int getState() throws android.os.RemoteException
357       {
358         android.os.Parcel _data = android.os.Parcel.obtain();
359         android.os.Parcel _reply = android.os.Parcel.obtain();
360         int _result;
361         try {
362           _data.writeInterfaceToken(DESCRIPTOR);
363           boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
364           if (!_status && getDefaultImpl() != null) {
365             return getDefaultImpl().getState();
366           }
367           _reply.readException();
368           _result = _reply.readInt();
369         }
370         finally {
371           _reply.recycle();
372           _data.recycle();
373         }
374         return _result;
375       }
376       @Override public java.lang.String getAddress() throws android.os.RemoteException
377       {
378         android.os.Parcel _data = android.os.Parcel.obtain();
379         android.os.Parcel _reply = android.os.Parcel.obtain();
380         java.lang.String _result;
381         try {
382           _data.writeInterfaceToken(DESCRIPTOR);
383           boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
384           if (!_status && getDefaultImpl() != null) {
385             return getDefaultImpl().getAddress();
386           }
387           _reply.readException();
388           _result = _reply.readString();
389         }
390         finally {
391           _reply.recycle();
392           _data.recycle();
393         }
394         return _result;
395       }
396       /* Test long comment */
397       @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
398       {
399         android.os.Parcel _data = android.os.Parcel.obtain();
400         android.os.Parcel _reply = android.os.Parcel.obtain();
401         android.foo.ExampleParcelable[] _result;
402         try {
403           _data.writeInterfaceToken(DESCRIPTOR);
404           boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
405           if (!_status && getDefaultImpl() != null) {
406             return getDefaultImpl().getParcelables();
407           }
408           _reply.readException();
409           _result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
410         }
411         finally {
412           _reply.recycle();
413           _data.recycle();
414         }
415         return _result;
416       }
417       // Test short comment
418 
419       @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
420       {
421         android.os.Parcel _data = android.os.Parcel.obtain();
422         android.os.Parcel _reply = android.os.Parcel.obtain();
423         boolean _result;
424         try {
425           _data.writeInterfaceToken(DESCRIPTOR);
426           _data.writeInt(mode);
427           _data.writeInt(duration);
428           boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
429           if (!_status && getDefaultImpl() != null) {
430             return getDefaultImpl().setScanMode(mode, duration);
431           }
432           _reply.readException();
433           _result = (0!=_reply.readInt());
434         }
435         finally {
436           _reply.recycle();
437           _data.recycle();
438         }
439         return _result;
440       }
441       /* Test long comment */// And short comment
442 
443       @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
444       {
445         android.os.Parcel _data = android.os.Parcel.obtain();
446         android.os.Parcel _reply = android.os.Parcel.obtain();
447         try {
448           _data.writeInterfaceToken(DESCRIPTOR);
449           _data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
450           boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
451           if (!_status && getDefaultImpl() != null) {
452             getDefaultImpl().registerBinder(foo);
453             return;
454           }
455           _reply.readException();
456         }
457         finally {
458           _reply.recycle();
459           _data.recycle();
460         }
461       }
462       @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
463       {
464         android.os.Parcel _data = android.os.Parcel.obtain();
465         android.os.Parcel _reply = android.os.Parcel.obtain();
466         android.test.IExampleInterface _result;
467         try {
468           _data.writeInterfaceToken(DESCRIPTOR);
469           boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
470           if (!_status && getDefaultImpl() != null) {
471             return getDefaultImpl().getRecursiveBinder();
472           }
473           _reply.readException();
474           _result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
475         }
476         finally {
477           _reply.recycle();
478           _data.recycle();
479         }
480         return _result;
481       }
482       @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
483       {
484         android.os.Parcel _data = android.os.Parcel.obtain();
485         android.os.Parcel _reply = android.os.Parcel.obtain();
486         int _result;
487         try {
488           _data.writeInterfaceToken(DESCRIPTOR);
489           _data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
490           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
491           if (!_status && getDefaultImpl() != null) {
492             return getDefaultImpl().takesAnInterface(arg);
493           }
494           _reply.readException();
495           _result = _reply.readInt();
496         }
497         finally {
498           _reply.recycle();
499           _data.recycle();
500         }
501         return _result;
502       }
503       @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
504       {
505         android.os.Parcel _data = android.os.Parcel.obtain();
506         android.os.Parcel _reply = android.os.Parcel.obtain();
507         int _result;
508         try {
509           _data.writeInterfaceToken(DESCRIPTOR);
510           if ((arg!=null)) {
511             _data.writeInt(1);
512             arg.writeToParcel(_data, 0);
513           }
514           else {
515             _data.writeInt(0);
516           }
517           if ((arg2!=null)) {
518             _data.writeInt(1);
519             arg2.writeToParcel(_data, 0);
520           }
521           else {
522             _data.writeInt(0);
523           }
524           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
525           if (!_status && getDefaultImpl() != null) {
526             return getDefaultImpl().takesAParcelable(arg, arg2);
527           }
528           _reply.readException();
529           _result = _reply.readInt();
530           if ((0!=_reply.readInt())) {
531             arg2.readFromParcel(_reply);
532           }
533         }
534         finally {
535           _reply.recycle();
536           _data.recycle();
537         }
538         return _result;
539       }
540       public static android.test.IExampleInterface sDefaultImpl;
541     }
542     static final int TRANSACTION_isEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
543     static final int TRANSACTION_getState = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
544     static final int TRANSACTION_getAddress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
545     static final int TRANSACTION_getParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
546     static final int TRANSACTION_setScanMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
547     static final int TRANSACTION_registerBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
548     static final int TRANSACTION_getRecursiveBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
549     static final int TRANSACTION_takesAnInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
550     static final int TRANSACTION_takesAParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
551     public static boolean setDefaultImpl(android.test.IExampleInterface impl) {
552       if (Stub.Proxy.sDefaultImpl == null && impl != null) {
553         Stub.Proxy.sDefaultImpl = impl;
554         return true;
555       }
556       return false;
557     }
558     public static android.test.IExampleInterface getDefaultImpl() {
559       return Stub.Proxy.sDefaultImpl;
560     }
561   }
562   public static final int EXAMPLE_CONSTANT = 3;
563   public boolean isEnabled() throws android.os.RemoteException;
564   public int getState() throws android.os.RemoteException;
565   public java.lang.String getAddress() throws android.os.RemoteException;
566   /* Test long comment */
567   @android.annotation.UnsupportedAppUsage
568   @android.annotation.SystemApi
569   public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException;
570   // Test short comment
571 
572   public boolean setScanMode(int mode, int duration) throws android.os.RemoteException;
573   /* Test long comment */// And short comment
574 
575   public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException;
576   public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException;
577   public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException;
578   public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException;
579 }
580 )";
581 
582 const char kExpectedJavaOutputWithTransactionNames[] =
583     R"(/*
584  * This file is auto-generated.  DO NOT MODIFY.
585  */
586 package android.test;
587 @android.annotation.UnsupportedAppUsage
588 @android.annotation.SystemApi
589 public interface IExampleInterface extends android.os.IInterface
590 {
591   /** Default implementation for IExampleInterface. */
592   public static class Default implements android.test.IExampleInterface
593   {
594     @Override public boolean isEnabled() throws android.os.RemoteException
595     {
596       return false;
597     }
598     @Override public int getState() throws android.os.RemoteException
599     {
600       return 0;
601     }
602     @Override public java.lang.String getAddress() throws android.os.RemoteException
603     {
604       return null;
605     }
606     /* Test long comment */
607     @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
608     {
609       return null;
610     }
611     // Test short comment
612 
613     @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
614     {
615       return false;
616     }
617     /* Test long comment */// And short comment
618 
619     @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
620     {
621     }
622     @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
623     {
624       return null;
625     }
626     @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
627     {
628       return 0;
629     }
630     @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
631     {
632       return 0;
633     }
634     @Override
635     public android.os.IBinder asBinder() {
636       return null;
637     }
638   }
639   /** Local-side IPC implementation stub class. */
640   public static abstract class Stub extends android.os.Binder implements android.test.IExampleInterface
641   {
642     private static final java.lang.String DESCRIPTOR = "android.test.IExampleInterface";
643     /** Construct the stub at attach it to the interface. */
644     public Stub()
645     {
646       this.attachInterface(this, DESCRIPTOR);
647     }
648     /**
649      * Cast an IBinder object into an android.test.IExampleInterface interface,
650      * generating a proxy if needed.
651      */
652     public static android.test.IExampleInterface asInterface(android.os.IBinder obj)
653     {
654       if ((obj==null)) {
655         return null;
656       }
657       android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
658       if (((iin!=null)&&(iin instanceof android.test.IExampleInterface))) {
659         return ((android.test.IExampleInterface)iin);
660       }
661       return new android.test.IExampleInterface.Stub.Proxy(obj);
662     }
663     @Override public android.os.IBinder asBinder()
664     {
665       return this;
666     }
667     /** @hide */
668     public static java.lang.String getDefaultTransactionName(int transactionCode)
669     {
670       switch (transactionCode)
671       {
672         case TRANSACTION_isEnabled:
673         {
674           return "isEnabled";
675         }
676         case TRANSACTION_getState:
677         {
678           return "getState";
679         }
680         case TRANSACTION_getAddress:
681         {
682           return "getAddress";
683         }
684         case TRANSACTION_getParcelables:
685         {
686           return "getParcelables";
687         }
688         case TRANSACTION_setScanMode:
689         {
690           return "setScanMode";
691         }
692         case TRANSACTION_registerBinder:
693         {
694           return "registerBinder";
695         }
696         case TRANSACTION_getRecursiveBinder:
697         {
698           return "getRecursiveBinder";
699         }
700         case TRANSACTION_takesAnInterface:
701         {
702           return "takesAnInterface";
703         }
704         case TRANSACTION_takesAParcelable:
705         {
706           return "takesAParcelable";
707         }
708         default:
709         {
710           return null;
711         }
712       }
713     }
714     /** @hide */
715     public java.lang.String getTransactionName(int transactionCode)
716     {
717       return this.getDefaultTransactionName(transactionCode);
718     }
719     @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
720     {
721       java.lang.String descriptor = DESCRIPTOR;
722       switch (code)
723       {
724         case INTERFACE_TRANSACTION:
725         {
726           reply.writeString(descriptor);
727           return true;
728         }
729         case TRANSACTION_isEnabled:
730         {
731           data.enforceInterface(descriptor);
732           boolean _result = this.isEnabled();
733           reply.writeNoException();
734           reply.writeInt(((_result)?(1):(0)));
735           return true;
736         }
737         case TRANSACTION_getState:
738         {
739           data.enforceInterface(descriptor);
740           int _result = this.getState();
741           reply.writeNoException();
742           reply.writeInt(_result);
743           return true;
744         }
745         case TRANSACTION_getAddress:
746         {
747           data.enforceInterface(descriptor);
748           java.lang.String _result = this.getAddress();
749           reply.writeNoException();
750           reply.writeString(_result);
751           return true;
752         }
753         case TRANSACTION_getParcelables:
754         {
755           data.enforceInterface(descriptor);
756           android.foo.ExampleParcelable[] _result = this.getParcelables();
757           reply.writeNoException();
758           reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
759           return true;
760         }
761         case TRANSACTION_setScanMode:
762         {
763           data.enforceInterface(descriptor);
764           int _arg0;
765           _arg0 = data.readInt();
766           int _arg1;
767           _arg1 = data.readInt();
768           boolean _result = this.setScanMode(_arg0, _arg1);
769           reply.writeNoException();
770           reply.writeInt(((_result)?(1):(0)));
771           return true;
772         }
773         case TRANSACTION_registerBinder:
774         {
775           data.enforceInterface(descriptor);
776           android.bar.IAuxInterface _arg0;
777           _arg0 = android.bar.IAuxInterface.Stub.asInterface(data.readStrongBinder());
778           this.registerBinder(_arg0);
779           reply.writeNoException();
780           return true;
781         }
782         case TRANSACTION_getRecursiveBinder:
783         {
784           data.enforceInterface(descriptor);
785           android.test.IExampleInterface _result = this.getRecursiveBinder();
786           reply.writeNoException();
787           reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null)));
788           return true;
789         }
790         case TRANSACTION_takesAnInterface:
791         {
792           data.enforceInterface(descriptor);
793           android.test.IAuxInterface2 _arg0;
794           _arg0 = android.test.IAuxInterface2.Stub.asInterface(data.readStrongBinder());
795           int _result = this.takesAnInterface(_arg0);
796           reply.writeNoException();
797           reply.writeInt(_result);
798           return true;
799         }
800         case TRANSACTION_takesAParcelable:
801         {
802           data.enforceInterface(descriptor);
803           android.test.CompoundParcelable.Subclass1 _arg0;
804           if ((0!=data.readInt())) {
805             _arg0 = android.test.CompoundParcelable.Subclass1.CREATOR.createFromParcel(data);
806           }
807           else {
808             _arg0 = null;
809           }
810           android.test.CompoundParcelable.Subclass2 _arg1;
811           if ((0!=data.readInt())) {
812             _arg1 = android.test.CompoundParcelable.Subclass2.CREATOR.createFromParcel(data);
813           }
814           else {
815             _arg1 = null;
816           }
817           int _result = this.takesAParcelable(_arg0, _arg1);
818           reply.writeNoException();
819           reply.writeInt(_result);
820           if ((_arg1!=null)) {
821             reply.writeInt(1);
822             _arg1.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
823           }
824           else {
825             reply.writeInt(0);
826           }
827           return true;
828         }
829         default:
830         {
831           return super.onTransact(code, data, reply, flags);
832         }
833       }
834     }
835     private static class Proxy implements android.test.IExampleInterface
836     {
837       private android.os.IBinder mRemote;
838       Proxy(android.os.IBinder remote)
839       {
840         mRemote = remote;
841       }
842       @Override public android.os.IBinder asBinder()
843       {
844         return mRemote;
845       }
846       public java.lang.String getInterfaceDescriptor()
847       {
848         return DESCRIPTOR;
849       }
850       @Override public boolean isEnabled() throws android.os.RemoteException
851       {
852         android.os.Parcel _data = android.os.Parcel.obtain();
853         android.os.Parcel _reply = android.os.Parcel.obtain();
854         boolean _result;
855         try {
856           _data.writeInterfaceToken(DESCRIPTOR);
857           boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
858           if (!_status && getDefaultImpl() != null) {
859             return getDefaultImpl().isEnabled();
860           }
861           _reply.readException();
862           _result = (0!=_reply.readInt());
863         }
864         finally {
865           _reply.recycle();
866           _data.recycle();
867         }
868         return _result;
869       }
870       @Override public int getState() throws android.os.RemoteException
871       {
872         android.os.Parcel _data = android.os.Parcel.obtain();
873         android.os.Parcel _reply = android.os.Parcel.obtain();
874         int _result;
875         try {
876           _data.writeInterfaceToken(DESCRIPTOR);
877           boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
878           if (!_status && getDefaultImpl() != null) {
879             return getDefaultImpl().getState();
880           }
881           _reply.readException();
882           _result = _reply.readInt();
883         }
884         finally {
885           _reply.recycle();
886           _data.recycle();
887         }
888         return _result;
889       }
890       @Override public java.lang.String getAddress() throws android.os.RemoteException
891       {
892         android.os.Parcel _data = android.os.Parcel.obtain();
893         android.os.Parcel _reply = android.os.Parcel.obtain();
894         java.lang.String _result;
895         try {
896           _data.writeInterfaceToken(DESCRIPTOR);
897           boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
898           if (!_status && getDefaultImpl() != null) {
899             return getDefaultImpl().getAddress();
900           }
901           _reply.readException();
902           _result = _reply.readString();
903         }
904         finally {
905           _reply.recycle();
906           _data.recycle();
907         }
908         return _result;
909       }
910       /* Test long comment */
911       @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
912       {
913         android.os.Parcel _data = android.os.Parcel.obtain();
914         android.os.Parcel _reply = android.os.Parcel.obtain();
915         android.foo.ExampleParcelable[] _result;
916         try {
917           _data.writeInterfaceToken(DESCRIPTOR);
918           boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
919           if (!_status && getDefaultImpl() != null) {
920             return getDefaultImpl().getParcelables();
921           }
922           _reply.readException();
923           _result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
924         }
925         finally {
926           _reply.recycle();
927           _data.recycle();
928         }
929         return _result;
930       }
931       // Test short comment
932 
933       @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
934       {
935         android.os.Parcel _data = android.os.Parcel.obtain();
936         android.os.Parcel _reply = android.os.Parcel.obtain();
937         boolean _result;
938         try {
939           _data.writeInterfaceToken(DESCRIPTOR);
940           _data.writeInt(mode);
941           _data.writeInt(duration);
942           boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
943           if (!_status && getDefaultImpl() != null) {
944             return getDefaultImpl().setScanMode(mode, duration);
945           }
946           _reply.readException();
947           _result = (0!=_reply.readInt());
948         }
949         finally {
950           _reply.recycle();
951           _data.recycle();
952         }
953         return _result;
954       }
955       /* Test long comment */// And short comment
956 
957       @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
958       {
959         android.os.Parcel _data = android.os.Parcel.obtain();
960         android.os.Parcel _reply = android.os.Parcel.obtain();
961         try {
962           _data.writeInterfaceToken(DESCRIPTOR);
963           _data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
964           boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
965           if (!_status && getDefaultImpl() != null) {
966             getDefaultImpl().registerBinder(foo);
967             return;
968           }
969           _reply.readException();
970         }
971         finally {
972           _reply.recycle();
973           _data.recycle();
974         }
975       }
976       @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
977       {
978         android.os.Parcel _data = android.os.Parcel.obtain();
979         android.os.Parcel _reply = android.os.Parcel.obtain();
980         android.test.IExampleInterface _result;
981         try {
982           _data.writeInterfaceToken(DESCRIPTOR);
983           boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
984           if (!_status && getDefaultImpl() != null) {
985             return getDefaultImpl().getRecursiveBinder();
986           }
987           _reply.readException();
988           _result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
989         }
990         finally {
991           _reply.recycle();
992           _data.recycle();
993         }
994         return _result;
995       }
996       @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
997       {
998         android.os.Parcel _data = android.os.Parcel.obtain();
999         android.os.Parcel _reply = android.os.Parcel.obtain();
1000         int _result;
1001         try {
1002           _data.writeInterfaceToken(DESCRIPTOR);
1003           _data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
1004           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
1005           if (!_status && getDefaultImpl() != null) {
1006             return getDefaultImpl().takesAnInterface(arg);
1007           }
1008           _reply.readException();
1009           _result = _reply.readInt();
1010         }
1011         finally {
1012           _reply.recycle();
1013           _data.recycle();
1014         }
1015         return _result;
1016       }
1017       @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
1018       {
1019         android.os.Parcel _data = android.os.Parcel.obtain();
1020         android.os.Parcel _reply = android.os.Parcel.obtain();
1021         int _result;
1022         try {
1023           _data.writeInterfaceToken(DESCRIPTOR);
1024           if ((arg!=null)) {
1025             _data.writeInt(1);
1026             arg.writeToParcel(_data, 0);
1027           }
1028           else {
1029             _data.writeInt(0);
1030           }
1031           if ((arg2!=null)) {
1032             _data.writeInt(1);
1033             arg2.writeToParcel(_data, 0);
1034           }
1035           else {
1036             _data.writeInt(0);
1037           }
1038           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
1039           if (!_status && getDefaultImpl() != null) {
1040             return getDefaultImpl().takesAParcelable(arg, arg2);
1041           }
1042           _reply.readException();
1043           _result = _reply.readInt();
1044           if ((0!=_reply.readInt())) {
1045             arg2.readFromParcel(_reply);
1046           }
1047         }
1048         finally {
1049           _reply.recycle();
1050           _data.recycle();
1051         }
1052         return _result;
1053       }
1054       public static android.test.IExampleInterface sDefaultImpl;
1055     }
1056     static final int TRANSACTION_isEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
1057     static final int TRANSACTION_getState = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
1058     static final int TRANSACTION_getAddress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
1059     static final int TRANSACTION_getParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
1060     static final int TRANSACTION_setScanMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
1061     static final int TRANSACTION_registerBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
1062     static final int TRANSACTION_getRecursiveBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
1063     static final int TRANSACTION_takesAnInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
1064     static final int TRANSACTION_takesAParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
1065     public static boolean setDefaultImpl(android.test.IExampleInterface impl) {
1066       if (Stub.Proxy.sDefaultImpl == null && impl != null) {
1067         Stub.Proxy.sDefaultImpl = impl;
1068         return true;
1069       }
1070       return false;
1071     }
1072     public static android.test.IExampleInterface getDefaultImpl() {
1073       return Stub.Proxy.sDefaultImpl;
1074     }
1075   }
1076   public static final int EXAMPLE_CONSTANT = 3;
1077   public boolean isEnabled() throws android.os.RemoteException;
1078   public int getState() throws android.os.RemoteException;
1079   public java.lang.String getAddress() throws android.os.RemoteException;
1080   /* Test long comment */
1081   @android.annotation.UnsupportedAppUsage
1082   @android.annotation.SystemApi
1083   public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException;
1084   // Test short comment
1085 
1086   public boolean setScanMode(int mode, int duration) throws android.os.RemoteException;
1087   /* Test long comment */// And short comment
1088 
1089   public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException;
1090   public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException;
1091   public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException;
1092   public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException;
1093 }
1094 )";
1095 
1096 const char kExpectedJavaOutputWithTrace[] =
1097     R"(/*
1098  * This file is auto-generated.  DO NOT MODIFY.
1099  */
1100 package android.test;
1101 @android.annotation.UnsupportedAppUsage
1102 @android.annotation.SystemApi
1103 public interface IExampleInterface extends android.os.IInterface
1104 {
1105   /** Default implementation for IExampleInterface. */
1106   public static class Default implements android.test.IExampleInterface
1107   {
1108     @Override public boolean isEnabled() throws android.os.RemoteException
1109     {
1110       return false;
1111     }
1112     @Override public int getState() throws android.os.RemoteException
1113     {
1114       return 0;
1115     }
1116     @Override public java.lang.String getAddress() throws android.os.RemoteException
1117     {
1118       return null;
1119     }
1120     /* Test long comment */
1121     @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
1122     {
1123       return null;
1124     }
1125     // Test short comment
1126 
1127     @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
1128     {
1129       return false;
1130     }
1131     /* Test long comment */// And short comment
1132 
1133     @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
1134     {
1135     }
1136     @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
1137     {
1138       return null;
1139     }
1140     @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
1141     {
1142       return 0;
1143     }
1144     @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
1145     {
1146       return 0;
1147     }
1148     @Override
1149     public android.os.IBinder asBinder() {
1150       return null;
1151     }
1152   }
1153   /** Local-side IPC implementation stub class. */
1154   public static abstract class Stub extends android.os.Binder implements android.test.IExampleInterface
1155   {
1156     private static final java.lang.String DESCRIPTOR = "android.test.IExampleInterface";
1157     /** Construct the stub at attach it to the interface. */
1158     public Stub()
1159     {
1160       this.attachInterface(this, DESCRIPTOR);
1161     }
1162     /**
1163      * Cast an IBinder object into an android.test.IExampleInterface interface,
1164      * generating a proxy if needed.
1165      */
1166     public static android.test.IExampleInterface asInterface(android.os.IBinder obj)
1167     {
1168       if ((obj==null)) {
1169         return null;
1170       }
1171       android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
1172       if (((iin!=null)&&(iin instanceof android.test.IExampleInterface))) {
1173         return ((android.test.IExampleInterface)iin);
1174       }
1175       return new android.test.IExampleInterface.Stub.Proxy(obj);
1176     }
1177     @Override public android.os.IBinder asBinder()
1178     {
1179       return this;
1180     }
1181     @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
1182     {
1183       java.lang.String descriptor = DESCRIPTOR;
1184       switch (code)
1185       {
1186         case INTERFACE_TRANSACTION:
1187         {
1188           reply.writeString(descriptor);
1189           return true;
1190         }
1191         case TRANSACTION_isEnabled:
1192         {
1193           data.enforceInterface(descriptor);
1194           boolean _result;
1195           try {
1196             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::isEnabled::server");
1197             _result = this.isEnabled();
1198           }
1199           finally {
1200             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1201           }
1202           reply.writeNoException();
1203           reply.writeInt(((_result)?(1):(0)));
1204           return true;
1205         }
1206         case TRANSACTION_getState:
1207         {
1208           data.enforceInterface(descriptor);
1209           int _result;
1210           try {
1211             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getState::server");
1212             _result = this.getState();
1213           }
1214           finally {
1215             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1216           }
1217           reply.writeNoException();
1218           reply.writeInt(_result);
1219           return true;
1220         }
1221         case TRANSACTION_getAddress:
1222         {
1223           data.enforceInterface(descriptor);
1224           java.lang.String _result;
1225           try {
1226             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getAddress::server");
1227             _result = this.getAddress();
1228           }
1229           finally {
1230             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1231           }
1232           reply.writeNoException();
1233           reply.writeString(_result);
1234           return true;
1235         }
1236         case TRANSACTION_getParcelables:
1237         {
1238           data.enforceInterface(descriptor);
1239           android.foo.ExampleParcelable[] _result;
1240           try {
1241             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getParcelables::server");
1242             _result = this.getParcelables();
1243           }
1244           finally {
1245             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1246           }
1247           reply.writeNoException();
1248           reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1249           return true;
1250         }
1251         case TRANSACTION_setScanMode:
1252         {
1253           data.enforceInterface(descriptor);
1254           int _arg0;
1255           _arg0 = data.readInt();
1256           int _arg1;
1257           _arg1 = data.readInt();
1258           boolean _result;
1259           try {
1260             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::setScanMode::server");
1261             _result = this.setScanMode(_arg0, _arg1);
1262           }
1263           finally {
1264             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1265           }
1266           reply.writeNoException();
1267           reply.writeInt(((_result)?(1):(0)));
1268           return true;
1269         }
1270         case TRANSACTION_registerBinder:
1271         {
1272           data.enforceInterface(descriptor);
1273           android.bar.IAuxInterface _arg0;
1274           _arg0 = android.bar.IAuxInterface.Stub.asInterface(data.readStrongBinder());
1275           try {
1276             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::registerBinder::server");
1277             this.registerBinder(_arg0);
1278           }
1279           finally {
1280             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1281           }
1282           reply.writeNoException();
1283           return true;
1284         }
1285         case TRANSACTION_getRecursiveBinder:
1286         {
1287           data.enforceInterface(descriptor);
1288           android.test.IExampleInterface _result;
1289           try {
1290             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getRecursiveBinder::server");
1291             _result = this.getRecursiveBinder();
1292           }
1293           finally {
1294             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1295           }
1296           reply.writeNoException();
1297           reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null)));
1298           return true;
1299         }
1300         case TRANSACTION_takesAnInterface:
1301         {
1302           data.enforceInterface(descriptor);
1303           android.test.IAuxInterface2 _arg0;
1304           _arg0 = android.test.IAuxInterface2.Stub.asInterface(data.readStrongBinder());
1305           int _result;
1306           try {
1307             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::takesAnInterface::server");
1308             _result = this.takesAnInterface(_arg0);
1309           }
1310           finally {
1311             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1312           }
1313           reply.writeNoException();
1314           reply.writeInt(_result);
1315           return true;
1316         }
1317         case TRANSACTION_takesAParcelable:
1318         {
1319           data.enforceInterface(descriptor);
1320           android.test.CompoundParcelable.Subclass1 _arg0;
1321           if ((0!=data.readInt())) {
1322             _arg0 = android.test.CompoundParcelable.Subclass1.CREATOR.createFromParcel(data);
1323           }
1324           else {
1325             _arg0 = null;
1326           }
1327           android.test.CompoundParcelable.Subclass2 _arg1;
1328           if ((0!=data.readInt())) {
1329             _arg1 = android.test.CompoundParcelable.Subclass2.CREATOR.createFromParcel(data);
1330           }
1331           else {
1332             _arg1 = null;
1333           }
1334           int _result;
1335           try {
1336             android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::takesAParcelable::server");
1337             _result = this.takesAParcelable(_arg0, _arg1);
1338           }
1339           finally {
1340             android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1341           }
1342           reply.writeNoException();
1343           reply.writeInt(_result);
1344           if ((_arg1!=null)) {
1345             reply.writeInt(1);
1346             _arg1.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1347           }
1348           else {
1349             reply.writeInt(0);
1350           }
1351           return true;
1352         }
1353         default:
1354         {
1355           return super.onTransact(code, data, reply, flags);
1356         }
1357       }
1358     }
1359     private static class Proxy implements android.test.IExampleInterface
1360     {
1361       private android.os.IBinder mRemote;
1362       Proxy(android.os.IBinder remote)
1363       {
1364         mRemote = remote;
1365       }
1366       @Override public android.os.IBinder asBinder()
1367       {
1368         return mRemote;
1369       }
1370       public java.lang.String getInterfaceDescriptor()
1371       {
1372         return DESCRIPTOR;
1373       }
1374       @Override public boolean isEnabled() throws android.os.RemoteException
1375       {
1376         android.os.Parcel _data = android.os.Parcel.obtain();
1377         android.os.Parcel _reply = android.os.Parcel.obtain();
1378         boolean _result;
1379         try {
1380           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::isEnabled::client");
1381           _data.writeInterfaceToken(DESCRIPTOR);
1382           boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
1383           if (!_status && getDefaultImpl() != null) {
1384             return getDefaultImpl().isEnabled();
1385           }
1386           _reply.readException();
1387           _result = (0!=_reply.readInt());
1388         }
1389         finally {
1390           _reply.recycle();
1391           _data.recycle();
1392           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1393         }
1394         return _result;
1395       }
1396       @Override public int getState() throws android.os.RemoteException
1397       {
1398         android.os.Parcel _data = android.os.Parcel.obtain();
1399         android.os.Parcel _reply = android.os.Parcel.obtain();
1400         int _result;
1401         try {
1402           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getState::client");
1403           _data.writeInterfaceToken(DESCRIPTOR);
1404           boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
1405           if (!_status && getDefaultImpl() != null) {
1406             return getDefaultImpl().getState();
1407           }
1408           _reply.readException();
1409           _result = _reply.readInt();
1410         }
1411         finally {
1412           _reply.recycle();
1413           _data.recycle();
1414           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1415         }
1416         return _result;
1417       }
1418       @Override public java.lang.String getAddress() throws android.os.RemoteException
1419       {
1420         android.os.Parcel _data = android.os.Parcel.obtain();
1421         android.os.Parcel _reply = android.os.Parcel.obtain();
1422         java.lang.String _result;
1423         try {
1424           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getAddress::client");
1425           _data.writeInterfaceToken(DESCRIPTOR);
1426           boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
1427           if (!_status && getDefaultImpl() != null) {
1428             return getDefaultImpl().getAddress();
1429           }
1430           _reply.readException();
1431           _result = _reply.readString();
1432         }
1433         finally {
1434           _reply.recycle();
1435           _data.recycle();
1436           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1437         }
1438         return _result;
1439       }
1440       /* Test long comment */
1441       @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
1442       {
1443         android.os.Parcel _data = android.os.Parcel.obtain();
1444         android.os.Parcel _reply = android.os.Parcel.obtain();
1445         android.foo.ExampleParcelable[] _result;
1446         try {
1447           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getParcelables::client");
1448           _data.writeInterfaceToken(DESCRIPTOR);
1449           boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
1450           if (!_status && getDefaultImpl() != null) {
1451             return getDefaultImpl().getParcelables();
1452           }
1453           _reply.readException();
1454           _result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
1455         }
1456         finally {
1457           _reply.recycle();
1458           _data.recycle();
1459           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1460         }
1461         return _result;
1462       }
1463       // Test short comment
1464 
1465       @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
1466       {
1467         android.os.Parcel _data = android.os.Parcel.obtain();
1468         android.os.Parcel _reply = android.os.Parcel.obtain();
1469         boolean _result;
1470         try {
1471           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::setScanMode::client");
1472           _data.writeInterfaceToken(DESCRIPTOR);
1473           _data.writeInt(mode);
1474           _data.writeInt(duration);
1475           boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
1476           if (!_status && getDefaultImpl() != null) {
1477             return getDefaultImpl().setScanMode(mode, duration);
1478           }
1479           _reply.readException();
1480           _result = (0!=_reply.readInt());
1481         }
1482         finally {
1483           _reply.recycle();
1484           _data.recycle();
1485           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1486         }
1487         return _result;
1488       }
1489       /* Test long comment */// And short comment
1490 
1491       @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
1492       {
1493         android.os.Parcel _data = android.os.Parcel.obtain();
1494         android.os.Parcel _reply = android.os.Parcel.obtain();
1495         try {
1496           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::registerBinder::client");
1497           _data.writeInterfaceToken(DESCRIPTOR);
1498           _data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
1499           boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
1500           if (!_status && getDefaultImpl() != null) {
1501             getDefaultImpl().registerBinder(foo);
1502             return;
1503           }
1504           _reply.readException();
1505         }
1506         finally {
1507           _reply.recycle();
1508           _data.recycle();
1509           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1510         }
1511       }
1512       @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
1513       {
1514         android.os.Parcel _data = android.os.Parcel.obtain();
1515         android.os.Parcel _reply = android.os.Parcel.obtain();
1516         android.test.IExampleInterface _result;
1517         try {
1518           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::getRecursiveBinder::client");
1519           _data.writeInterfaceToken(DESCRIPTOR);
1520           boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
1521           if (!_status && getDefaultImpl() != null) {
1522             return getDefaultImpl().getRecursiveBinder();
1523           }
1524           _reply.readException();
1525           _result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
1526         }
1527         finally {
1528           _reply.recycle();
1529           _data.recycle();
1530           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1531         }
1532         return _result;
1533       }
1534       @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
1535       {
1536         android.os.Parcel _data = android.os.Parcel.obtain();
1537         android.os.Parcel _reply = android.os.Parcel.obtain();
1538         int _result;
1539         try {
1540           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::takesAnInterface::client");
1541           _data.writeInterfaceToken(DESCRIPTOR);
1542           _data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
1543           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
1544           if (!_status && getDefaultImpl() != null) {
1545             return getDefaultImpl().takesAnInterface(arg);
1546           }
1547           _reply.readException();
1548           _result = _reply.readInt();
1549         }
1550         finally {
1551           _reply.recycle();
1552           _data.recycle();
1553           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1554         }
1555         return _result;
1556       }
1557       @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
1558       {
1559         android.os.Parcel _data = android.os.Parcel.obtain();
1560         android.os.Parcel _reply = android.os.Parcel.obtain();
1561         int _result;
1562         try {
1563           android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "IExampleInterface::takesAParcelable::client");
1564           _data.writeInterfaceToken(DESCRIPTOR);
1565           if ((arg!=null)) {
1566             _data.writeInt(1);
1567             arg.writeToParcel(_data, 0);
1568           }
1569           else {
1570             _data.writeInt(0);
1571           }
1572           if ((arg2!=null)) {
1573             _data.writeInt(1);
1574             arg2.writeToParcel(_data, 0);
1575           }
1576           else {
1577             _data.writeInt(0);
1578           }
1579           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
1580           if (!_status && getDefaultImpl() != null) {
1581             return getDefaultImpl().takesAParcelable(arg, arg2);
1582           }
1583           _reply.readException();
1584           _result = _reply.readInt();
1585           if ((0!=_reply.readInt())) {
1586             arg2.readFromParcel(_reply);
1587           }
1588         }
1589         finally {
1590           _reply.recycle();
1591           _data.recycle();
1592           android.os.Trace.traceEnd(android.os.Trace.TRACE_TAG_AIDL);
1593         }
1594         return _result;
1595       }
1596       public static android.test.IExampleInterface sDefaultImpl;
1597     }
1598     static final int TRANSACTION_isEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
1599     static final int TRANSACTION_getState = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
1600     static final int TRANSACTION_getAddress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
1601     static final int TRANSACTION_getParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
1602     static final int TRANSACTION_setScanMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
1603     static final int TRANSACTION_registerBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
1604     static final int TRANSACTION_getRecursiveBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
1605     static final int TRANSACTION_takesAnInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
1606     static final int TRANSACTION_takesAParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
1607     public static boolean setDefaultImpl(android.test.IExampleInterface impl) {
1608       if (Stub.Proxy.sDefaultImpl == null && impl != null) {
1609         Stub.Proxy.sDefaultImpl = impl;
1610         return true;
1611       }
1612       return false;
1613     }
1614     public static android.test.IExampleInterface getDefaultImpl() {
1615       return Stub.Proxy.sDefaultImpl;
1616     }
1617   }
1618   public static final int EXAMPLE_CONSTANT = 3;
1619   public boolean isEnabled() throws android.os.RemoteException;
1620   public int getState() throws android.os.RemoteException;
1621   public java.lang.String getAddress() throws android.os.RemoteException;
1622   /* Test long comment */
1623   @android.annotation.UnsupportedAppUsage
1624   @android.annotation.SystemApi
1625   public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException;
1626   // Test short comment
1627 
1628   public boolean setScanMode(int mode, int duration) throws android.os.RemoteException;
1629   /* Test long comment */// And short comment
1630 
1631   public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException;
1632   public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException;
1633   public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException;
1634   public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException;
1635 }
1636 )";
1637 
1638 const char kExpectedJavaOutputOutlining[] =
1639     R"(/*
1640  * This file is auto-generated.  DO NOT MODIFY.
1641  */
1642 package android.test;
1643 public interface IExampleInterface extends android.os.IInterface
1644 {
1645   /** Default implementation for IExampleInterface. */
1646   public static class Default implements android.test.IExampleInterface
1647   {
1648     @Override public boolean isEnabled() throws android.os.RemoteException
1649     {
1650       return false;
1651     }
1652     @Override public int getState(int a, int b) throws android.os.RemoteException
1653     {
1654       return 0;
1655     }
1656     @Override public java.lang.String getAddress() throws android.os.RemoteException
1657     {
1658       return null;
1659     }
1660     /* Test long comment */
1661     @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
1662     {
1663       return null;
1664     }
1665     // Test short comment
1666 
1667     @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
1668     {
1669       return false;
1670     }
1671     /* Test long comment */// And short comment
1672 
1673     @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
1674     {
1675     }
1676     @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
1677     {
1678       return null;
1679     }
1680     @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
1681     {
1682       return 0;
1683     }
1684     @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
1685     {
1686       return 0;
1687     }
1688     @Override
1689     public android.os.IBinder asBinder() {
1690       return null;
1691     }
1692   }
1693   /** Local-side IPC implementation stub class. */
1694   public static abstract class Stub extends android.os.Binder implements android.test.IExampleInterface
1695   {
1696     private static final java.lang.String DESCRIPTOR = "android.test.IExampleInterface";
1697     /** Construct the stub at attach it to the interface. */
1698     public Stub()
1699     {
1700       this.attachInterface(this, DESCRIPTOR);
1701     }
1702     /**
1703      * Cast an IBinder object into an android.test.IExampleInterface interface,
1704      * generating a proxy if needed.
1705      */
1706     public static android.test.IExampleInterface asInterface(android.os.IBinder obj)
1707     {
1708       if ((obj==null)) {
1709         return null;
1710       }
1711       android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
1712       if (((iin!=null)&&(iin instanceof android.test.IExampleInterface))) {
1713         return ((android.test.IExampleInterface)iin);
1714       }
1715       return new android.test.IExampleInterface.Stub.Proxy(obj);
1716     }
1717     @Override public android.os.IBinder asBinder()
1718     {
1719       return this;
1720     }
1721     @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
1722     {
1723       java.lang.String descriptor = DESCRIPTOR;
1724       switch (code)
1725       {
1726         case INTERFACE_TRANSACTION:
1727         {
1728           reply.writeString(descriptor);
1729           return true;
1730         }
1731         case TRANSACTION_isEnabled:
1732         {
1733           data.enforceInterface(descriptor);
1734           boolean _result = this.isEnabled();
1735           reply.writeNoException();
1736           reply.writeInt(((_result)?(1):(0)));
1737           return true;
1738         }
1739         case TRANSACTION_getState:
1740         {
1741           return this.onTransact$getState$(data, reply);
1742         }
1743         case TRANSACTION_getAddress:
1744         {
1745           data.enforceInterface(descriptor);
1746           java.lang.String _result = this.getAddress();
1747           reply.writeNoException();
1748           reply.writeString(_result);
1749           return true;
1750         }
1751         case TRANSACTION_getParcelables:
1752         {
1753           data.enforceInterface(descriptor);
1754           android.foo.ExampleParcelable[] _result = this.getParcelables();
1755           reply.writeNoException();
1756           reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1757           return true;
1758         }
1759         case TRANSACTION_setScanMode:
1760         {
1761           return this.onTransact$setScanMode$(data, reply);
1762         }
1763         case TRANSACTION_registerBinder:
1764         {
1765           return this.onTransact$registerBinder$(data, reply);
1766         }
1767         case TRANSACTION_getRecursiveBinder:
1768         {
1769           return this.onTransact$getRecursiveBinder$(data, reply);
1770         }
1771         case TRANSACTION_takesAnInterface:
1772         {
1773           return this.onTransact$takesAnInterface$(data, reply);
1774         }
1775         case TRANSACTION_takesAParcelable:
1776         {
1777           return this.onTransact$takesAParcelable$(data, reply);
1778         }
1779         default:
1780         {
1781           return super.onTransact(code, data, reply, flags);
1782         }
1783       }
1784     }
1785     private static class Proxy implements android.test.IExampleInterface
1786     {
1787       private android.os.IBinder mRemote;
1788       Proxy(android.os.IBinder remote)
1789       {
1790         mRemote = remote;
1791       }
1792       @Override public android.os.IBinder asBinder()
1793       {
1794         return mRemote;
1795       }
1796       public java.lang.String getInterfaceDescriptor()
1797       {
1798         return DESCRIPTOR;
1799       }
1800       @Override public boolean isEnabled() throws android.os.RemoteException
1801       {
1802         android.os.Parcel _data = android.os.Parcel.obtain();
1803         android.os.Parcel _reply = android.os.Parcel.obtain();
1804         boolean _result;
1805         try {
1806           _data.writeInterfaceToken(DESCRIPTOR);
1807           boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
1808           if (!_status && getDefaultImpl() != null) {
1809             return getDefaultImpl().isEnabled();
1810           }
1811           _reply.readException();
1812           _result = (0!=_reply.readInt());
1813         }
1814         finally {
1815           _reply.recycle();
1816           _data.recycle();
1817         }
1818         return _result;
1819       }
1820       @Override public int getState(int a, int b) throws android.os.RemoteException
1821       {
1822         android.os.Parcel _data = android.os.Parcel.obtain();
1823         android.os.Parcel _reply = android.os.Parcel.obtain();
1824         int _result;
1825         try {
1826           _data.writeInterfaceToken(DESCRIPTOR);
1827           _data.writeInt(a);
1828           _data.writeInt(b);
1829           boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
1830           if (!_status && getDefaultImpl() != null) {
1831             return getDefaultImpl().getState(a, b);
1832           }
1833           _reply.readException();
1834           _result = _reply.readInt();
1835         }
1836         finally {
1837           _reply.recycle();
1838           _data.recycle();
1839         }
1840         return _result;
1841       }
1842       @Override public java.lang.String getAddress() throws android.os.RemoteException
1843       {
1844         android.os.Parcel _data = android.os.Parcel.obtain();
1845         android.os.Parcel _reply = android.os.Parcel.obtain();
1846         java.lang.String _result;
1847         try {
1848           _data.writeInterfaceToken(DESCRIPTOR);
1849           boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
1850           if (!_status && getDefaultImpl() != null) {
1851             return getDefaultImpl().getAddress();
1852           }
1853           _reply.readException();
1854           _result = _reply.readString();
1855         }
1856         finally {
1857           _reply.recycle();
1858           _data.recycle();
1859         }
1860         return _result;
1861       }
1862       /* Test long comment */
1863       @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
1864       {
1865         android.os.Parcel _data = android.os.Parcel.obtain();
1866         android.os.Parcel _reply = android.os.Parcel.obtain();
1867         android.foo.ExampleParcelable[] _result;
1868         try {
1869           _data.writeInterfaceToken(DESCRIPTOR);
1870           boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
1871           if (!_status && getDefaultImpl() != null) {
1872             return getDefaultImpl().getParcelables();
1873           }
1874           _reply.readException();
1875           _result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
1876         }
1877         finally {
1878           _reply.recycle();
1879           _data.recycle();
1880         }
1881         return _result;
1882       }
1883       // Test short comment
1884 
1885       @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
1886       {
1887         android.os.Parcel _data = android.os.Parcel.obtain();
1888         android.os.Parcel _reply = android.os.Parcel.obtain();
1889         boolean _result;
1890         try {
1891           _data.writeInterfaceToken(DESCRIPTOR);
1892           _data.writeInt(mode);
1893           _data.writeInt(duration);
1894           boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
1895           if (!_status && getDefaultImpl() != null) {
1896             return getDefaultImpl().setScanMode(mode, duration);
1897           }
1898           _reply.readException();
1899           _result = (0!=_reply.readInt());
1900         }
1901         finally {
1902           _reply.recycle();
1903           _data.recycle();
1904         }
1905         return _result;
1906       }
1907       /* Test long comment */// And short comment
1908 
1909       @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
1910       {
1911         android.os.Parcel _data = android.os.Parcel.obtain();
1912         android.os.Parcel _reply = android.os.Parcel.obtain();
1913         try {
1914           _data.writeInterfaceToken(DESCRIPTOR);
1915           _data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
1916           boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
1917           if (!_status && getDefaultImpl() != null) {
1918             getDefaultImpl().registerBinder(foo);
1919             return;
1920           }
1921           _reply.readException();
1922         }
1923         finally {
1924           _reply.recycle();
1925           _data.recycle();
1926         }
1927       }
1928       @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
1929       {
1930         android.os.Parcel _data = android.os.Parcel.obtain();
1931         android.os.Parcel _reply = android.os.Parcel.obtain();
1932         android.test.IExampleInterface _result;
1933         try {
1934           _data.writeInterfaceToken(DESCRIPTOR);
1935           boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
1936           if (!_status && getDefaultImpl() != null) {
1937             return getDefaultImpl().getRecursiveBinder();
1938           }
1939           _reply.readException();
1940           _result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
1941         }
1942         finally {
1943           _reply.recycle();
1944           _data.recycle();
1945         }
1946         return _result;
1947       }
1948       @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
1949       {
1950         android.os.Parcel _data = android.os.Parcel.obtain();
1951         android.os.Parcel _reply = android.os.Parcel.obtain();
1952         int _result;
1953         try {
1954           _data.writeInterfaceToken(DESCRIPTOR);
1955           _data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
1956           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
1957           if (!_status && getDefaultImpl() != null) {
1958             return getDefaultImpl().takesAnInterface(arg);
1959           }
1960           _reply.readException();
1961           _result = _reply.readInt();
1962         }
1963         finally {
1964           _reply.recycle();
1965           _data.recycle();
1966         }
1967         return _result;
1968       }
1969       @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
1970       {
1971         android.os.Parcel _data = android.os.Parcel.obtain();
1972         android.os.Parcel _reply = android.os.Parcel.obtain();
1973         int _result;
1974         try {
1975           _data.writeInterfaceToken(DESCRIPTOR);
1976           if ((arg!=null)) {
1977             _data.writeInt(1);
1978             arg.writeToParcel(_data, 0);
1979           }
1980           else {
1981             _data.writeInt(0);
1982           }
1983           if ((arg2!=null)) {
1984             _data.writeInt(1);
1985             arg2.writeToParcel(_data, 0);
1986           }
1987           else {
1988             _data.writeInt(0);
1989           }
1990           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
1991           if (!_status && getDefaultImpl() != null) {
1992             return getDefaultImpl().takesAParcelable(arg, arg2);
1993           }
1994           _reply.readException();
1995           _result = _reply.readInt();
1996           if ((0!=_reply.readInt())) {
1997             arg2.readFromParcel(_reply);
1998           }
1999         }
2000         finally {
2001           _reply.recycle();
2002           _data.recycle();
2003         }
2004         return _result;
2005       }
2006       public static android.test.IExampleInterface sDefaultImpl;
2007     }
2008     static final int TRANSACTION_isEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
2009     static final int TRANSACTION_getState = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
2010     private boolean onTransact$getState$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2011     {
2012       data.enforceInterface(DESCRIPTOR);
2013       int _arg0;
2014       _arg0 = data.readInt();
2015       int _arg1;
2016       _arg1 = data.readInt();
2017       int _result = this.getState(_arg0, _arg1);
2018       reply.writeNoException();
2019       reply.writeInt(_result);
2020       return true;
2021     }
2022     static final int TRANSACTION_getAddress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
2023     static final int TRANSACTION_getParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
2024     static final int TRANSACTION_setScanMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
2025     private boolean onTransact$setScanMode$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2026     {
2027       data.enforceInterface(DESCRIPTOR);
2028       int _arg0;
2029       _arg0 = data.readInt();
2030       int _arg1;
2031       _arg1 = data.readInt();
2032       boolean _result = this.setScanMode(_arg0, _arg1);
2033       reply.writeNoException();
2034       reply.writeInt(((_result)?(1):(0)));
2035       return true;
2036     }
2037     static final int TRANSACTION_registerBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
2038     private boolean onTransact$registerBinder$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2039     {
2040       data.enforceInterface(DESCRIPTOR);
2041       android.bar.IAuxInterface _arg0;
2042       _arg0 = android.bar.IAuxInterface.Stub.asInterface(data.readStrongBinder());
2043       this.registerBinder(_arg0);
2044       reply.writeNoException();
2045       return true;
2046     }
2047     static final int TRANSACTION_getRecursiveBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
2048     private boolean onTransact$getRecursiveBinder$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2049     {
2050       data.enforceInterface(DESCRIPTOR);
2051       android.test.IExampleInterface _result = this.getRecursiveBinder();
2052       reply.writeNoException();
2053       reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null)));
2054       return true;
2055     }
2056     static final int TRANSACTION_takesAnInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
2057     private boolean onTransact$takesAnInterface$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2058     {
2059       data.enforceInterface(DESCRIPTOR);
2060       android.test.IAuxInterface2 _arg0;
2061       _arg0 = android.test.IAuxInterface2.Stub.asInterface(data.readStrongBinder());
2062       int _result = this.takesAnInterface(_arg0);
2063       reply.writeNoException();
2064       reply.writeInt(_result);
2065       return true;
2066     }
2067     static final int TRANSACTION_takesAParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
2068     private boolean onTransact$takesAParcelable$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2069     {
2070       data.enforceInterface(DESCRIPTOR);
2071       android.test.CompoundParcelable.Subclass1 _arg0;
2072       if ((0!=data.readInt())) {
2073         _arg0 = android.test.CompoundParcelable.Subclass1.CREATOR.createFromParcel(data);
2074       }
2075       else {
2076         _arg0 = null;
2077       }
2078       android.test.CompoundParcelable.Subclass2 _arg1;
2079       if ((0!=data.readInt())) {
2080         _arg1 = android.test.CompoundParcelable.Subclass2.CREATOR.createFromParcel(data);
2081       }
2082       else {
2083         _arg1 = null;
2084       }
2085       int _result = this.takesAParcelable(_arg0, _arg1);
2086       reply.writeNoException();
2087       reply.writeInt(_result);
2088       if ((_arg1!=null)) {
2089         reply.writeInt(1);
2090         _arg1.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2091       }
2092       else {
2093         reply.writeInt(0);
2094       }
2095       return true;
2096     }
2097     public static boolean setDefaultImpl(android.test.IExampleInterface impl) {
2098       if (Stub.Proxy.sDefaultImpl == null && impl != null) {
2099         Stub.Proxy.sDefaultImpl = impl;
2100         return true;
2101       }
2102       return false;
2103     }
2104     public static android.test.IExampleInterface getDefaultImpl() {
2105       return Stub.Proxy.sDefaultImpl;
2106     }
2107   }
2108   public static final int EXAMPLE_CONSTANT = 3;
2109   public boolean isEnabled() throws android.os.RemoteException;
2110   public int getState(int a, int b) throws android.os.RemoteException;
2111   public java.lang.String getAddress() throws android.os.RemoteException;
2112   /* Test long comment */
2113   public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException;
2114   // Test short comment
2115 
2116   public boolean setScanMode(int mode, int duration) throws android.os.RemoteException;
2117   /* Test long comment */// And short comment
2118 
2119   public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException;
2120   public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException;
2121   public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException;
2122   public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException;
2123 }
2124 )";
2125 
2126 const char kExpectedJavaOutputWithVersion[] =
2127     R"(/*
2128  * This file is auto-generated.  DO NOT MODIFY.
2129  */
2130 package android.test;
2131 public interface IExampleInterface extends android.os.IInterface
2132 {
2133   /**
2134    * The version of this interface that the caller is built against.
2135    * This might be different from what {@link #getInterfaceVersion()
2136    * getInterfaceVersion} returns as that is the version of the interface
2137    * that the remote object is implementing.
2138    */
2139   public static final int VERSION = 10;
2140   /** Default implementation for IExampleInterface. */
2141   public static class Default implements android.test.IExampleInterface
2142   {
2143     @Override public boolean isEnabled() throws android.os.RemoteException
2144     {
2145       return false;
2146     }
2147     @Override public int getState(int a, int b) throws android.os.RemoteException
2148     {
2149       return 0;
2150     }
2151     @Override public java.lang.String getAddress() throws android.os.RemoteException
2152     {
2153       return null;
2154     }
2155     /* Test long comment */
2156     @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
2157     {
2158       return null;
2159     }
2160     // Test short comment
2161 
2162     @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
2163     {
2164       return false;
2165     }
2166     /* Test long comment */// And short comment
2167 
2168     @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
2169     {
2170     }
2171     @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
2172     {
2173       return null;
2174     }
2175     @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
2176     {
2177       return 0;
2178     }
2179     @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
2180     {
2181       return 0;
2182     }
2183     @Override
2184     public int getInterfaceVersion() {
2185       return -1;
2186     }
2187     @Override
2188     public android.os.IBinder asBinder() {
2189       return null;
2190     }
2191   }
2192   /** Local-side IPC implementation stub class. */
2193   public static abstract class Stub extends android.os.Binder implements android.test.IExampleInterface
2194   {
2195     private static final java.lang.String DESCRIPTOR = "android.test.IExampleInterface";
2196     /** Construct the stub at attach it to the interface. */
2197     public Stub()
2198     {
2199       this.attachInterface(this, DESCRIPTOR);
2200     }
2201     /**
2202      * Cast an IBinder object into an android.test.IExampleInterface interface,
2203      * generating a proxy if needed.
2204      */
2205     public static android.test.IExampleInterface asInterface(android.os.IBinder obj)
2206     {
2207       if ((obj==null)) {
2208         return null;
2209       }
2210       android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
2211       if (((iin!=null)&&(iin instanceof android.test.IExampleInterface))) {
2212         return ((android.test.IExampleInterface)iin);
2213       }
2214       return new android.test.IExampleInterface.Stub.Proxy(obj);
2215     }
2216     @Override public android.os.IBinder asBinder()
2217     {
2218       return this;
2219     }
2220     @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
2221     {
2222       java.lang.String descriptor = DESCRIPTOR;
2223       switch (code)
2224       {
2225         case INTERFACE_TRANSACTION:
2226         {
2227           reply.writeString(descriptor);
2228           return true;
2229         }
2230         case TRANSACTION_isEnabled:
2231         {
2232           data.enforceInterface(descriptor);
2233           boolean _result = this.isEnabled();
2234           reply.writeNoException();
2235           reply.writeInt(((_result)?(1):(0)));
2236           return true;
2237         }
2238         case TRANSACTION_getState:
2239         {
2240           return this.onTransact$getState$(data, reply);
2241         }
2242         case TRANSACTION_getAddress:
2243         {
2244           data.enforceInterface(descriptor);
2245           java.lang.String _result = this.getAddress();
2246           reply.writeNoException();
2247           reply.writeString(_result);
2248           return true;
2249         }
2250         case TRANSACTION_getParcelables:
2251         {
2252           data.enforceInterface(descriptor);
2253           android.foo.ExampleParcelable[] _result = this.getParcelables();
2254           reply.writeNoException();
2255           reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2256           return true;
2257         }
2258         case TRANSACTION_setScanMode:
2259         {
2260           return this.onTransact$setScanMode$(data, reply);
2261         }
2262         case TRANSACTION_registerBinder:
2263         {
2264           return this.onTransact$registerBinder$(data, reply);
2265         }
2266         case TRANSACTION_getRecursiveBinder:
2267         {
2268           return this.onTransact$getRecursiveBinder$(data, reply);
2269         }
2270         case TRANSACTION_takesAnInterface:
2271         {
2272           return this.onTransact$takesAnInterface$(data, reply);
2273         }
2274         case TRANSACTION_takesAParcelable:
2275         {
2276           return this.onTransact$takesAParcelable$(data, reply);
2277         }
2278         case TRANSACTION_getInterfaceVersion:
2279         {
2280           data.enforceInterface(descriptor);
2281           reply.writeNoException();
2282           reply.writeInt(getInterfaceVersion());
2283           return true;
2284         }
2285         default:
2286         {
2287           return super.onTransact(code, data, reply, flags);
2288         }
2289       }
2290     }
2291     private static class Proxy implements android.test.IExampleInterface
2292     {
2293       private android.os.IBinder mRemote;
2294       Proxy(android.os.IBinder remote)
2295       {
2296         mRemote = remote;
2297       }
2298       private int mCachedVersion = -1;
2299       @Override public android.os.IBinder asBinder()
2300       {
2301         return mRemote;
2302       }
2303       public java.lang.String getInterfaceDescriptor()
2304       {
2305         return DESCRIPTOR;
2306       }
2307       @Override public boolean isEnabled() throws android.os.RemoteException
2308       {
2309         android.os.Parcel _data = android.os.Parcel.obtain();
2310         android.os.Parcel _reply = android.os.Parcel.obtain();
2311         boolean _result;
2312         try {
2313           _data.writeInterfaceToken(DESCRIPTOR);
2314           boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
2315           if (!_status && getDefaultImpl() != null) {
2316             return getDefaultImpl().isEnabled();
2317           }
2318           _reply.readException();
2319           _result = (0!=_reply.readInt());
2320         }
2321         finally {
2322           _reply.recycle();
2323           _data.recycle();
2324         }
2325         return _result;
2326       }
2327       @Override public int getState(int a, int b) throws android.os.RemoteException
2328       {
2329         android.os.Parcel _data = android.os.Parcel.obtain();
2330         android.os.Parcel _reply = android.os.Parcel.obtain();
2331         int _result;
2332         try {
2333           _data.writeInterfaceToken(DESCRIPTOR);
2334           _data.writeInt(a);
2335           _data.writeInt(b);
2336           boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
2337           if (!_status && getDefaultImpl() != null) {
2338             return getDefaultImpl().getState(a, b);
2339           }
2340           _reply.readException();
2341           _result = _reply.readInt();
2342         }
2343         finally {
2344           _reply.recycle();
2345           _data.recycle();
2346         }
2347         return _result;
2348       }
2349       @Override public java.lang.String getAddress() throws android.os.RemoteException
2350       {
2351         android.os.Parcel _data = android.os.Parcel.obtain();
2352         android.os.Parcel _reply = android.os.Parcel.obtain();
2353         java.lang.String _result;
2354         try {
2355           _data.writeInterfaceToken(DESCRIPTOR);
2356           boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
2357           if (!_status && getDefaultImpl() != null) {
2358             return getDefaultImpl().getAddress();
2359           }
2360           _reply.readException();
2361           _result = _reply.readString();
2362         }
2363         finally {
2364           _reply.recycle();
2365           _data.recycle();
2366         }
2367         return _result;
2368       }
2369       /* Test long comment */
2370       @Override public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException
2371       {
2372         android.os.Parcel _data = android.os.Parcel.obtain();
2373         android.os.Parcel _reply = android.os.Parcel.obtain();
2374         android.foo.ExampleParcelable[] _result;
2375         try {
2376           _data.writeInterfaceToken(DESCRIPTOR);
2377           boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
2378           if (!_status && getDefaultImpl() != null) {
2379             return getDefaultImpl().getParcelables();
2380           }
2381           _reply.readException();
2382           _result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
2383         }
2384         finally {
2385           _reply.recycle();
2386           _data.recycle();
2387         }
2388         return _result;
2389       }
2390       // Test short comment
2391 
2392       @Override public boolean setScanMode(int mode, int duration) throws android.os.RemoteException
2393       {
2394         android.os.Parcel _data = android.os.Parcel.obtain();
2395         android.os.Parcel _reply = android.os.Parcel.obtain();
2396         boolean _result;
2397         try {
2398           _data.writeInterfaceToken(DESCRIPTOR);
2399           _data.writeInt(mode);
2400           _data.writeInt(duration);
2401           boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
2402           if (!_status && getDefaultImpl() != null) {
2403             return getDefaultImpl().setScanMode(mode, duration);
2404           }
2405           _reply.readException();
2406           _result = (0!=_reply.readInt());
2407         }
2408         finally {
2409           _reply.recycle();
2410           _data.recycle();
2411         }
2412         return _result;
2413       }
2414       /* Test long comment */// And short comment
2415 
2416       @Override public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException
2417       {
2418         android.os.Parcel _data = android.os.Parcel.obtain();
2419         android.os.Parcel _reply = android.os.Parcel.obtain();
2420         try {
2421           _data.writeInterfaceToken(DESCRIPTOR);
2422           _data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
2423           boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
2424           if (!_status && getDefaultImpl() != null) {
2425             getDefaultImpl().registerBinder(foo);
2426             return;
2427           }
2428           _reply.readException();
2429         }
2430         finally {
2431           _reply.recycle();
2432           _data.recycle();
2433         }
2434       }
2435       @Override public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException
2436       {
2437         android.os.Parcel _data = android.os.Parcel.obtain();
2438         android.os.Parcel _reply = android.os.Parcel.obtain();
2439         android.test.IExampleInterface _result;
2440         try {
2441           _data.writeInterfaceToken(DESCRIPTOR);
2442           boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
2443           if (!_status && getDefaultImpl() != null) {
2444             return getDefaultImpl().getRecursiveBinder();
2445           }
2446           _reply.readException();
2447           _result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
2448         }
2449         finally {
2450           _reply.recycle();
2451           _data.recycle();
2452         }
2453         return _result;
2454       }
2455       @Override public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException
2456       {
2457         android.os.Parcel _data = android.os.Parcel.obtain();
2458         android.os.Parcel _reply = android.os.Parcel.obtain();
2459         int _result;
2460         try {
2461           _data.writeInterfaceToken(DESCRIPTOR);
2462           _data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
2463           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
2464           if (!_status && getDefaultImpl() != null) {
2465             return getDefaultImpl().takesAnInterface(arg);
2466           }
2467           _reply.readException();
2468           _result = _reply.readInt();
2469         }
2470         finally {
2471           _reply.recycle();
2472           _data.recycle();
2473         }
2474         return _result;
2475       }
2476       @Override public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException
2477       {
2478         android.os.Parcel _data = android.os.Parcel.obtain();
2479         android.os.Parcel _reply = android.os.Parcel.obtain();
2480         int _result;
2481         try {
2482           _data.writeInterfaceToken(DESCRIPTOR);
2483           if ((arg!=null)) {
2484             _data.writeInt(1);
2485             arg.writeToParcel(_data, 0);
2486           }
2487           else {
2488             _data.writeInt(0);
2489           }
2490           if ((arg2!=null)) {
2491             _data.writeInt(1);
2492             arg2.writeToParcel(_data, 0);
2493           }
2494           else {
2495             _data.writeInt(0);
2496           }
2497           boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
2498           if (!_status && getDefaultImpl() != null) {
2499             return getDefaultImpl().takesAParcelable(arg, arg2);
2500           }
2501           _reply.readException();
2502           _result = _reply.readInt();
2503           if ((0!=_reply.readInt())) {
2504             arg2.readFromParcel(_reply);
2505           }
2506         }
2507         finally {
2508           _reply.recycle();
2509           _data.recycle();
2510         }
2511         return _result;
2512       }
2513       @Override
2514       public int getInterfaceVersion() throws android.os.RemoteException {
2515         if (mCachedVersion == -1) {
2516           android.os.Parcel data = android.os.Parcel.obtain();
2517           android.os.Parcel reply = android.os.Parcel.obtain();
2518           try {
2519             data.writeInterfaceToken(DESCRIPTOR);
2520             mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
2521             reply.readException();
2522             mCachedVersion = reply.readInt();
2523           } finally {
2524             reply.recycle();
2525             data.recycle();
2526           }
2527         }
2528         return mCachedVersion;
2529       }
2530       public static android.test.IExampleInterface sDefaultImpl;
2531     }
2532     static final int TRANSACTION_isEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
2533     static final int TRANSACTION_getState = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
2534     private boolean onTransact$getState$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2535     {
2536       data.enforceInterface(DESCRIPTOR);
2537       int _arg0;
2538       _arg0 = data.readInt();
2539       int _arg1;
2540       _arg1 = data.readInt();
2541       int _result = this.getState(_arg0, _arg1);
2542       reply.writeNoException();
2543       reply.writeInt(_result);
2544       return true;
2545     }
2546     static final int TRANSACTION_getAddress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
2547     static final int TRANSACTION_getParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
2548     static final int TRANSACTION_setScanMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
2549     private boolean onTransact$setScanMode$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2550     {
2551       data.enforceInterface(DESCRIPTOR);
2552       int _arg0;
2553       _arg0 = data.readInt();
2554       int _arg1;
2555       _arg1 = data.readInt();
2556       boolean _result = this.setScanMode(_arg0, _arg1);
2557       reply.writeNoException();
2558       reply.writeInt(((_result)?(1):(0)));
2559       return true;
2560     }
2561     static final int TRANSACTION_registerBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
2562     private boolean onTransact$registerBinder$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2563     {
2564       data.enforceInterface(DESCRIPTOR);
2565       android.bar.IAuxInterface _arg0;
2566       _arg0 = android.bar.IAuxInterface.Stub.asInterface(data.readStrongBinder());
2567       this.registerBinder(_arg0);
2568       reply.writeNoException();
2569       return true;
2570     }
2571     static final int TRANSACTION_getRecursiveBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
2572     private boolean onTransact$getRecursiveBinder$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2573     {
2574       data.enforceInterface(DESCRIPTOR);
2575       android.test.IExampleInterface _result = this.getRecursiveBinder();
2576       reply.writeNoException();
2577       reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null)));
2578       return true;
2579     }
2580     static final int TRANSACTION_takesAnInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
2581     private boolean onTransact$takesAnInterface$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2582     {
2583       data.enforceInterface(DESCRIPTOR);
2584       android.test.IAuxInterface2 _arg0;
2585       _arg0 = android.test.IAuxInterface2.Stub.asInterface(data.readStrongBinder());
2586       int _result = this.takesAnInterface(_arg0);
2587       reply.writeNoException();
2588       reply.writeInt(_result);
2589       return true;
2590     }
2591     static final int TRANSACTION_takesAParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
2592     private boolean onTransact$takesAParcelable$(android.os.Parcel data, android.os.Parcel reply) throws android.os.RemoteException
2593     {
2594       data.enforceInterface(DESCRIPTOR);
2595       android.test.CompoundParcelable.Subclass1 _arg0;
2596       if ((0!=data.readInt())) {
2597         _arg0 = android.test.CompoundParcelable.Subclass1.CREATOR.createFromParcel(data);
2598       }
2599       else {
2600         _arg0 = null;
2601       }
2602       android.test.CompoundParcelable.Subclass2 _arg1;
2603       if ((0!=data.readInt())) {
2604         _arg1 = android.test.CompoundParcelable.Subclass2.CREATOR.createFromParcel(data);
2605       }
2606       else {
2607         _arg1 = null;
2608       }
2609       int _result = this.takesAParcelable(_arg0, _arg1);
2610       reply.writeNoException();
2611       reply.writeInt(_result);
2612       if ((_arg1!=null)) {
2613         reply.writeInt(1);
2614         _arg1.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2615       }
2616       else {
2617         reply.writeInt(0);
2618       }
2619       return true;
2620     }
2621     static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
2622     public static boolean setDefaultImpl(android.test.IExampleInterface impl) {
2623       if (Stub.Proxy.sDefaultImpl == null && impl != null) {
2624         Stub.Proxy.sDefaultImpl = impl;
2625         return true;
2626       }
2627       return false;
2628     }
2629     public static android.test.IExampleInterface getDefaultImpl() {
2630       return Stub.Proxy.sDefaultImpl;
2631     }
2632   }
2633   public static final int EXAMPLE_CONSTANT = 3;
2634   public boolean isEnabled() throws android.os.RemoteException;
2635   public int getState(int a, int b) throws android.os.RemoteException;
2636   public java.lang.String getAddress() throws android.os.RemoteException;
2637   /* Test long comment */
2638   public android.foo.ExampleParcelable[] getParcelables() throws android.os.RemoteException;
2639   // Test short comment
2640 
2641   public boolean setScanMode(int mode, int duration) throws android.os.RemoteException;
2642   /* Test long comment */// And short comment
2643 
2644   public void registerBinder(android.bar.IAuxInterface foo) throws android.os.RemoteException;
2645   public android.test.IExampleInterface getRecursiveBinder() throws android.os.RemoteException;
2646   public int takesAnInterface(android.test.IAuxInterface2 arg) throws android.os.RemoteException;
2647   public int takesAParcelable(android.test.CompoundParcelable.Subclass1 arg, android.test.CompoundParcelable.Subclass2 arg2) throws android.os.RemoteException;
2648   public int getInterfaceVersion() throws android.os.RemoteException;
2649 }
2650 )";
2651 
2652 }  // namespace example_interface
2653 }  // namespace test_data
2654 }  // namespace aidl
2655 }  // namespace android
2656