Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31141,6 +31141,7 @@ package android.os { method public E getBroadcastItem(int); method public java.lang.Object getRegisteredCallbackCookie(int); method public int getRegisteredCallbackCount(); method public E getRegisteredCallbackItem(int); method public void kill(); method public void onCallbackDied(E); method public void onCallbackDied(E, java.lang.Object); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -33902,6 +33902,7 @@ package android.os { method public E getBroadcastItem(int); method public java.lang.Object getRegisteredCallbackCookie(int); method public int getRegisteredCallbackCount(); method public E getRegisteredCallbackItem(int); method public void kill(); method public void onCallbackDied(E); method public void onCallbackDied(E, java.lang.Object); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31264,6 +31264,7 @@ package android.os { method public E getBroadcastItem(int); method public java.lang.Object getRegisteredCallbackCookie(int); method public int getRegisteredCallbackCount(); method public E getRegisteredCallbackItem(int); method public void kill(); method public void onCallbackDied(E); method public void onCallbackDied(E, java.lang.Object); core/java/android/os/RemoteCallbackList.java +27 −4 Original line number Diff line number Diff line Loading @@ -329,15 +329,38 @@ public class RemoteCallbackList<E extends IInterface> { } /** * Return the cookies associated with a currently registered callback. Note that this is * Return a currently registered callback. Note that this is * <em>not</em> the same as {@link #getBroadcastItem} and should not be used * interchangeably with it. This method returns the registered callback at the given * index, not the current broadcast state. This means that it is not itself thread-safe: * any call to {@link #register} or {@link #unregister} will change these indices, so you * must do your own thread safety between these to protect from such changes. * * @param index Index of which callback registration to return, from 0 to * {@link #getRegisteredCallbackCount()} - 1. * * @return Returns whatever callback is associated with this index, or null if * {@link #kill()} has been called. */ public E getRegisteredCallbackItem(int index) { synchronized (mCallbacks) { if (mKilled) { return null; } return mCallbacks.valueAt(index).mCallback; } } /** * Return any cookie associated with a currently registered callback. Note that this is * <em>not</em> the same as {@link #getBroadcastCookie} and should not be used * interchangeably with it. This method returns the current cookied registered at the given * interchangeably with it. This method returns the current cookie registered at the given * index, not the current broadcast state. This means that it is not itself thread-safe: * any call to {@link #register} or {@link #unregister} will change these indices, so you * must do your own thread safety between these to protect from such changes. * * @param index Index of which registration cookie to return from 0 to * {@link #getRegisteredCallbackCount()}. * @param index Index of which registration cookie to return, from 0 to * {@link #getRegisteredCallbackCount()} - 1. * * @return Returns whatever cookie object is associated with this index, or null if * {@link #kill()} has been called. Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31141,6 +31141,7 @@ package android.os { method public E getBroadcastItem(int); method public java.lang.Object getRegisteredCallbackCookie(int); method public int getRegisteredCallbackCount(); method public E getRegisteredCallbackItem(int); method public void kill(); method public void onCallbackDied(E); method public void onCallbackDied(E, java.lang.Object);
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -33902,6 +33902,7 @@ package android.os { method public E getBroadcastItem(int); method public java.lang.Object getRegisteredCallbackCookie(int); method public int getRegisteredCallbackCount(); method public E getRegisteredCallbackItem(int); method public void kill(); method public void onCallbackDied(E); method public void onCallbackDied(E, java.lang.Object);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -31264,6 +31264,7 @@ package android.os { method public E getBroadcastItem(int); method public java.lang.Object getRegisteredCallbackCookie(int); method public int getRegisteredCallbackCount(); method public E getRegisteredCallbackItem(int); method public void kill(); method public void onCallbackDied(E); method public void onCallbackDied(E, java.lang.Object);
core/java/android/os/RemoteCallbackList.java +27 −4 Original line number Diff line number Diff line Loading @@ -329,15 +329,38 @@ public class RemoteCallbackList<E extends IInterface> { } /** * Return the cookies associated with a currently registered callback. Note that this is * Return a currently registered callback. Note that this is * <em>not</em> the same as {@link #getBroadcastItem} and should not be used * interchangeably with it. This method returns the registered callback at the given * index, not the current broadcast state. This means that it is not itself thread-safe: * any call to {@link #register} or {@link #unregister} will change these indices, so you * must do your own thread safety between these to protect from such changes. * * @param index Index of which callback registration to return, from 0 to * {@link #getRegisteredCallbackCount()} - 1. * * @return Returns whatever callback is associated with this index, or null if * {@link #kill()} has been called. */ public E getRegisteredCallbackItem(int index) { synchronized (mCallbacks) { if (mKilled) { return null; } return mCallbacks.valueAt(index).mCallback; } } /** * Return any cookie associated with a currently registered callback. Note that this is * <em>not</em> the same as {@link #getBroadcastCookie} and should not be used * interchangeably with it. This method returns the current cookied registered at the given * interchangeably with it. This method returns the current cookie registered at the given * index, not the current broadcast state. This means that it is not itself thread-safe: * any call to {@link #register} or {@link #unregister} will change these indices, so you * must do your own thread safety between these to protect from such changes. * * @param index Index of which registration cookie to return from 0 to * {@link #getRegisteredCallbackCount()}. * @param index Index of which registration cookie to return, from 0 to * {@link #getRegisteredCallbackCount()} - 1. * * @return Returns whatever cookie object is associated with this index, or null if * {@link #kill()} has been called. Loading