Java 类android.os.IBinder.DeathRecipient 实例源码

项目:airgram    文件:CustomTabsService.java   
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);

    try {
        DeathRecipient e = new DeathRecipient() {
            public void binderDied() {
                CustomTabsService.this.cleanUpSession(sessionToken);
            }
        };
        synchronized (CustomTabsService.this.mDeathRecipientMap) {
            callback.asBinder().linkToDeath(e, 0);
            CustomTabsService.this.mDeathRecipientMap.put(callback.asBinder(), e);
        }

        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException var7) {
        return false;
    }
}
项目:chromium-for-android-56-debug-video    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:PlusGram    文件:CustomTabsService.java   
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);

    try {
        DeathRecipient e = new DeathRecipient() {
            public void binderDied() {
                CustomTabsService.this.cleanUpSession(sessionToken);
            }
        };
        synchronized (CustomTabsService.this.mDeathRecipientMap) {
            callback.asBinder().linkToDeath(e, 0);
            CustomTabsService.this.mDeathRecipientMap.put(callback.asBinder(), e);
        }

        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException var7) {
        return false;
    }
}
项目:springreplugin    文件:PluginProviderStub.java   
/**
 * @param context
 * @return
 * @throws RemoteException
 */
public static final IPref getPref(Context context) throws RemoteException {
    if (sPref == null) {
        if (IPC.isPersistentProcess()) {
            // 需要枷锁否?
            initPref();
        } else {
            IBinder b = PluginProviderStub.proxyFetchHostPref(context);
            b.linkToDeath(new DeathRecipient() {

                @Override
                public void binderDied() {
                    sPref = null;
                }
            }, 0);
            sPref = IPref.Stub.asInterface(b);
        }
    }
    return sPref;
}
项目:AndroidChromium    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:AndroidStudioTutorials    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:custom-tabs-client    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:365browser    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:anticipate    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:Telegram    文件:CustomTabsService.java   
@Override
public boolean newSession(ICustomTabsCallback callback) {
    final CustomTabsSessionToken sessionToken = new CustomTabsSessionToken(callback);
    try {
        DeathRecipient deathRecipient = new IBinder.DeathRecipient() {
            @Override
            public void binderDied() {
                cleanUpSession(sessionToken);
            }
        };
        synchronized (mDeathRecipientMap) {
            callback.asBinder().linkToDeath(deathRecipient, 0);
            mDeathRecipientMap.put(callback.asBinder(), deathRecipient);
        }
        return CustomTabsService.this.newSession(sessionToken);
    } catch (RemoteException e) {
        return false;
    }
}
项目:airgram    文件:CustomTabsService.java   
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;
    }
}
项目:chromium-for-android-56-debug-video    文件:CustomTabsService.java   
/**
 * 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;
}
项目:PlusGram    文件:CustomTabsService.java   
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;
    }
}
项目:AndroidChromium    文件:CustomTabsService.java   
/**
 * 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;
}
项目:AndroidStudioTutorials    文件:CustomTabsService.java   
/**
 * 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;
}
项目:custom-tabs-client    文件:CustomTabsService.java   
/**
 * 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;
}
项目:365browser    文件:CustomTabsService.java   
/**
 * 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;
}
项目:anticipate    文件:CustomTabsService.java   
/**
 * 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;
}
项目:Telegram    文件:CustomTabsService.java   
/**
 * 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;
}
项目:letv    文件:MyFakeIBinder.java   
public void linkToDeath(DeathRecipient deathRecipient, int i) throws RemoteException {
}
项目:letv    文件:MyFakeIBinder.java   
public boolean unlinkToDeath(DeathRecipient deathRecipient, int i) {
    return false;
}