Java Code Examples for android.os.IBinder.queryLocalInterface()

The following are Jave code examples for showing how to use queryLocalInterface() of the android.os.IBinder class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: springreplugin   File: ServiceWrapper.java   View Source Code Vote up 6 votes
public static IBinder factory(Context context, String name, IBinder binder) {
    String descriptor = null;
    try {
        descriptor = binder.getInterfaceDescriptor();
    } catch (RemoteException e) {
        if (DEBUG) {
            Log.d(TAG, "getInterfaceDescriptor()", e);
        }
    }
    android.os.IInterface iin = binder.queryLocalInterface(descriptor);
    if (iin != null) {
        /**
         * If the requested interface has local implementation, meaning that
         * it's living in the same process as the one who requests for it,
         * return the binder directly since in such cases our wrapper does
         * not help in any way.
         */
        return binder;
    }
    return new ServiceWrapper(context, name, binder);
}
 
Example 2
Project: airgram   File: ICustomTabsCallback.java   View Source Code Vote up 5 votes
public static ICustomTabsCallback asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    } else {
        IInterface iin = obj.queryLocalInterface("android.support.customtabs.ICustomTabsCallback");
        return (iin != null && iin instanceof ICustomTabsCallback ? (ICustomTabsCallback) iin : new ICustomTabsCallback.Stub.Proxy(obj));
    }
}
 
Example 3
Project: boohee_v5.6   File: IXiaomiAuthService.java   View Source Code Vote up 5 votes
public static IXiaomiAuthService asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IXiaomiAuthService)) {
        return new Proxy(obj);
    }
    return (IXiaomiAuthService) iin;
}
 
Example 4
Project: letv   File: IApkManager.java   View Source Code Vote up 5 votes
public static IApkManager asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IApkManager)) {
        return new Proxy(obj);
    }
    return (IApkManager) iin;
}
 
Example 5
Project: boohee_v5.6   File: INotificationSideChannel.java   View Source Code Vote up 5 votes
public static INotificationSideChannel asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof INotificationSideChannel)) {
        return new Proxy(obj);
    }
    return (INotificationSideChannel) iin;
}
 
Example 6
Project: letv   File: RemoteDeviceManager.java   View Source Code Vote up 5 votes
public static RemoteDeviceManager asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof RemoteDeviceManager)) {
        return new Proxy(obj);
    }
    return (RemoteDeviceManager) iin;
}
 
Example 7
Project: letv   File: DeviceCallback.java   View Source Code Vote up 5 votes
public static DeviceCallback asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof DeviceCallback)) {
        return new Proxy(obj);
    }
    return (DeviceCallback) iin;
}
 
Example 8
Project: letv   File: ICdeBinder.java   View Source Code Vote up 5 votes
public static ICdeBinder asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof ICdeBinder)) {
        return new Proxy(obj);
    }
    return (ICdeBinder) iin;
}
 
Example 9
Project: letv   File: AIDLService.java   View Source Code Vote up 5 votes
public static AIDLService asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof AIDLService)) {
        return new Proxy(obj);
    }
    return (AIDLService) iin;
}
 
Example 10
Project: letv   File: AIDLActivity.java   View Source Code Vote up 5 votes
public static AIDLActivity asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof AIDLActivity)) {
        return new Proxy(obj);
    }
    return (AIDLActivity) iin;
}
 
Example 11
Project: letv   File: TmsCallbackStub.java   View Source Code Vote up 5 votes
public static ITmsCallback asInterface(IBinder binder) {
    if (binder == null) {
        return null;
    }
    IInterface iInterface = binder.queryLocalInterface(ITmsCallback.DESCRIPTOR);
    if (iInterface == null || !(iInterface instanceof ITmsCallback)) {
        return new TmsCallbackProxy(binder);
    }
    return (ITmsCallback) iInterface;
}
 
Example 12
Project: letv   File: RubbishScanListenerStub.java   View Source Code Vote up 5 votes
public static IRubbishScanListener asInterface(IBinder binder) {
    if (binder == null) {
        return null;
    }
    IInterface iInterface = binder.queryLocalInterface(DESCRIPTOR);
    if (iInterface == null || !(iInterface instanceof IRubbishScanListener)) {
        return new RubbishScanListenerProxy(binder);
    }
    return (IRubbishScanListener) iInterface;
}
 
Example 13
Project: letv   File: IResultReceiver.java   View Source Code Vote up 5 votes
public static IResultReceiver asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IResultReceiver)) {
        return new Proxy(obj);
    }
    return (IResultReceiver) iin;
}
 
Example 14
Project: boohee_v5.6   File: IXiaomiAuthService.java   View Source Code Vote up 5 votes
public static IXiaomiAuthService asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IXiaomiAuthService)) {
        return new Proxy(obj);
    }
    return (IXiaomiAuthService) iin;
}
 
Example 15
Project: boohee_v5.6   File: IResultReceiver.java   View Source Code Vote up 5 votes
public static IResultReceiver asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IResultReceiver)) {
        return new Proxy(obj);
    }
    return (IResultReceiver) iin;
}
 
Example 16
Project: letv   File: IMediaControllerCallback.java   View Source Code Vote up 5 votes
public static IMediaControllerCallback asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IMediaControllerCallback)) {
        return new Proxy(obj);
    }
    return (IMediaControllerCallback) iin;
}
 
Example 17
Project: letv   File: c.java   View Source Code Vote up 5 votes
public static b a(IBinder iBinder) {
    if (iBinder == null) {
        return null;
    }
    IInterface queryLocalInterface = iBinder.queryLocalInterface(z);
    return (queryLocalInterface == null || !(queryLocalInterface instanceof b)) ? new d(iBinder) : (b) queryLocalInterface;
}
 
Example 18
Project: boohee_v5.6   File: IMediaControllerCallback.java   View Source Code Vote up 5 votes
public static IMediaControllerCallback asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    }
    IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
    if (iin == null || !(iin instanceof IMediaControllerCallback)) {
        return new Proxy(obj);
    }
    return (IMediaControllerCallback) iin;
}
 
Example 19
Project: PlusGram   File: ICustomTabsCallback.java   View Source Code Vote up 5 votes
public static ICustomTabsCallback asInterface(IBinder obj) {
    if (obj == null) {
        return null;
    } else {
        IInterface iin = obj.queryLocalInterface("android.support.customtabs.ICustomTabsCallback");
        return (iin != null && iin instanceof ICustomTabsCallback ? (ICustomTabsCallback) iin : new Proxy(obj));
    }
}
 
Example 20
Project: boohee_v5.6   File: RemoteSSO.java   View Source Code Vote up 5 votes
public static RemoteSSO asInterface(IBinder iBinder) {
    if (iBinder == null) {
        return null;
    }
    IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
    return (queryLocalInterface == null || !(queryLocalInterface instanceof RemoteSSO)) ?
            new Proxy(iBinder) : (RemoteSSO) queryLocalInterface;
}