package com.share.connect.wifip2p;

import android.net.wifi.p2p.WifiP2pGroup;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

public interface WifiP2pObserver extends IInterface {

    public static class a implements WifiP2pObserver {
        public IBinder asBinder() {
            return null;
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onAcceptFailed() throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onConnectFailed() throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onConnected() throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onCreateGroupFailed() throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onDeviceChanged(String str) throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onDisconnected(boolean z) throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onGroupCreated(WifiP2pGroup wifiP2pGroup, int i) throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onOpenFailed() throws RemoteException {
        }

        @Override // com.share.connect.wifip2p.WifiP2pObserver
        public void onOpenSuccess(String str, int i) throws RemoteException {
        }
    }

    public static abstract class b extends Binder implements WifiP2pObserver {

        /* renamed from: a  reason: collision with root package name */
        private static final String f200a = "com.share.connect.wifip2p.WifiP2pObserver";
        public static final int b = 1;
        public static final int c = 2;
        public static final int d = 3;
        public static final int e = 4;
        public static final int f = 5;
        public static final int g = 6;
        public static final int h = 7;
        public static final int i = 8;
        public static final int j = 9;

        public static class a implements WifiP2pObserver {
            public static WifiP2pObserver b;

            /* renamed from: a  reason: collision with root package name */
            private IBinder f201a;

            public a(IBinder iBinder) {
                this.f201a = iBinder;
            }

            public String a() {
                return b.f200a;
            }

            public IBinder asBinder() {
                return this.f201a;
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onAcceptFailed() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    if (this.f201a.transact(8, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onAcceptFailed();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onConnectFailed() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    if (this.f201a.transact(9, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onConnectFailed();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onConnected() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    if (this.f201a.transact(5, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onConnected();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onCreateGroupFailed() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    if (this.f201a.transact(7, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onCreateGroupFailed();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onDeviceChanged(String str) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    obtain.writeString(str);
                    if (this.f201a.transact(3, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onDeviceChanged(str);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onDisconnected(boolean z) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    obtain.writeInt(z ? 1 : 0);
                    if (this.f201a.transact(6, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onDisconnected(z);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onGroupCreated(WifiP2pGroup wifiP2pGroup, int i) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    if (wifiP2pGroup != null) {
                        obtain.writeInt(1);
                        wifiP2pGroup.writeToParcel(obtain, 0);
                    } else {
                        obtain.writeInt(0);
                    }
                    obtain.writeInt(i);
                    if (this.f201a.transact(4, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onGroupCreated(wifiP2pGroup, i);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onOpenFailed() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    if (this.f201a.transact(2, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onOpenFailed();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.WifiP2pObserver
            public void onOpenSuccess(String str, int i) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f200a);
                    obtain.writeString(str);
                    obtain.writeInt(i);
                    if (this.f201a.transact(1, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().onOpenSuccess(str, i);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }
        }

        public b() {
            attachInterface(this, f200a);
        }

        public static WifiP2pObserver a() {
            return a.b;
        }

        public static WifiP2pObserver a(IBinder iBinder) {
            if (iBinder == null) {
                return null;
            }
            IInterface queryLocalInterface = iBinder.queryLocalInterface(f200a);
            return (queryLocalInterface == null || !(queryLocalInterface instanceof WifiP2pObserver)) ? new a(iBinder) : (WifiP2pObserver) queryLocalInterface;
        }

        public static boolean a(WifiP2pObserver wifiP2pObserver) {
            if (a.b != null) {
                throw new IllegalStateException("setDefaultImpl() called twice");
            } else if (wifiP2pObserver == null) {
                return false;
            } else {
                a.b = wifiP2pObserver;
                return true;
            }
        }

        public IBinder asBinder() {
            return this;
        }

        @Override // android.os.Binder
        public boolean onTransact(int i2, Parcel parcel, Parcel parcel2, int i3) throws RemoteException {
            if (i2 != 1598968902) {
                switch (i2) {
                    case 1:
                        parcel.enforceInterface(f200a);
                        onOpenSuccess(parcel.readString(), parcel.readInt());
                        break;
                    case 2:
                        parcel.enforceInterface(f200a);
                        onOpenFailed();
                        break;
                    case 3:
                        parcel.enforceInterface(f200a);
                        onDeviceChanged(parcel.readString());
                        break;
                    case 4:
                        parcel.enforceInterface(f200a);
                        onGroupCreated(parcel.readInt() != 0 ? (WifiP2pGroup) WifiP2pGroup.CREATOR.createFromParcel(parcel) : null, parcel.readInt());
                        break;
                    case 5:
                        parcel.enforceInterface(f200a);
                        onConnected();
                        break;
                    case 6:
                        parcel.enforceInterface(f200a);
                        onDisconnected(parcel.readInt() != 0);
                        break;
                    case 7:
                        parcel.enforceInterface(f200a);
                        onCreateGroupFailed();
                        break;
                    case 8:
                        parcel.enforceInterface(f200a);
                        onAcceptFailed();
                        break;
                    case 9:
                        parcel.enforceInterface(f200a);
                        onConnectFailed();
                        break;
                    default:
                        return super.onTransact(i2, parcel, parcel2, i3);
                }
                parcel2.writeNoException();
                return true;
            }
            parcel2.writeString(f200a);
            return true;
        }
    }

    void onAcceptFailed() throws RemoteException;

    void onConnectFailed() throws RemoteException;

    void onConnected() throws RemoteException;

    void onCreateGroupFailed() throws RemoteException;

    void onDeviceChanged(String str) throws RemoteException;

    void onDisconnected(boolean z) throws RemoteException;

    void onGroupCreated(WifiP2pGroup wifiP2pGroup, int i) throws RemoteException;

    void onOpenFailed() throws RemoteException;

    void onOpenSuccess(String str, int i) throws RemoteException;
}
