Java Code Examples for android.os.IBinder

The following are top voted examples for showing how to use android.os.IBinder. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: SliderPreferenceEmbedded   File: PopupIndicator.java   View source code 6 votes vote down vote up
public void showIndicator(View parent, Rect touchBounds) {
    if (isShowing()) {
        mPopupView.mMarker.animateOpen();
        return;
    }

    IBinder windowToken = parent.getWindowToken();
    if (windowToken != null) {
        WindowManager.LayoutParams p = createPopupLayout(windowToken);

        p.gravity = Gravity.TOP | GravityCompat.START;
        updateLayoutParamsForPosiion(parent, p, touchBounds.bottom);
        mShowing = true;

        translateViewIntoPosition(touchBounds.centerX());
        invokePopup(p);
    }
}
 
Example 2
Project: InputMethodHolder   File: InputMethodManagerHook.java   View source code 6 votes vote down vote up
@Override
public void onHook(ClassLoader classLoader) throws Throwable {
    //其实有其他的hook点,比如InputMethodManager的sInstance,初始化的时候可以将代理的IInputMethodManager传进构造函数
    //现在的这种方式是从获取Binder代理对象的唯一入口ServiceManager开始hook,方便以后hook其他服务
    ServiceManagerHook serviceManagerHook = new ServiceManagerHook(mContext, Context.INPUT_METHOD_SERVICE);
    serviceManagerHook.onHook(classLoader);
    Object originBinder = serviceManagerHook.getOriginObj();
    if (originBinder instanceof IBinder) {
        mOriginObj = IInputMethodManagerCompat.asInterface((IBinder) originBinder);
        Object proxyInputMethodInterface = ReflectUtil.makeProxy(classLoader, mOriginObj.getClass(), this);
        serviceManagerHook.setProxyIInterface(proxyInputMethodInterface);
        //若hook之前调用过 mContext.getSystemService(Context.INPUT_METHOD_SERVICE)
        // 则在SystemServiceRegistry中会有缓存,清理缓存后重建才会拿到我们hook的代理
        clearCachedService();
        //rebuild cache
        mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
    }
}
 
Example 3
Project: simple-upnp   File: FileBrowserFragment.java   View source code 6 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    Log.d(TAG, "onServiceConnected: " + name.flattenToShortString() + ", " + service.toString());

    mUpnpService = (AndroidUpnpService) service;

    Device device = mUpnpService.getRegistry().getDevice(new UDN(mDeviceUdn), false);
    mContentDirectoryService = device.findService(new UDAServiceType("ContentDirectory"));
    if (mContentDirectoryService == null) {
        throw new IllegalStateException("Unable to find ContentDirectory service for device "
                + mDeviceUdn);
    }
    mDeviceName = (device.getDetails() != null && device.getDetails().getFriendlyName() != null)
            ? device.getDetails().getFriendlyName() : device.getDisplayString();

    selectContainer(mCurrentContainer);
}
 
Example 4
Project: springreplugin   File: PluginServiceServer.java   View source code 6 votes vote down vote up
private void insertConnectionToRecords(ServiceRecord sr, ProcessBindRecord b, IServiceConnection connection, int flags) {
    ConnectionBindRecord c = new ConnectionBindRecord(b, connection, flags);
    IBinder binder = connection.asBinder();

    // ServiceRecord.connections<Map - Key:IBinder>
    ArrayList<ConnectionBindRecord> clist = sr.connections.get(binder);
    if (clist == null) {
        clist = new ArrayList<>();
        sr.connections.put(binder, clist);
    }
    clist.add(c);

    // ProcessBindRecord.connections<List>
    b.connections.add(c);

    // ProcessRecord.connections<List>
    b.client.connections.add(c);

    // PluginServiceServer.mServiceConnections<Map - Key:IBinder>
    clist = mServiceConnections.get(binder);
    if (clist == null) {
        clist = new ArrayList<>();
        mServiceConnections.put(binder, clist);
    }
    clist.add(c);
}
 
