Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.98 KB | None | 0 0
  1. public interface IStudyCallbackClient extends android.os.IInterface {
  2.     /** Default implementation for IStudyCallbackClient. */
  3.     public static class Default implements com.example.proxytest.IStudyCallbackClient {
  4.         /**
  5.          * Demonstrates some basic types that you can use as parameters and return
  6.          * values in AIDL.
  7.          */
  8.         @Override
  9.         public void sendPoint(int x, int y) throws android.os.RemoteException {
  10.         }
  11.  
  12.         @Override
  13.         public android.os.IBinder asBinder() {
  14.             return null;
  15.         }
  16.     }
  17.  
  18.     /** Local-side IPC implementation stub class. */
  19.     public static abstract class Stub extends android.os.Binder implements com.example.proxytest.IStudyCallbackClient {
  20.         private static final java.lang.String DESCRIPTOR = "***.IStudyCallbackClient";
  21.  
  22.         /** Construct the stub at attach it to the interface. */
  23.         public Stub() {
  24.             this.attachInterface(this, DESCRIPTOR);
  25.         }
  26.  
  27.         /**
  28.          * Cast an IBinder object into an com.example.proxytest.IStudyCallbackClient
  29.          * interface, generating a proxy if needed.
  30.          */
  31.         public static com.example.proxytest.IStudyCallbackClient asInterface(android.os.IBinder obj) {
  32.             if ((obj == null)) {
  33.                 return null;
  34.             }
  35.             android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
  36.             if (((iin != null) && (iin instanceof com.example.proxytest.IStudyCallbackClient))) {
  37.                 return ((com.example.proxytest.IStudyCallbackClient) iin);
  38.             }
  39.             return new com.example.proxytest.IStudyCallbackClient.Stub.Proxy(obj);
  40.         }
  41.  
  42.         @Override
  43.         public android.os.IBinder asBinder() {
  44.             return this;
  45.         }
  46.  
  47.         @Override
  48.         public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags)
  49.                 throws android.os.RemoteException {
  50.             java.lang.String descriptor = DESCRIPTOR;
  51.             switch (code) {
  52.             case INTERFACE_TRANSACTION: {
  53.                 reply.writeString(descriptor);
  54.                 return true;
  55.             }
  56.             case TRANSACTION_sendPoint: {
  57.                 data.enforceInterface(descriptor);
  58.                 int _arg0;
  59.                 _arg0 = data.readInt();
  60.                 int _arg1;
  61.                 _arg1 = data.readInt();
  62.                 this.sendPoint(_arg0, _arg1);
  63.                 reply.writeNoException();
  64.                 return true;
  65.             }
  66.             default: {
  67.                 return super.onTransact(code, data, reply, flags);
  68.             }
  69.             }
  70.         }
  71.  
  72.         private static class Proxy implements com.example.proxytest.IStudyCallbackClient {
  73.             private android.os.IBinder mRemote;
  74.  
  75.             Proxy(android.os.IBinder remote) {
  76.                 mRemote = remote;
  77.             }
  78.  
  79.             @Override
  80.             public android.os.IBinder asBinder() {
  81.                 return mRemote;
  82.             }
  83.  
  84.             public java.lang.String getInterfaceDescriptor() {
  85.                 return DESCRIPTOR;
  86.             }
  87.  
  88.             /**
  89.              * Demonstrates some basic types that you can use as parameters and return
  90.              * values in AIDL.
  91.              */
  92.             @Override
  93.             public void sendPoint(int x, int y) throws android.os.RemoteException {
  94.                 android.os.Parcel _data = android.os.Parcel.obtain();
  95.                 android.os.Parcel _reply = android.os.Parcel.obtain();
  96.                 try {
  97.                     _data.writeInterfaceToken(DESCRIPTOR);
  98.                     _data.writeInt(x);
  99.                     _data.writeInt(y);
  100.                     boolean _status = mRemote.transact(Stub.TRANSACTION_sendPoint, _data, _reply, 0);
  101.                     if (!_status && getDefaultImpl() != null) {
  102.                         getDefaultImpl().sendPoint(x, y);
  103.                         return;
  104.                     }
  105.                     _reply.readException();
  106.                 } finally {
  107.                     _reply.recycle();
  108.                     _data.recycle();
  109.                 }
  110.             }
  111.  
  112.             public static com.example.proxytest.IStudyCallbackClient sDefaultImpl;
  113.         }
  114.  
  115.         static final int TRANSACTION_sendPoint = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
  116.  
  117.         public static boolean setDefaultImpl(com.example.proxytest.IStudyCallbackClient impl) {
  118.             if (Stub.Proxy.sDefaultImpl == null && impl != null) {
  119.                 Stub.Proxy.sDefaultImpl = impl;
  120.                 return true;
  121.             }
  122.             return false;
  123.         }
  124.  
  125.         public static com.example.proxytest.IStudyCallbackClient getDefaultImpl() {
  126.             return Stub.Proxy.sDefaultImpl;
  127.         }
  128.     }
  129.  
  130.     /**
  131.      * Demonstrates some basic types that you can use as parameters and return
  132.      * values in AIDL.
  133.      */
  134.     public void sendPoint(int x, int y) throws android.os.RemoteException;
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement