public void unregisterReceiver(Context context){
  mHandler.removeCallbacks(mServiceRunnable);
  if (mIsRegistered.getAndSet(false)) {
    context.unregisterReceiver(this);
    mNeedToRunActions.set(false);
  }
}

public void unregisterReceiver ( Context context ) { mHandler . removeCallbacks ( mServiceRunnable ) ; if ( mIsRegistered . getAndSet ( false ) ) { context . unregisterReceiver ( this ) ; mNeedToRunActions . set ( false ) ; } }
unregisters this broadcast receiver so it no longer receives intents . also cancels any runnables waiting to be executed .