Example 5
Project: container   File: FinishActivity.java   View source code 6 votes vote down vote up
@Override
public Object afterCall(Object who, Method method, Object[] args, Object result) throws Throwable {
	IBinder token = (IBinder) args[0];
	ActivityClientRecord r = VActivityManager.get().getActivityRecord(token);
	boolean taskRemoved = VActivityManager.get().onActivityDestroy(token);
	if (!taskRemoved && r != null && r.activity != null && r.info.getThemeResource() != 0) {
		try {
               TypedValue out = new TypedValue();
               Resources.Theme theme = r.activity.getResources().newTheme();
               theme.applyStyle(r.info.getThemeResource(), true);
               if (theme.resolveAttribute(android.R.attr.windowAnimationStyle, out, true)) {

                   TypedArray array = theme.obtainStyledAttributes(out.data,
                           new int[]{
                                   android.R.attr.activityCloseEnterAnimation,
                                   android.R.attr.activityCloseExitAnimation
                           });
                   r.activity.overridePendingTransition(array.getResourceId(0, 0), array.getResourceId(1, 0));
                   array.recycle();
               }
           } catch (Throwable e) {
               e.printStackTrace();
           }
	}
	return super.afterCall(who, method, args, result);
}
 
Example 6
Project: TPlayer   File: ActivityStack.java   View source code 6 votes vote down vote up
private void realStartActivitiesLocked(IBinder resultTo, Intent[] intents, String[] resolvedTypes, Bundle options) {
    Class<?>[] types = IActivityManager.startActivities.paramList();
    Object[] args = new Object[types.length];
    if (types[0] == IApplicationThread.TYPE) {
        args[0] = ActivityThread.getApplicationThread.call(VirtualCore.mainThread());
    }
    int pkgIndex = ArrayUtils.protoIndexOf(types, String.class);
    int intentsIndex = ArrayUtils.protoIndexOf(types, Intent[].class);
    int resultToIndex = ArrayUtils.protoIndexOf(types, IBinder.class, 2);
    int optionsIndex = ArrayUtils.protoIndexOf(types, Bundle.class);
    int resolvedTypesIndex = intentsIndex + 1;
    if (pkgIndex != -1) {
        args[pkgIndex] = VirtualCore.get().getHostPkg();
    }
    args[intentsIndex] = intents;
    args[resultToIndex] = resultTo;
    args[resolvedTypesIndex] = resolvedTypes;
    args[optionsIndex] = options;
    ClassUtils.fixArgs(types, args);
    IActivityManager.startActivities.call(ActivityManagerNative.getDefault.call(),
            (Object[]) args);
}
 
Example 7
Project: IdealMedia   File: PopupIndicator.java   View source code 6 votes vote down vote up
public void showIndicator(View parent, Rect touchBounds) {
    if (isShowing()) {
        mPopupView.mMarker.animateOpen();
        return;
    }

    IBinder windowToken = parent.getWindowToken();
    if (windowToken != null) {
        WindowManager.LayoutParams p = createPopupLayout(windowToken);

        p.gravity = Gravity.TOP | GravityCompat.START;
        updateLayoutParamsForPosiion(parent, p, touchBounds.bottom);
        mShowing = true;

        translateViewIntoPosition(touchBounds.centerX());
        invokePopup(p);
    }
}
 
Example 8
Project: chromium-for-android-56-debug-video   File: GSAServiceClient.java   View source code 6 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    // Ignore this call if we disconnected in the meantime.
    if (mContext == null) return;

    mService = new Messenger(service);
    mComponentName = name;
    try {
        Message registerClientMessage = Message.obtain(
                null, REQUEST_REGISTER_CLIENT);
        registerClientMessage.replyTo = mMessenger;
        Bundle b = mGsaHelper.getBundleForRegisteringGSAClient(mContext);
        registerClientMessage.setData(b);
        registerClientMessage.getData().putString(
                KEY_GSA_PACKAGE_NAME, mContext.getPackageName());
        mService.send(registerClientMessage);
        // Send prepare overlay message if there is a pending GSA context.
    } catch (RemoteException e) {
        Log.w(SERVICE_CONNECTION_TAG, "GSAServiceConnection - remote call failed", e);
    }
}
 
