code: public void unbind(@NonNull BeaconConsumer consumer) {
          if (!isBleAvailableOrSimulated()) {
              LogManager.w(TAG, "Method invocation will be ignored.");
              return;
          }
          synchronized (consumers) {
              if (consumers.containsKey(consumer)) {
                  LogManager.d(TAG, "Unbinding");
                  if (mScheduledScanJobsEnabled) {
                      LogManager.d(TAG, "Not unbinding from scanning service as we are using scan jobs.");
                  }
                  else {
                      consumer.unbindService(consumers.get(consumer).beaconServiceConnection);
                  }
                  LogManager.d(TAG, "Before unbind, consumer count is "+consumers.size());
                  consumers.remove(consumer);
                  LogManager.d(TAG, "After unbind, consumer count is "+consumers.size());
                  if (consumers.size() == 0) {
                      // If this is the last consumer to disconnect, the service will exit
                      // release the serviceMessenger.
                      serviceMessenger = null;
                      // Reset the mBackgroundMode to false, which is the default value
                      // This way when we restart ranging or monitoring it will always be in
                      // foreground mode
                      mBackgroundMode = false;
                      // If we are using scan jobs, we cancel the active scan job
                      if (mScheduledScanJobsEnabled) {
                          if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                              LogManager.i(TAG, "Cancelling scheduled jobs after unbind of last consumer.");
                              ScanJobScheduler.getInstance().cancelSchedule(mContext);
                          }
                      }
                  }
              }
              else {
                  LogManager.d(TAG, "This consumer is not bound to: %s", consumer);
                  LogManager.d(TAG, "Bound consumers: ");
                  Set<Map.Entry<BeaconConsumer, ConsumerInfo>> consumers = this.consumers.entrySet();
                  for (Map.Entry<BeaconConsumer, ConsumerInfo> consumerEntry : consumers) {
                      LogManager.d(TAG, String.valueOf(consumerEntry.getValue()));
                  }
              }
          }
      }
docs: Unbinds an Android <code>Activity</code> or <code>Service</code> to the <code>BeaconService</code>.  This should
  typically be called in the onDestroy() method.
  
  @param consumer the <code>Activity</code> or <code>Service</code> that no longer needs to use the service.