@SuppressWarnings("ResourceType") @Test public void supplicantConnectionChanges() throws IllegalAccessException, InstantiationException { Application application = RuntimeEnvironment.application; TestSubscriber<Boolean> o = new TestSubscriber<>(); RxWifiManager.supplicantConnectionChanges(application).subscribe(o); o.assertValues(); Intent intent1 = new Intent(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION) .putExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, true); application.sendBroadcast(intent1); o.assertValues(true); Intent intent2 = new Intent(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION) .putExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false); application.sendBroadcast(intent2); o.assertValues(true, false); }
@CheckResult @NonNull public static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context) { checkNotNull(context, "context == null"); IntentFilter filter = new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION); return RxBroadcastReceiver.create(context, filter).map(new Func1<Intent, Boolean>() { @Override public Boolean call(Intent intent) { return intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false); } }); }
RxWifiManager { @CheckResult @NonNull public static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context) { checkNotNull(context, "context == null"); IntentFilter filter = new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION); return RxBroadcastReceiver.create(context, filter).map(new Func1<Intent, Boolean>() { @Override public Boolean call(Intent intent) { return intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false); } }); } }
RxWifiManager { @CheckResult @NonNull public static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context) { checkNotNull(context, "context == null"); IntentFilter filter = new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION); return RxBroadcastReceiver.create(context, filter).map(new Func1<Intent, Boolean>() { @Override public Boolean call(Intent intent) { return intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false); } }); } private  RxWifiManager(); }
RxWifiManager { @CheckResult @NonNull public static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context) { checkNotNull(context, "context == null"); IntentFilter filter = new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION); return RxBroadcastReceiver.create(context, filter).map(new Func1<Intent, Boolean>() { @Override public Boolean call(Intent intent) { return intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false); } }); } private  RxWifiManager(); @CheckResult @NonNull // static Observable<Integer> wifiStateChanges(@NonNull final Context context); @CheckResult @NonNull // static Action1<? super Boolean> wifiState(@NonNull final WifiManager wifiManager); @CheckResult @NonNull // static Observable<NetworkStateChangedEvent> networkStateChanges(@NonNull final Context context); @CheckResult @NonNull // static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context); @CheckResult @NonNull // static Observable<SupplicantStateChangedEvent> supplicantStateChanges(@NonNull final Context context); }
RxWifiManager { @CheckResult @NonNull public static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context) { checkNotNull(context, "context == null"); IntentFilter filter = new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION); return RxBroadcastReceiver.create(context, filter).map(new Func1<Intent, Boolean>() { @Override public Boolean call(Intent intent) { return intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false); } }); } private  RxWifiManager(); @CheckResult @NonNull // static Observable<Integer> wifiStateChanges(@NonNull final Context context); @CheckResult @NonNull // static Action1<? super Boolean> wifiState(@NonNull final WifiManager wifiManager); @CheckResult @NonNull // static Observable<NetworkStateChangedEvent> networkStateChanges(@NonNull final Context context); @CheckResult @NonNull // static Observable<Boolean> supplicantConnectionChanges(@NonNull final Context context); @CheckResult @NonNull // static Observable<SupplicantStateChangedEvent> supplicantStateChanges(@NonNull final Context context);  }