Example 9
Project: container   File: ProxyServiceFactory.java   View source code 6 votes vote down vote up
@Override
public IBinder getService(final Context context, ClassLoader classLoader, IBinder binder) {
	return new StubBinder(classLoader, binder) {
		@Override
		public InvocationHandler createHandler(Class<?> interfaceClass, final IInterface base) {
			return new InvocationHandler() {
				@Override
				public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
					try {
						return method.invoke(base, args);
					} catch (InvocationTargetException e) {
						if (e.getCause() != null) {
							throw e.getCause();
						}
						throw e;
					}
				}
			};
		}
	};
}
 
Example 10
Project: TPlayer   File: ActivityStack.java   View source code 6 votes vote down vote up
void onActivityCreated(ProcessRecord targetApp, ComponentName component, ComponentName caller, IBinder token,
                       Intent taskRoot, String affinity, int taskId, int launchMode, int flags) {
    synchronized (mHistory) {
        optimizeTasksLocked();
        TaskRecord task = mHistory.get(taskId);
        if (task == null) {
            task = new TaskRecord(taskId, targetApp.userId, affinity, taskRoot);
            mHistory.put(taskId, task);
        }
        ActivityRecord record = new ActivityRecord(task, component, caller, token, targetApp.userId, targetApp,
                launchMode, flags, affinity);
        synchronized (task.activities) {
            task.activities.add(record);
        }
    }
}
 
Example 11
Project: VirtualHook   File: ActivityStack.java   View source code 6 votes vote down vote up
private ActivityRecord findActivityByToken(int userId, IBinder token) {
    ActivityRecord target = null;
    if (token != null) {
        for (int i = 0; i < this.mHistory.size(); i++) {
            TaskRecord task = this.mHistory.valueAt(i);
            if (task.userId != userId) {
                continue;
            }
            synchronized (task.activities) {
                for (ActivityRecord r : task.activities) {
                    if (r.token == token) {
                        target = r;
                    }
                }
            }
        }
    }
    return target;
}
 
Example 12
Project: JobSchedulerCompat   File: JobSchedulerJobService.java   View source code 5 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    if (!(service instanceof JobService.Binder)) {
        Log.w(LOG_TAG, "Unknown service connected: " + service);
        stopJob(this, false);
        return;
    }
    binder = (JobService.Binder) service;
    if (!binder.startJob(toLocalParameters(params), JobSchedulerJobService.this)) {
        stopJob(this, false);
    }
}
 
Example 13
Project: Hotspot-master-devp   File: BaseProActivity.java   View source code 5 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    LocalJettyService.JettyBinder jettyBinder = (LocalJettyService.JettyBinder) service;
    jettyService = jettyBinder.getService();
    Server server = jettyService.getServer();
    if(server==null||!server.getState().equals("STARTED")) {
        LogUtils.d(ConstantValues.LOG_PREFIX+"jetty 未启动,开始启动...");
        jettyService.startJetty();
    }else {
        LogUtils.d(ConstantValues.LOG_PREFIX+"jetty 已启动");
    }
}
 
Example 14
Project: ServiceHook   File: ClipboardHook.java   View source code 5 votes vote down vote up
public static void hookService(Context context) {
    IBinder clipboardService = ServiceManager.getService(Context.CLIPBOARD_SERVICE);
    String IClipboard = "android.content.IClipboard";

    if (clipboardService != null) {
        IBinder hookClipboardService =
                (IBinder) Proxy.newProxyInstance(clipboardService.getClass().getClassLoader(),
                        clipboardService.getClass().getInterfaces(),
                        new ServiceHook(clipboardService, IClipboard, true, new ClipboardHookHandler()));
        ServiceManager.setService(Context.CLIPBOARD_SERVICE, hookClipboardService);
    } else {
        Log.e(TAG, "ClipboardService hook failed!");
    }
}
 
