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

Commit c1728cb0 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Signal the suspended state with NetworkCapabilities" am: f6e15c79 am: 95a41c4e

Change-Id: I9cdb8d9884ca2ee3a6e24126fc49ff6b5770eebd
parents 10f41ced 95a41c4e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -608,7 +608,6 @@ public class DataConnection extends StateMachine {
        mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_MOBILE,
                networkType, NETWORK_TYPE, TelephonyManager.getNetworkTypeName(networkType));
        mNetworkInfo.setRoaming(ss.getDataRoaming());
        mNetworkInfo.setIsAvailable(true);

        addState(mDefaultState);
            addState(mInactiveState, mDefaultState);
@@ -1211,6 +1210,11 @@ public class DataConnection extends StateMachine {
    }

    /**
     * Get the network capabilities for this data connection.
     *
     * Note that this method reads fields from mNetworkInfo, so its output is only as fresh
     * as mNetworkInfo. Call updateNetworkInfoSuspendState before calling this.
     *
     * @return the {@link NetworkCapabilities} of this data connection.
     */
    public NetworkCapabilities getNetworkCapabilities() {
@@ -1351,6 +1355,10 @@ public class DataConnection extends StateMachine {
            result.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
        }

        final boolean suspended =
                mNetworkInfo.getDetailedState() == NetworkInfo.DetailedState.SUSPENDED;
        result.setCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED, !suspended);

        return result;
    }