/** * Comparison operator on two Messenger objects, such that true is returned then they both point * to the same Handler. */ public boolean equals(Object otherObj) { if (otherObj == null) { return false; } try { return mTarget.asBinder().equals(((Messenger) otherObj).mTarget.asBinder()); } catch (ClassCastException e) { } return false; }
public void writeToParcel(Parcel out, int flags) { out.writeStrongBinder(mTarget.asBinder()); }
public int hashCode() { return mTarget.asBinder().hashCode(); }
/** * Retrieve the IBinder that this Messenger is using to communicate with its associated Handler. * * @return Returns the IBinder backing this Messenger. */ public IBinder getBinder() { return mTarget.asBinder(); }
/** * Send a Message to this Messenger's Handler. * * @param message The Message to send. Usually retrieved through {@link Message#obtain() * Message.obtain()}. * @throws RemoteException Throws DeadObjectException if the target Handler no longer exists. */ public void send(Message message) throws RemoteException { mTarget.send(message); }