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

Commit c5bac2b8 authored by Aaron Huang's avatar Aaron Huang Committed by Automerger Merge Worker
Browse files

Merge "Replace deduceRestrictedCapability with the version in libs/net" am: 544f5d44

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1646910

Change-Id: Ia2864e6fb31b9fd1e5f0c1e950401c084d54607a
parents fe9372a3 544f5d44
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);
        }