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

Commit 194c50b1 authored by Nagendra Prasad Nagarle Basavaraju's avatar Nagendra Prasad Nagarle Basavaraju Committed by Jack Yu
Browse files

Allow emergency data on bootstrap SIM

For emergency network request, always fetch the non-bootstrap
emergency APN from the APN database. Also exclude emergency data
usage from the total data usage calculation.

Bug: 319319590
Test: atest FrameworksTelephonyTests
Test: Manual test at b/332619961 & b/319319590#comment73
Test: Basic test @ b/332640742#comment1

Merged-In: I178f92708f9579144f0c7c756874c8f7e41c1365
Change-Id: I178f92708f9579144f0c7c756874c8f7e41c1365
parent a7ff5cbe
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1545,7 +1545,7 @@ public class DataNetworkController extends Handler {
            DataProfile emergencyProfile = mDataProfileManager.getDataProfileForNetworkRequest(
                    networkRequest, getDataNetworkType(transport),
                    mServiceState.isUsingNonTerrestrialNetwork(),
                    isEsimBootStrapProvisioningActivated(), true);
                    false /*isEsimBootStrapProvisioning*/, true);

            // Check if the profile is being throttled.
            if (mDataConfigManager.shouldHonorRetryTimerForEmergencyNetworkRequest()
@@ -1801,6 +1801,9 @@ public class DataNetworkController extends Handler {

            if (!TextUtils.isEmpty(subscriberId)) {
                builder.setSubscriberIds(Set.of(subscriberId));
                // Consider data usage calculation of only metered network.
                // Emergency data usage is excluded.
                builder.setMeteredness(android.net.NetworkStats.METERED_YES);
                NetworkTemplate template = builder.build();
                final NetworkStats.Bucket ret = networkStatsManager
                        .querySummaryForDevice(template, 0L, System.currentTimeMillis());