Example 15
Project: IPCServiceManager   File: IPCService.java   View source code 5 votes vote down vote up
@Override
public Cursor query(Uri uri, String[] projection, String selection,
		String[] selectionArgs, String sortOrder) {
	IBinder binder = getService(selection);
	BinderCusrsor binderCursor = BinderCusrsor.create(binder);
	return binderCursor;
}
 
Example 16
Project: VirtualHook   File: VActivityManager.java   View source code 5 votes vote down vote up
public void onActivityResumed(Activity activity) {
    IBinder token = mirror.android.app.Activity.mToken.get(activity);
    try {
        getService().onActivityResumed(VUserHandle.myUserId(), token);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}
 
Example 17
Project: react-native-huashi-100u   File: HsOtgModule.java   View source code 5 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    HSinterface = (HSInterface) service;
    int i = 2;
    while (i > 0) {
        i--;
        int ret = HSinterface.init();
        if (ret == 1) {
            i = 0;
            WritableMap result = new WritableNativeMap();
            String sam = HSinterface.GetSAM();
            result.putString("code", "1");
            result.putString("sam", sam);
            mPromise.resolve(result);
            return;
        } else {
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
                mPromise.reject("0", "connect failed");
            }
            continue;
        }
    }
    mPromise.reject("0", "connect failed");
}
 
Example 18
Project: springreplugin   File: PmHostSvc.java   View source code 5 votes vote down vote up
@Override
public void installBinder(String name, IBinder binder) throws RemoteException {
    if (LOG) {
        LogDebug.d(PLUGIN_TAG, "install binder: n=" + name + " b=" + binder);
    }
    synchronized (PluginProcessMain.sBinders) {
        if (binder != null) {
            PluginProcessMain.sBinders.put(name, binder);
            binder.linkToDeath(new BinderDied(name, binder), 0);
        } else {
            PluginProcessMain.sBinders.remove(name);
        }
    }
}
 
Example 19
Project: prevent   File: ActivityManagerService.java   View source code 5 votes vote down vote up
public final int startActivity$Pr(IApplicationThread caller, String callingPackage,
                                  Intent intent, String resolvedType, IBinder resultTo,
                                  String resultWho, int requestCode, int startFlags,
                                  String profileFile, ParcelFileDescriptor profileFd, Bundle options) {

    throw new UnsupportedOperationException();
}
 
Example 20
Project: AOSP-Kayboard-7.1.2   File: LatinIME.java   View source code 5 votes vote down vote up
public boolean shouldSwitchToOtherInputMethods() {
    // TODO: Revisit here to reorganize the settings. Probably we can/should use different
    // strategy once the implementation of
    // {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} is defined well.
    final boolean fallbackValue = mSettings.getCurrent().mIncludesOtherImesInLanguageSwitchList;
    final IBinder token = getWindow().getWindow().getAttributes().token;
    if (token == null) {
        return fallbackValue;
    }
    return mRichImm.shouldOfferSwitchingToNextInputMethod(token, fallbackValue);
}
 
Example 21
Project: live_master   File: IjkPlayer.java   View source code 5 votes vote down vote up
private void HideSoftInput(IBinder token) {
    if (token != null) {
        InputMethodManager manager = (InputMethodManager) activity.getSystemService(activity.INPUT_METHOD_SERVICE);
        manager.hideSoftInputFromWindow(token,
                InputMethodManager.HIDE_NOT_ALWAYS);
    }
}
 
Example 22
Project: Near   File: NearConnectImpl.java   View source code 5 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    if (service instanceof TcpServerService.TcpServerBinder && mServerState == SERVER_STARTED) {
        TcpServerService.TcpServerBinder binder = (TcpServerService.TcpServerBinder) service;
        binder.setListener(getServerServiceListener());
        binder.startServer();
    }
}
 
