Example usage for android.os IBinder linkToDeath

List of usage examples for android.os IBinder linkToDeath

Introduction

In this page you can find the example usage for android.os IBinder linkToDeath.

Prototype

public void linkToDeath(@NonNull DeathRecipient recipient, int flags) throws RemoteException;

Source Link

Document

Register the recipient for a notification if this binder goes away.

Usage

From source file:com.googlecode.eyesfree.brailleback.SelfBrailleService.java

private ClientInfo infoForClient(IBinder clientToken) {
    ClientInfo info = mClients.get(clientToken);
    if (info == null) {
        info = new ClientInfo(clientToken);
        try {//from   w ww .jav a  2  s.c  o m
            clientToken.linkToDeath(info, 0);
        } catch (RemoteException ex) {
            return null;
        }
        mClients.put(clientToken, info);
    }
    return info;
}