当前位置: 首页>>代码示例>>Java>>正文


Java IBinder.unlinkToDeath方法代码示例

本文整理汇总了Java中android.os.IBinder.unlinkToDeath方法的典型用法代码示例。如果您正苦于以下问题:Java IBinder.unlinkToDeath方法的具体用法?Java IBinder.unlinkToDeath怎么用?Java IBinder.unlinkToDeath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.IBinder的用法示例。


在下文中一共展示了IBinder.unlinkToDeath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanUpSession

import android.os.IBinder; //导入方法依赖的package包/类
protected boolean cleanUpSession(CustomTabsSessionToken sessionToken) {
    try {
        Map e = this.mDeathRecipientMap;
        synchronized (this.mDeathRecipientMap) {
            IBinder binder = sessionToken.getCallbackBinder();
            DeathRecipient deathRecipient = this.mDeathRecipientMap.get(binder);
            binder.unlinkToDeath(deathRecipient, 0);
            this.mDeathRecipientMap.remove(binder);
            return true;
        }
    } catch (NoSuchElementException var7) {
        return false;
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:15,代码来源:CustomTabsService.java

示例2: cleanUpSession

import android.os.IBinder; //导入方法依赖的package包/类
/**
 * Called when the client side {@link IBinder} for this {@link CustomTabsSessionToken} is dead.
 * Can also be used to clean up {@link DeathRecipient} instances allocated for the given token.
 * @param sessionToken The session token for which the {@link DeathRecipient} call has been
 *                     received.
 * @return Whether the clean up was successful. Multiple calls with two tokens holdings the
 *         same binder will return false.
 */
protected boolean cleanUpSession(CustomTabsSessionToken sessionToken) {
    try {
        synchronized (mDeathRecipientMap) {
           IBinder binder = sessionToken.getCallbackBinder();
           DeathRecipient deathRecipient =
                   mDeathRecipientMap.get(binder);
           binder.unlinkToDeath(deathRecipient, 0);
           mDeathRecipientMap.remove(binder);
       }
    } catch (NoSuchElementException e) {
        return false;
    }
    return true;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:CustomTabsService.java

示例3: linkBinderDied

import android.os.IBinder; //导入方法依赖的package包/类
private static void linkBinderDied(final IBinder binder) {
	IBinder.DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
		@Override
		public void binderDied() {
			binder.unlinkToDeath(this, 0);
		}
	};
	try {
		binder.linkToDeath(deathRecipient, 0);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:14,代码来源:ServiceManagerNative.java

示例4: linkBinderDied

import android.os.IBinder; //导入方法依赖的package包/类
private static void linkBinderDied(final IBinder binder) {
    IBinder.DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
        @Override
        public void binderDied() {
            binder.unlinkToDeath(this, 0);
        }
    };
    try {
        binder.linkToDeath(deathRecipient, 0);
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:14,代码来源:ServiceManagerNative.java


注:本文中的android.os.IBinder.unlinkToDeath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。