Example 23
Project: GitHub   File: FlashlightManager.java   View source code 5 votes vote down vote up
private static Object getHardwareService() {
  Class<?> serviceManagerClass = maybeForName("android.os.ServiceManager");
  if (serviceManagerClass == null) {
    return null;
  }

  Method getServiceMethod = maybeGetMethod(serviceManagerClass, "getService", String.class);
  if (getServiceMethod == null) {
    return null;
  }

  Object hardwareService = invoke(getServiceMethod, null, "hardware");
  if (hardwareService == null) {
    return null;
  }

  Class<?> iHardwareServiceStubClass = maybeForName("android.os.IHardwareService$Stub");
  if (iHardwareServiceStubClass == null) {
    return null;
  }

  Method asInterfaceMethod = maybeGetMethod(iHardwareServiceStubClass, "asInterface", IBinder.class);
  if (asInterfaceMethod == null) {
    return null;
  }

  return invoke(asInterfaceMethod, null, hardwareService);
}
 
Example 24
Project: BTNotifierAndroid   File: NotificationListenerService.java   View source code 5 votes vote down vote up
@Override
public IBinder onBind(Intent mIntent) {
    IBinder mIBinder = super.onBind(mIntent);
    Log.i(TAG, "onBind");
    isNotificationAccessEnabled = true;
    try {
        server = new Server(this);
        server.start();
    } catch (Exception e) {
        Log.e(TAG, "Error during bind", e);
    }
    return mIBinder;
}
 
Example 25
Project: AstronomyTourPadova   File: LocationService.java   View source code 5 votes vote down vote up
@Override
public IBinder onBind(Intent intent) {
    Log.d(TAG, "in onBind()");
    // Called when the App comes to the foreground and binds with this service.
    stopForeground(true);
    changingConfiguration = false;
    return iBinder;
}
 
Example 26
Project: KUtils-master   File: HideUtil.java   View source code 5 votes vote down vote up
/**
 * @param mActivity
 * @param token
 */
private void hideSoftInput(Activity mActivity, IBinder token) {
    if (token != null) {
        InputMethodManager im = (InputMethodManager) mActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
        im.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS);
    }
}
 
Example 27
Project: IdealMedia   File: PopupIndicator.java   View source code 5 votes vote down vote up
private WindowManager.LayoutParams createPopupLayout(IBinder token) {
    WindowManager.LayoutParams p = new WindowManager.LayoutParams();
    p.gravity = Gravity.START | Gravity.TOP;
    p.width = ViewGroup.LayoutParams.MATCH_PARENT;
    p.height = ViewGroup.LayoutParams.MATCH_PARENT;
    p.format = PixelFormat.TRANSLUCENT;
    p.flags = computeFlags(p.flags);
    p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
    p.token = token;
    p.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN;
    p.setTitle("DiscreteSeekBar Indicator:" + Integer.toHexString(hashCode()));

    return p;
}
 
Example 28
Project: VirtualHook   File: ActivityStack.java   View source code 5 votes vote down vote up
private void realStartActivityLocked(IBinder resultTo, Intent intent, String resultWho, int requestCode,
                                     Bundle options) {
    Class<?>[] types = mirror.android.app.IActivityManager.startActivity.paramList();
    Object[] args = new Object[types.length];
    if (types[0] == IApplicationThread.TYPE) {
        args[0] = ActivityThread.getApplicationThread.call(VirtualCore.mainThread());
    }
    int intentIndex = ArrayUtils.protoIndexOf(types, Intent.class);
    int resultToIndex = ArrayUtils.protoIndexOf(types, IBinder.class, 2);
    int optionsIndex = ArrayUtils.protoIndexOf(types, Bundle.class);
    int resolvedTypeIndex = intentIndex + 1;
    int resultWhoIndex = resultToIndex + 1;
    int requestCodeIndex = resultToIndex + 2;

    args[intentIndex] = intent;
    args[resultToIndex] = resultTo;
    args[resultWhoIndex] = resultWho;
    args[requestCodeIndex] = requestCode;
    if (optionsIndex != -1) {
        args[optionsIndex] = options;
    }
    args[resolvedTypeIndex] = intent.getType();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        args[intentIndex - 1] = VirtualCore.get().getHostPkg();
    }
    ClassUtils.fixArgs(types, args);

    mirror.android.app.IActivityManager.startActivity.call(ActivityManagerNative.getDefault.call(),
            (Object[]) args);
}
 
