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

Commit c37171f1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Dynamically return the uri of WifiSlice."

parents f66882f1 45ee7c2a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -93,8 +93,7 @@ public class WifiSlice implements CustomSliceable {
        final SliceAction toggleSliceAction = SliceAction.createToggle(toggleAction,
                null /* actionTitle */, isWifiEnabled);

        final ListBuilder listBuilder = new ListBuilder(mContext, WIFI_SLICE_URI,
                ListBuilder.INFINITY)
        final ListBuilder listBuilder = new ListBuilder(mContext, getUri(), ListBuilder.INFINITY)
                .setAccentColor(color)
                .addRow(new ListBuilder.RowBuilder()
                        .setTitle(title)
+10 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import androidx.slice.core.SliceAction;
import androidx.slice.widget.SliceLiveData;

import com.android.settings.R;
import com.android.settings.slices.CustomSliceRegistry;

import org.junit.Before;
import org.junit.Test;
@@ -97,4 +98,13 @@ public class ContextualWifiSliceTest {
                R.drawable.ic_settings_wireless);
        assertThat(primaryAction.getIcon().toString()).isEqualTo(expectedToggleIcon.toString());
    }

    @Test
    public void getWifiSlice_contextualWifiSlice_shouldReturnContextualWifiSliceUri() {
        mWifiSlice.mPreviouslyDisplayed = true;

        final Slice wifiSlice = mWifiSlice.getSlice();

        assertThat(wifiSlice.getUri()).isEqualTo(CustomSliceRegistry.CONTEXTUAL_WIFI_SLICE_URI);
    }
}