當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。