Merge "Fix deep link issue of Slice cards in home page"
This commit is contained in:
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package com.android.settings.homepage.contextualcards.deviceinfo;
|
package com.android.settings.homepage.contextualcards.deviceinfo;
|
||||||
|
|
||||||
import static com.android.settings.slices.CustomSliceRegistry.BATTERY_INFO_SLICE_URI;
|
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -37,6 +35,7 @@ import com.android.settings.SubSettings;
|
|||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.fuelgauge.BatteryInfo;
|
import com.android.settings.fuelgauge.BatteryInfo;
|
||||||
import com.android.settings.fuelgauge.PowerUsageSummary;
|
import com.android.settings.fuelgauge.PowerUsageSummary;
|
||||||
|
import com.android.settings.slices.CustomSliceRegistry;
|
||||||
import com.android.settings.slices.CustomSliceable;
|
import com.android.settings.slices.CustomSliceable;
|
||||||
import com.android.settings.slices.SliceBuilderUtils;
|
import com.android.settings.slices.SliceBuilderUtils;
|
||||||
|
|
||||||
@@ -66,7 +65,8 @@ public class BatterySlice implements CustomSliceable {
|
|||||||
final CharSequence title = mContext.getText(R.string.power_usage_summary_title);
|
final CharSequence title = mContext.getText(R.string.power_usage_summary_title);
|
||||||
final SliceAction primarySliceAction = SliceAction.createDeeplink(getPrimaryAction(), icon,
|
final SliceAction primarySliceAction = SliceAction.createDeeplink(getPrimaryAction(), icon,
|
||||||
ListBuilder.ICON_IMAGE, title);
|
ListBuilder.ICON_IMAGE, title);
|
||||||
final Slice slice = new ListBuilder(mContext, BATTERY_INFO_SLICE_URI, ListBuilder.INFINITY)
|
final Slice slice = new ListBuilder(mContext, CustomSliceRegistry.BATTERY_INFO_SLICE_URI,
|
||||||
|
ListBuilder.INFINITY)
|
||||||
.setAccentColor(Utils.getColorAccentDefaultColor(mContext))
|
.setAccentColor(Utils.getColorAccentDefaultColor(mContext))
|
||||||
.setHeader(new ListBuilder.HeaderBuilder().setTitle(title))
|
.setHeader(new ListBuilder.HeaderBuilder().setTitle(title))
|
||||||
.addRow(new ListBuilder.RowBuilder()
|
.addRow(new ListBuilder.RowBuilder()
|
||||||
@@ -81,7 +81,7 @@ public class BatterySlice implements CustomSliceable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Uri getUri() {
|
public Uri getUri() {
|
||||||
return BATTERY_INFO_SLICE_URI;
|
return CustomSliceRegistry.BATTERY_INFO_SLICE_URI;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,7 +95,8 @@ public class BatterySlice implements CustomSliceable {
|
|||||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||||
PowerUsageSummary.class.getName(), "" /* key */, screenTitle,
|
PowerUsageSummary.class.getName(), "" /* key */, screenTitle,
|
||||||
MetricsProto.MetricsEvent.SLICE)
|
MetricsProto.MetricsEvent.SLICE)
|
||||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||||
|
.setData(CustomSliceRegistry.BATTERY_INFO_SLICE_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ public class DataUsageSlice implements CustomSliceable {
|
|||||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||||
DataUsageSummary.class.getName(), "" /* key */, screenTitle,
|
DataUsageSummary.class.getName(), "" /* key */, screenTitle,
|
||||||
MetricsProto.MetricsEvent.SLICE)
|
MetricsProto.MetricsEvent.SLICE)
|
||||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||||
|
.setData(CustomSliceRegistry.DATA_USAGE_SLICE_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingIntent getPrimaryAction() {
|
private PendingIntent getPrimaryAction() {
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ public class DeviceInfoSlice implements CustomSliceable {
|
|||||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||||
MyDeviceInfoFragment.class.getName(), "" /* key */, screenTitle,
|
MyDeviceInfoFragment.class.getName(), "" /* key */, screenTitle,
|
||||||
MetricsProto.MetricsEvent.SLICE)
|
MetricsProto.MetricsEvent.SLICE)
|
||||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||||
|
.setData(CustomSliceRegistry.DEVICE_INFO_SLICE_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingIntent getPrimaryAction() {
|
private PendingIntent getPrimaryAction() {
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ public class StorageSlice implements CustomSliceable {
|
|||||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||||
StorageDashboardFragment.class.getName(), "" /* key */, screenTitle,
|
StorageDashboardFragment.class.getName(), "" /* key */, screenTitle,
|
||||||
MetricsProto.MetricsEvent.SLICE)
|
MetricsProto.MetricsEvent.SLICE)
|
||||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||||
|
.setData(CustomSliceRegistry.STORAGE_SLICE_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PendingIntent getPrimaryAction() {
|
private PendingIntent getPrimaryAction() {
|
||||||
|
|||||||
@@ -147,7 +147,8 @@ public class ConnectedDeviceSlice implements CustomSliceable {
|
|||||||
ConnectedDeviceDashboardFragment.class.getName(), "" /* key */,
|
ConnectedDeviceDashboardFragment.class.getName(), "" /* key */,
|
||||||
screenTitle,
|
screenTitle,
|
||||||
MetricsProto.MetricsEvent.SLICE)
|
MetricsProto.MetricsEvent.SLICE)
|
||||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||||
|
.setData(CustomSliceRegistry.CONNECTED_DEVICE_SLICE_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ public class LowStorageSlice implements CustomSliceable {
|
|||||||
StorageSettings.class.getName(), "" /* key */,
|
StorageSettings.class.getName(), "" /* key */,
|
||||||
screenTitle,
|
screenTitle,
|
||||||
MetricsProto.MetricsEvent.SLICE)
|
MetricsProto.MetricsEvent.SLICE)
|
||||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||||
|
.setData(CustomSliceRegistry.LOW_STORAGE_SLICE_URI);
|
||||||
}
|
}
|
||||||
|
|
||||||
private RowBuilder buildRowBuilder(CharSequence title, String summary, IconCompat icon) {
|
private RowBuilder buildRowBuilder(CharSequence title, String summary, IconCompat icon) {
|
||||||
|
|||||||
Reference in New Issue
Block a user