Ejemplo n.º 1
0
    private void refreshToken() {
      Bundle requestData = new Bundle();
      requestData.putString(TOKEN, mAccessToken);

      Message request = Message.obtain();
      request.setData(requestData);
      request.replyTo = messageReceiver;

      try {
        messageSender.send(request);
      } catch (RemoteException e) {
        serviceListener.onError(new Error("Service connection error"));
      }
    }
Ejemplo n.º 2
0
 public void onServiceDisconnected(ComponentName arg) {
   serviceListener.onError(new Error("Service disconnected"));
   // We returned an error so there's no point in
   // keeping the binding open.
   mAuthActivity.unbindService(TokenRefreshServiceConnection.this);
 }