package com.share.connect.wifip2p;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import com.share.connect.wifip2p.WifiP2pObserver;

public interface IWifiP2p extends IInterface {

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

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

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

        @Override // com.share.connect.wifip2p.IWifiP2p
        public void connectGroupOwner(String str, String str2, String str3, int i) throws RemoteException {
        }

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

        @Override // com.share.connect.wifip2p.IWifiP2p
        public boolean isUserClose() throws RemoteException {
            return false;
        }

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

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

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

    public static abstract class b extends Binder implements IWifiP2p {

        /* renamed from: a  reason: collision with root package name */
        private static final String f198a = "com.share.connect.wifip2p.IWifiP2p";
        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 class a implements IWifiP2p {
            public static IWifiP2p b;

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

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

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

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

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

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

            @Override // com.share.connect.wifip2p.IWifiP2p
            public void connectGroupOwner(String str, String str2, String str3, int i) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f198a);
                    obtain.writeString(str);
                    obtain.writeString(str2);
                    obtain.writeString(str3);
                    obtain.writeInt(i);
                    if (this.f199a.transact(4, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().connectGroupOwner(str, str2, str3, i);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.IWifiP2p
            public void createGroupForClient(int i, String str, int i2) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f198a);
                    obtain.writeInt(i);
                    obtain.writeString(str);
                    obtain.writeInt(i2);
                    if (this.f199a.transact(3, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().createGroupForClient(i, str, i2);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.IWifiP2p
            public boolean isUserClose() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f198a);
                    boolean z = false;
                    if (!this.f199a.transact(6, obtain, obtain2, 0) && b.a() != null) {
                        return b.a().isUserClose();
                    }
                    obtain2.readException();
                    if (obtain2.readInt() != 0) {
                        z = true;
                    }
                    obtain2.recycle();
                    obtain.recycle();
                    return z;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.IWifiP2p
            public void open() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f198a);
                    if (this.f199a.transact(1, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().open();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.IWifiP2p
            public void registerWifiP2pObserver(WifiP2pObserver wifiP2pObserver) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f198a);
                    obtain.writeStrongBinder(wifiP2pObserver != null ? wifiP2pObserver.asBinder() : null);
                    if (this.f199a.transact(7, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().registerWifiP2pObserver(wifiP2pObserver);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override // com.share.connect.wifip2p.IWifiP2p
            public void unregisterWifiP2pObserver(WifiP2pObserver wifiP2pObserver) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(b.f198a);
                    obtain.writeStrongBinder(wifiP2pObserver != null ? wifiP2pObserver.asBinder() : null);
                    if (this.f199a.transact(8, obtain, obtain2, 0) || b.a() == null) {
                        obtain2.readException();
                    } else {
                        b.a().unregisterWifiP2pObserver(wifiP2pObserver);
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }
        }

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

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

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

        public static boolean a(IWifiP2p iWifiP2p) {
            if (a.b != null) {
                throw new IllegalStateException("setDefaultImpl() called twice");
            } else if (iWifiP2p == null) {
                return false;
            } else {
                a.b = iWifiP2p;
                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(f198a);
                        open();
                        parcel2.writeNoException();
                        return true;
                    case 2:
                        parcel.enforceInterface(f198a);
                        close();
                        parcel2.writeNoException();
                        return true;
                    case 3:
                        parcel.enforceInterface(f198a);
                        createGroupForClient(parcel.readInt(), parcel.readString(), parcel.readInt());
                        parcel2.writeNoException();
                        return true;
                    case 4:
                        parcel.enforceInterface(f198a);
                        connectGroupOwner(parcel.readString(), parcel.readString(), parcel.readString(), parcel.readInt());
                        parcel2.writeNoException();
                        return true;
                    case 5:
                        parcel.enforceInterface(f198a);
                        cancelConnect();
                        parcel2.writeNoException();
                        return true;
                    case 6:
                        parcel.enforceInterface(f198a);
                        boolean isUserClose = isUserClose();
                        parcel2.writeNoException();
                        parcel2.writeInt(isUserClose ? 1 : 0);
                        return true;
                    case 7:
                        parcel.enforceInterface(f198a);
                        registerWifiP2pObserver(WifiP2pObserver.b.a(parcel.readStrongBinder()));
                        parcel2.writeNoException();
                        return true;
                    case 8:
                        parcel.enforceInterface(f198a);
                        unregisterWifiP2pObserver(WifiP2pObserver.b.a(parcel.readStrongBinder()));
                        parcel2.writeNoException();
                        return true;
                    default:
                        return super.onTransact(i2, parcel, parcel2, i3);
                }
            } else {
                parcel2.writeString(f198a);
                return true;
            }
        }
    }

    void cancelConnect() throws RemoteException;

    void close() throws RemoteException;

    void connectGroupOwner(String str, String str2, String str3, int i) throws RemoteException;

    void createGroupForClient(int i, String str, int i2) throws RemoteException;

    boolean isUserClose() throws RemoteException;

    void open() throws RemoteException;

    void registerWifiP2pObserver(WifiP2pObserver wifiP2pObserver) throws RemoteException;

    void unregisterWifiP2pObserver(WifiP2pObserver wifiP2pObserver) throws RemoteException;
}
