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

Commit 8b95b7a6 authored by Yanting Yang's avatar Yanting Yang
Browse files

Update subtext for "Network & internet"

Remove "and" to align with the other menu items.

Fixes: 183642373
Test: robotests & visual
Change-Id: I4d48b9c5a867d7afa04b7c3f0d6495b455df6621
parent 31389702
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.settings.network;

import android.content.Context;
import android.icu.text.ListFormatter;
import android.text.BidiFormatter;
import android.text.TextUtils;

@@ -75,6 +74,20 @@ public class TopLevelNetworkEntryPreferenceController extends BasePreferenceCont
                && !TextUtils.isEmpty(hotspotSummary)) {
            summaries.add(hotspotSummary);
        }
        return ListFormatter.getInstance().format(summaries);
        return concatSummaries(summaries);
    }

    private CharSequence concatSummaries(List<String> summaries) {
        if (summaries.isEmpty()) {
            return mContext.getText(R.string.summary_placeholder);
        }

        String summary = summaries.get(0);
        final int summary_size = summaries.size();
        for (int i = 1; i < summary_size; i++) {
            summary = mContext.getString(R.string.join_two_unrelated_items, summary,
                    summaries.get(i));
        }
        return summary;
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ public class TopLevelNetworkEntryPreferenceControllerTest {
        when(mTetherPreferenceController.isAvailable()).thenReturn(true);

        assertThat(mController.getSummary())
                .isEqualTo("Wi\u2011Fi, mobile, data usage, and hotspot");
                .isEqualTo("Wi\u2011Fi, mobile, data usage, hotspot");
    }

    @Test
@@ -101,6 +101,6 @@ public class TopLevelNetworkEntryPreferenceControllerTest {
        when(mMobileNetworkPreferenceController.isAvailable()).thenReturn(false);
        when(mTetherPreferenceController.isAvailable()).thenReturn(false);

        assertThat(mController.getSummary()).isEqualTo("Wi\u2011Fi and data usage");
        assertThat(mController.getSummary()).isEqualTo("Wi\u2011Fi, data usage");
    }
}