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

Commit 544f5d44 authored by Aaron Huang's avatar Aaron Huang Committed by Gerrit Code Review
Browse files

Merge "Replace deduceRestrictedCapability with the version in libs/net"

parents c301c890 949f56eb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Protocol;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.net.module.util.NetworkCapabilitiesUtils;
import com.android.telephony.Rlog;

import java.io.FileDescriptor;
@@ -1823,6 +1824,7 @@ public class DataConnection extends StateMachine {
            }
        }


        // Mark NOT_METERED in the following cases:
        // 1. All APNs in the APN settings are unmetered.
        // 2. The non-restricted data is intended for unmetered use only.
@@ -1832,8 +1834,7 @@ public class DataConnection extends StateMachine {
            builder.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
        }

        // TODO: Need to remove the use of hidden API deduceRestrictedCapability
        if (builder.build().deduceRestrictedCapability()) {
        if (NetworkCapabilitiesUtils.inferRestrictedCapability(builder.build())) {
            builder.removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED);
        }