Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2ef0904 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Remove JobInfo usage of NetworkRequest#networkCaps

NetworkRequest#networkCapabilities is an implementation detail (not part
of the NetworkRequest API); NetworkRequest has getters that return the
same information.

Bug: 174436414
Bug: 142281756
Test: m
Change-Id: I47e7ab1b887b2fe2dddef223bd7c66bdd290fc56
parent 011e74cc
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -462,11 +462,11 @@ public class JobInfo implements Parcelable {
    public @NetworkType int getNetworkType() {
        if (networkRequest == null) {
            return NETWORK_TYPE_NONE;
        } else if (networkRequest.networkCapabilities.hasCapability(NET_CAPABILITY_NOT_METERED)) {
        } else if (networkRequest.hasCapability(NET_CAPABILITY_NOT_METERED)) {
            return NETWORK_TYPE_UNMETERED;
        } else if (networkRequest.networkCapabilities.hasCapability(NET_CAPABILITY_NOT_ROAMING)) {
        } else if (networkRequest.hasCapability(NET_CAPABILITY_NOT_ROAMING)) {
            return NETWORK_TYPE_NOT_ROAMING;
        } else if (networkRequest.networkCapabilities.hasTransport(TRANSPORT_CELLULAR)) {
        } else if (networkRequest.hasTransport(TRANSPORT_CELLULAR)) {
            return NETWORK_TYPE_CELLULAR;
        } else {
            return NETWORK_TYPE_ANY;
@@ -1558,7 +1558,7 @@ public class JobInfo implements Parcelable {
        if (isPersisted) {
            // We can't serialize network specifiers
            if (networkRequest != null
                    && networkRequest.networkCapabilities.getNetworkSpecifier() != null) {
                    && networkRequest.getNetworkSpecifier() != null) {
                throw new IllegalArgumentException(
                        "Network specifiers aren't supported for persistent jobs");
            }