/**
  * Adds a callback to receive updates from the session. Updates will be posted on the specified
  * handler's thread.
  *
  * @param callback The callback object, must not be null.
  * @param handler The handler to post updates on. If null the callers thread will be used.
  */
 public void registerCallback(Callback callback, Handler handler) {
   if (callback == null) {
     throw new IllegalArgumentException("callback cannot be null");
   }
   if (handler == null) {
     handler = new Handler();
   }
   mImpl.registerCallback(callback, handler);
 }