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

Commit d53c6d57 authored by Fan Zhang's avatar Fan Zhang
Browse files

Add emergency broadcast to app & notification settings.

Also fixed a bug where progressive disclosure expand button is displayed
incorrectly when # of preference == threshold exactly.

Change-Id: I518687e374853ae8ab1c7e5337822492d6fd99ff
Fix: 36557600
Test: robotests
parent 10158fee
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -32,6 +32,17 @@
        android:key="dashboard_tile_placeholder"
        android:order="10" />

    <com.android.settingslib.RestrictedPreference
        android:key="app_and_notif_cell_broadcast_settings"
        android:title="@string/cell_broadcast_settings"
        android:order="15"
        settings:useAdminDisabledSummary="true">
        <intent
            android:action="android.intent.action.MAIN"
            android:targetPackage="com.android.cellbroadcastreceiver"
            android:targetClass="com.android.cellbroadcastreceiver.CellBroadcastSettings" />
    </com.android.settingslib.RestrictedPreference>

    <Preference
        android:key="special_access"
        android:fragment="com.android.settings.applications.SpecialAccessSettings"
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ public class ProgressiveDisclosureMixin implements Preference.OnPreferenceClickL
     * Whether the screen should be collapsed.
     */
    public boolean shouldCollapse(PreferenceScreen screen) {
        return !mUserExpanded && screen.getPreferenceCount() >= mTileLimit;
        return !mUserExpanded && screen.getPreferenceCount() > mTileLimit;
    }

    /**
+9 −0
Original line number Diff line number Diff line
@@ -92,6 +92,15 @@ public class ProgressiveDisclosureTest {
        assertThat(mMixin.shouldCollapse(mScreen)).isFalse();
    }

    @Test
    public void shouldNotCollapse_preferenceCountSameAsThreshold() {
        when(mScreen.getPreferenceCount()).thenReturn(5);

        mMixin.setTileLimit(5);

        assertThat(mMixin.shouldCollapse(mScreen)).isFalse();
    }

    @Test
    public void shouldNotCollapse_whenStartAsExpanded() {
        when(mScreen.getPreferenceCount()).thenReturn(5);