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

Commit a4deb5cf authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Revert "Update to match now slice APIs""

parents ef975b0a 80c806ab
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import java.util.WeakHashMap;

import androidx.app.slice.Slice;
import androidx.app.slice.SliceProvider;
import androidx.app.slice.builders.SliceAction;
import androidx.app.slice.builders.ListBuilder;

/**
@@ -174,9 +173,8 @@ public class SettingsSliceProvider extends SliceProvider {
                        .setTitle(getContext().getString(R.string.wifi_settings))
                        .setTitleItem(Icon.createWithResource(getContext(), R.drawable.wifi_signal))
                        .setSubtitle(state)
                        .addEndItem(new SliceAction(getBroadcastIntent(ACTION_WIFI_CHANGED),
                                null, finalWifiEnabled))
                        .setPrimaryAction(new SliceAction(getIntent(Intent.ACTION_MAIN), null, null)))
                        .addToggle(getBroadcastIntent(ACTION_WIFI_CHANGED), finalWifiEnabled)
                        .setContentIntent(getIntent(Intent.ACTION_MAIN)))
                .build();
    }

+2 −3
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import com.android.settings.search.DatabaseIndexingUtils;
import com.android.settingslib.core.AbstractPreferenceController;

import androidx.app.slice.Slice;
import androidx.app.slice.builders.SliceAction;
import androidx.app.slice.builders.ListBuilder;
import androidx.app.slice.builders.ListBuilder.RowBuilder;

@@ -64,7 +63,7 @@ public class SliceBuilderUtils {
                .setTitle(sliceData.getTitle())
                .setTitleItem(icon)
                .setSubtitle(subtitleText)
                .setPrimaryAction(new SliceAction(contentIntent, null, null));
                .setContentIntent(contentIntent);

        // TODO (b/71640747) Respect setting availability.

@@ -101,7 +100,7 @@ public class SliceBuilderUtils {
            String key) {
        PendingIntent actionIntent = getActionIntent(context,
                SettingsSliceProvider.ACTION_TOGGLE_CHANGED, key);
        builder.addEndItem(new SliceAction(actionIntent, null, isChecked));
        builder.addToggle(actionIntent, isChecked);
    }

    private static PendingIntent getActionIntent(Context context, String action, String key) {