code: @RequiresPermission(ACCESS_WIFI_STATE)
    public static Observable<SupplicantState> observeSupplicantState(final Context context) {
      final IntentFilter filter = new IntentFilter();
      filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
  
      return Observable.create(new ObservableOnSubscribe<SupplicantState>() {
        @Override public void subscribe(final ObservableEmitter<SupplicantState> emitter)
            throws Exception {
          final BroadcastReceiver receiver = createSupplicantStateReceiver(emitter);
  
          context.registerReceiver(receiver, filter);
  
          Disposable disposable = disposeInUiThread(new Action() {
            @Override public void run() {
              tryToUnregisterReceiver(context, receiver);
            }
          });
  
          emitter.setDisposable(disposable);
        }
      }).defaultIfEmpty(SupplicantState.UNINITIALIZED);
    }
docs: Observes the current WPA supplicant state.
  Returns the current WPA supplicant as a member of the {@link SupplicantState} enumeration,
  returning {@link SupplicantState#UNINITIALIZED} if WiFi is not enabled.
  
  @param context Context of the activity or an application
  @return RxJava Observable with SupplicantState