Fix deep link issue of Slice cards in home page
Add setData(uri) back to intent to fix deep link launching error. Change-Id: Ibffce43ddeb9a1388d001515d8d3b320c5b45520 Fixes: 120473478 Test: robotests, visual
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.settings.homepage.contextualcards.deviceinfo;
|
||||
|
||||
import static com.android.settings.slices.CustomSliceRegistry.BATTERY_INFO_SLICE_URI;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -37,6 +35,7 @@ import com.android.settings.SubSettings;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.fuelgauge.BatteryInfo;
|
||||
import com.android.settings.fuelgauge.PowerUsageSummary;
|
||||
import com.android.settings.slices.CustomSliceRegistry;
|
||||
import com.android.settings.slices.CustomSliceable;
|
||||
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 SliceAction primarySliceAction = SliceAction.createDeeplink(getPrimaryAction(), icon,
|
||||
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))
|
||||
.setHeader(new ListBuilder.HeaderBuilder().setTitle(title))
|
||||
.addRow(new ListBuilder.RowBuilder()
|
||||
@@ -81,7 +81,7 @@ public class BatterySlice implements CustomSliceable {
|
||||
|
||||
@Override
|
||||
public Uri getUri() {
|
||||
return BATTERY_INFO_SLICE_URI;
|
||||
return CustomSliceRegistry.BATTERY_INFO_SLICE_URI;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,7 +95,8 @@ public class BatterySlice implements CustomSliceable {
|
||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||
PowerUsageSummary.class.getName(), "" /* key */, screenTitle,
|
||||
MetricsProto.MetricsEvent.SLICE)
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||
.setData(CustomSliceRegistry.BATTERY_INFO_SLICE_URI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -94,7 +94,8 @@ public class DataUsageSlice implements CustomSliceable {
|
||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||
DataUsageSummary.class.getName(), "" /* key */, screenTitle,
|
||||
MetricsProto.MetricsEvent.SLICE)
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||
.setData(CustomSliceRegistry.DATA_USAGE_SLICE_URI);
|
||||
}
|
||||
|
||||
private PendingIntent getPrimaryAction() {
|
||||
|
@@ -85,7 +85,8 @@ public class DeviceInfoSlice implements CustomSliceable {
|
||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||
MyDeviceInfoFragment.class.getName(), "" /* key */, screenTitle,
|
||||
MetricsProto.MetricsEvent.SLICE)
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||
.setData(CustomSliceRegistry.DEVICE_INFO_SLICE_URI);
|
||||
}
|
||||
|
||||
private PendingIntent getPrimaryAction() {
|
||||
|
@@ -80,7 +80,8 @@ public class StorageSlice implements CustomSliceable {
|
||||
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
|
||||
StorageDashboardFragment.class.getName(), "" /* key */, screenTitle,
|
||||
MetricsProto.MetricsEvent.SLICE)
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||
.setData(CustomSliceRegistry.STORAGE_SLICE_URI);
|
||||
}
|
||||
|
||||
private PendingIntent getPrimaryAction() {
|
||||
|
@@ -147,7 +147,8 @@ public class ConnectedDeviceSlice implements CustomSliceable {
|
||||
ConnectedDeviceDashboardFragment.class.getName(), "" /* key */,
|
||||
screenTitle,
|
||||
MetricsProto.MetricsEvent.SLICE)
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName());
|
||||
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
|
||||
.setData(CustomSliceRegistry.CONNECTED_DEVICE_SLICE_URI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -110,7 +110,8 @@ public class LowStorageSlice implements CustomSliceable {
|
||||
StorageSettings.class.getName(), "" /* key */,
|
||||
screenTitle,
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user