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

Commit fb695782 authored by Sunny Shao's avatar Sunny Shao
Browse files

Use FooterPreference in xml explicitly

Removed the FooterPreferenceMixin from the BillingCycleSettings page.

Fixes: 139099367
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.datausage
Change-Id: I408e433b3366a617b6c5a6fdb18f4830de4b8287
parent 656e4ef7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:key="billing_cycle_settings"
    android:title="@string/billing_cycle">

@@ -39,4 +40,10 @@
        android:key="data_limit"
        android:title="@string/data_limit" />

    <com.android.settingslib.widget.FooterPreference
        android:key="billing_cycle_footer"
        android:title="@string/data_warning_footnote"
        android:selectable="false"
        settings:searchable="false"/>

</PreferenceScreen>
+0 −2
Original line number Diff line number Diff line
@@ -118,8 +118,6 @@ public class BillingCycleSettings extends DataUsageBaseFragment implements
        mEnableDataLimit = (SwitchPreference) findPreference(KEY_SET_DATA_LIMIT);
        mEnableDataLimit.setOnPreferenceChangeListener(this);
        mDataLimit = findPreference(KEY_DATA_LIMIT);

        mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.data_warning_footnote);
    }

    @Override
+0 −6
Original line number Diff line number Diff line
@@ -47,8 +47,6 @@ import androidx.preference.SwitchPreference;

import com.android.settings.testutils.shadow.ShadowFragment;
import com.android.settingslib.NetworkPolicyEditor;
import com.android.settingslib.widget.FooterPreference;
import com.android.settingslib.widget.FooterPreferenceMixinCompat;

import org.junit.Before;
import org.junit.Test;
@@ -58,7 +56,6 @@ import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;

@RunWith(RobolectricTestRunner.class)
public class BillingCycleSettingsTest {
@@ -162,9 +159,6 @@ public class BillingCycleSettingsTest {
        when(mConnectivityManager.isNetworkSupported(anyInt())).thenReturn(true);
        final SwitchPreference preference = mock(SwitchPreference.class);
        when(billingCycleSettings.findPreference(anyString())).thenReturn(preference);
        final FooterPreferenceMixinCompat footer = mock(FooterPreferenceMixinCompat.class);
        ReflectionHelpers.setField(billingCycleSettings, "mFooterPreferenceMixin", footer);
        when(footer.createFooterPreference()).thenReturn(mock(FooterPreference.class));

        billingCycleSettings.onCreate(Bundle.EMPTY);