Example 29
Project: boohee_v5.6   File: IResultReceiver.java   View source code 5 votes vote down vote up
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 30
Project: chromium-for-android-56-debug-video   File: IntentUtils.java   View source code 5 votes vote down vote up
/**
 * Just like {@link BundleCompat#getBinder()}, but doesn't throw exceptions.
 */
public static IBinder safeGetBinder(Bundle bundle, String name) {
    if (bundle == null) return null;
    try {
        return BundleCompat.getBinder(bundle, name);
    } catch (Throwable t) {
        // Catches un-parceling exceptions.
        Log.e(TAG, "getBinder failed on bundle " + bundle);
        return null;
    }
}
 
Example 31
Project: tumbviewer   File: DownloadService.java   View source code 5 votes vote down vote up
@Nullable
@Override
public IBinder onBind(Intent intent) {
    if (localBinder == null) {
        localBinder = new LocalBinder();
    }
    return localBinder;
}
 
Example 32
Project: VirtualAPK   File: PluginUtil.java   View source code 5 votes vote down vote up
public static IBinder getBinder(Bundle bundle, String key) {
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        return bundle.getBinder(key);
    } else {
        try {
            return (IBinder) ReflectUtil.invoke(Bundle.class, bundle, "getIBinder", key);
        } catch (Exception e) {
        }

        return null;
    }
}
 
Example 33
Project: airgram   File: ICustomTabsCallback.java   View source code 5 votes vote down vote up
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 34
Project: container   File: VActivityManager.java   View source code 5 votes vote down vote up
public void sendActivityResult(IBinder resultTo, String resultWho, int requestCode) {
    ActivityClientRecord r = mActivities.get(resultTo);
    if (r != null && r.activity != null) {
        Object mainThread = VirtualCore.mainThread();
        ActivityThread.sendActivityResult.call(mainThread, resultTo, resultWho, requestCode, 0, null);
    }
}
 
Example 35
Project: prevent   File: ActivityManagerService.java   View source code 5 votes vote down vote up
public final int startActivity(IApplicationThread caller, String callingPackage,
                               Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
                               int startFlags, ProfilerInfo profilerInfo, Bundle bOptions) {
    return PreventRunningUtils.onStartActivity(
            startActivity$Pr(caller, callingPackage,
                    intent, resolvedType, resultTo, resultWho, requestCode,
                    startFlags, profilerInfo, bOptions),
            caller, callingPackage, intent);
}
 
Example 36
Project: android-instant-apps   File: ServiceManagementActivity.java   View source code 4 votes vote down vote up
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
    mBinder = (TimekeepingService.TimeBinder) service;
    mServiceBound = true;
}
 
Example 37
Project: AppAuthIdentityServer4   File: TokenService.java   View source code 4 votes vote down vote up
@Override
public IBinder onBind(Intent intent) {
    return null;
}
 
Example 38
Project: container   File: VActivityManagerService.java   View source code 4 votes vote down vote up
@Override
public void addPendingIntent(IBinder binder, String creator) {
    mPendingIntents.addPendingIntent(binder, creator);
}
 
Example 39
Project: CommonsLab   File: RegisterFragment.java   View source code 4 votes vote down vote up
private void closeKeyboard(Context context, IBinder windowToken) {
    InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMethodManager.hideSoftInputFromWindow(windowToken, 0);
}
 
Example 40
Project: IPCCommunication   File: BaseMsgIPCService.java   View source code 4 votes vote down vote up
@Override
public IBinder onBind(Intent intent) {
    initHander();
    return mMessenger.getBinder();
}