Skip to content

ConnectivityManager error messages when clearing subscriptions #295

@ap-johns

Description

@ap-johns

We're using reactivenetwork-rx2:2.1.0

When switching activities we're seeing some ConnectivityManager related error messages. They don't seem to be causing any actual issues, but would be nice if they were cleared up.

Error messages seem to vary depending on device

eg

D/CCA: onPause
D/ConnectivityManager: unregisterNetworkCallback; CallingUid : 10242, CallingPid : 15126

OR

D/CCA: onPause
E/ConnectivityManager.CallbackHandler: callback not found for RELEASED message

Code sample

    @Override
    public void onResume() {
        Log.d(TAG, "onResume");
        super.onResume();

        disposables.add(ReactiveNetwork.observeNetworkConnectivity(this)
                .filter(ConnectivityPredicate.hasType(ConnectivityManager.TYPE_WIFI))
                .subscribeOn(Schedulers.io())
                .observeOn(io.reactivex.android.schedulers.AndroidSchedulers.mainThread())
                .subscribe((Connectivity it) -> {
                    Log.d(TAG, "observeNetworkConnectivity - state=" + it.state());
                    if (it.state() == NetworkInfo.State.CONNECTED) {
                        startReconnectUnitActivity();
                    } else {
                        promptText.setVisibility(View.VISIBLE);
                    }
                }, throwable -> Log.crashLog(TAG, "** onError (observeNetworkConnectivity) **")));
    }

    @Override
    public void onPause() {
        Log.d(TAG, "onPause");
        super.onPause();
        disposables.clear();
    }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions