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

Commit 314b6803 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Rename setDataEnabledWithReason

1. Rename setDataEnabledWithReason to
setDataEnabledForReasn

2. Allow isDataConnectionAllowed to be accessed by
same apps as isDataEnabledForReason

3. Make these apis public

Bug: 156332911
Test: cts and build
Change-Id: I1ad5de252ea445e287439195a240a5603f7ede8f
Merged-In: I1ad5de252ea445e287439195a240a5603f7ede8f
parent 7ccbe50a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ public class DataEnabledSettings {
     *
     * @return {@code true} if the overall data is enabled; {@code false} if not.
     */
    public synchronized boolean isDataEnabledWithReason(
    public synchronized boolean isDataEnabledForReason(
            @TelephonyManager.DataEnabledReason int reason) {
        switch (reason) {
            case TelephonyManager.DATA_ENABLED_REASON_USER:
+2 −2
Original line number Diff line number Diff line
@@ -130,13 +130,13 @@ public class DataEnabledSettingsTest extends TelephonyTest {
    public void testSetThermalDataEnabled() throws Exception {
        mDataEnabledSettingsUT.setDataEnabled(TelephonyManager.DATA_ENABLED_REASON_THERMAL,
                false);
        assertFalse(mDataEnabledSettingsUT.isDataEnabledWithReason(
        assertFalse(mDataEnabledSettingsUT.isDataEnabledForReason(
                TelephonyManager.DATA_ENABLED_REASON_THERMAL));
        assertFalse(mDataEnabledSettingsUT.isDataEnabled());

        mDataEnabledSettingsUT.setDataEnabled(TelephonyManager.DATA_ENABLED_REASON_THERMAL,
                true);
        assertTrue(mDataEnabledSettingsUT.isDataEnabledWithReason(
        assertTrue(mDataEnabledSettingsUT.isDataEnabledForReason(
                TelephonyManager.DATA_ENABLED_REASON_THERMAL));
        assertTrue(mDataEnabledSettingsUT.isDataEnabled());
    }