Support slice deep links highlighting menu entries

- Add an interface to get highlight menu key resource in Sliceable
- Force implementing the new interface in TogglePreferenceController and
  CustomSliceable at syntax level
- Update the slice index db schema

Bug: 204695404
Test: manual, robotest build pass, unit
Change-Id: I0b5068bccd04f1590023de7f3385bc0a4c6fa47b
This commit is contained in:
Jason Chiu
2021-10-31 23:40:26 +08:00
parent e1ec69fa1a
commit 594eb43159
20 changed files with 161 additions and 45 deletions

View File

@@ -27,6 +27,7 @@ import com.android.settings.slices.SliceBackgroundWorker;
public class FakeToggleController extends TogglePreferenceController {
public static final String AVAILABILITY_KEY = "fake_toggle_availability_key";
public static final int HIGHLIGHT_MENU_RES = 5678;
public static final IntentFilter INTENT_FILTER = new IntentFilter(
WifiManager.WIFI_AP_STATE_CHANGED_ACTION);
@@ -70,6 +71,11 @@ public class FakeToggleController extends TogglePreferenceController {
return true;
}
@Override
public int getSliceHighlightMenuRes() {
return HIGHLIGHT_MENU_RES;
}
@Override
public Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
return TestWorker.class;