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

Commit 74cf5865 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by junyulai
Browse files

Remove dependencies on hidden network stats APIs

Replace usage with equivalent stable APIs.

Bug: 197717846
Test: atest SettingsRoboTests
  (cherry-picked from ag/16779860)
Change-Id: I4151b831fc83dee9b36292cd7991f9b294ed4ff2
Merged-In: I4151b831fc83dee9b36292cd7991f9b294ed4ff2
parent a6d4788f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -439,7 +439,6 @@ public class AppDataUsageTest {
        assertThat(mFragment.mTemplate.getMatchRule())
                .isEqualTo(NetworkTemplate.MATCH_WIFI);
        assertTrue(mFragment.mTemplate.getSubscriberIds().isEmpty());
        assertThat(mFragment.mTemplate.getNetworkId())
                .isEqualTo(NetworkTemplate.WIFI_NETWORKID_ALL);
        assertTrue(mFragment.mTemplate.getWifiNetworkKeys().isEmpty());
    }
}
+6 −6
Original line number Diff line number Diff line
@@ -81,8 +81,8 @@ public class DataUsageLibTest {
        when(mSubscriptionManager.isActiveSubscriptionId(SUB_ID)).thenReturn(false);

        final NetworkTemplate networkTemplate = DataUsageLib.getMobileTemplate(mContext, SUB_ID);
        assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID)).isTrue();
        assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID_2)).isFalse();
        assertThat(networkTemplate.getSubscriberIds().contains(SUBSCRIBER_ID)).isTrue();
        assertThat(networkTemplate.getSubscriberIds().contains(SUBSCRIBER_ID_2)).isFalse();
    }

    @Test
@@ -94,8 +94,8 @@ public class DataUsageLibTest {
                .thenReturn(new String[] {SUBSCRIBER_ID});

        final NetworkTemplate networkTemplate = DataUsageLib.getMobileTemplate(mContext, SUB_ID);
        assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID)).isTrue();
        assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID_2)).isFalse();
        assertThat(networkTemplate.getSubscriberIds().contains(SUBSCRIBER_ID)).isTrue();
        assertThat(networkTemplate.getSubscriberIds().contains(SUBSCRIBER_ID_2)).isFalse();
    }

    @Test
@@ -107,7 +107,7 @@ public class DataUsageLibTest {
                .thenReturn(new String[] {SUBSCRIBER_ID, SUBSCRIBER_ID_2});

        final NetworkTemplate networkTemplate = DataUsageLib.getMobileTemplate(mContext, SUB_ID);
        assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID)).isTrue();
        assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID_2)).isTrue();
        assertThat(networkTemplate.getSubscriberIds().contains(SUBSCRIBER_ID)).isTrue();
        assertThat(networkTemplate.getSubscriberIds().contains(SUBSCRIBER_ID_2)).isTrue();
    }
}