content: /*
   * Copyright 2023 The Android Open Source Project
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  /*
   * This file is auto-generated, but forcefully inserted here for testing purpose.
   */
  package android.health.connect.aidl;
  
  /** A callback for any error encountered by. */
  public interface IMigrationCallback extends android.os.IInterface
  {
      /** Default implementation for IMigrationCallback. */
      public static class Default implements IMigrationCallback
      {
          // Called when the batch is successfully saved
          @Override public void onSuccess() throws android.os.RemoteException
          {
          }
          // Called when an error is hit during the migration process
          @Override public void onError(android.health.connect.migration.MigrationException exception) throws android.os.RemoteException
          {
          }
          @Override
          public android.os.IBinder asBinder() {
              return null;
          }
      }
      /** Local-side IPC implementation stub class. */
      public static abstract class Stub extends android.os.Binder implements IMigrationCallback
      {
          /** Construct the stub at attach it to the interface. */
          public Stub()
          {
              this.attachInterface(this, DESCRIPTOR);
          }
          /**
           * Cast an IBinder object into an android.health.connect.aidl.IMigrationCallback interface,
           * generating a proxy if needed.
           */
          public static IMigrationCallback asInterface(android.os.IBinder obj)
          {
              if ((obj==null)) {
                  return null;
              }
              android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
              if (((iin!=null)&&(iin instanceof IMigrationCallback))) {
                  return ((IMigrationCallback)iin);
              }
              return new Proxy(obj);
          }
          @Override public android.os.IBinder asBinder()
          {
              return this;
          }
          @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
          {
              String descriptor = DESCRIPTOR;
              if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
                  data.enforceInterface(descriptor);
              }
              switch (code)
              {
                  case INTERFACE_TRANSACTION:
                  {
                      reply.writeString(descriptor);
                      return true;
                  }
              }
              switch (code)
              {
                  case TRANSACTION_onSuccess:
                  {
                      this.onSuccess();
                      break;
                  }
                  case TRANSACTION_onError:
                  {
                      android.health.connect.migration.MigrationException _arg0;
                      _arg0 = _Parcel.readTypedObject(data, android.health.connect.migration.MigrationException.CREATOR);
                      this.onError(_arg0);
                      break;
                  }
                  default:
                  {
                      return super.onTransact(code, data, reply, flags);
                  }
              }
              return true;
          }
          private static class Proxy implements IMigrationCallback
          {
              private android.os.IBinder mRemote;
              Proxy(android.os.IBinder remote)
              {
                  mRemote = remote;
              }
              @Override public android.os.IBinder asBinder()
              {
                  return mRemote;
              }
              public String getInterfaceDescriptor()
              {
                  return DESCRIPTOR;
              }
              // Called when the batch is successfully saved
              @Override public void onSuccess() throws android.os.RemoteException
              {
                  android.os.Parcel _data = android.os.Parcel.obtain();
                  try {
                      _data.writeInterfaceToken(DESCRIPTOR);
                      boolean _status = mRemote.transact(Stub.TRANSACTION_onSuccess, _data, null, android.os.IBinder.FLAG_ONEWAY);
                  }
                  finally {
                      _data.recycle();
                  }
              }
              // Called when an error is hit during the migration process
              @Override public void onError(android.health.connect.migration.MigrationException exception) throws android.os.RemoteException
              {
                  android.os.Parcel _data = android.os.Parcel.obtain();
                  try {
                      _data.writeInterfaceToken(DESCRIPTOR);
                      _Parcel.writeTypedObject(_data, exception, 0);
                      boolean _status = mRemote.transact(Stub.TRANSACTION_onError, _data, null, android.os.IBinder.FLAG_ONEWAY);
                  }
                  finally {
                      _data.recycle();
                  }
              }
          }
          static final int TRANSACTION_onSuccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
          static final int TRANSACTION_onError = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
      }
      public static final String DESCRIPTOR = "android.health.connect.aidl.IMigrationCallback";
      // Called when the batch is successfully saved
      public void onSuccess() throws android.os.RemoteException;
      // Called when an error is hit during the migration process
      public void onError(android.health.connect.migration.MigrationException exception) throws android.os.RemoteException;
      /** @hide */
      static class _Parcel {
          static private <T> T readTypedObject(
                  android.os.Parcel parcel,
                  android.os.Parcelable.Creator<T> c) {
              if (parcel.readInt() != 0) {
                  return c.createFromParcel(parcel);
              } else {
                  return null;
              }
          }
          static private <T extends android.os.Parcelable> void writeTypedObject(
                  android.os.Parcel parcel, T value, int parcelableFlags) {
              if (value != null) {
                  parcel.writeInt(1);
                  value.writeToParcel(parcel, parcelableFlags);
              } else {
                  parcel.writeInt(0);
              }
          }
      }
  }
  