[Large screen] Make slice deep linking to Settings show in 2-pane

- add a standalone home activity for slice deep link.
- add EXTRA_IS_FROM_SLICE to control the slice deep link flow.
- Intent#parseUri fails if the intent data schema is set.
  Add EXTRA_SETTINGS_LARGE_SCREEN_DEEP_LINK_INTENT_DATA to relay the
  data schema.

Bug: 201397123
Test: manual, robotest
      1.  Say 'Enable NFC'/'Enable Bluetooth'to Google assistant.
      2.  Click the the NFC/BT Slice.
Change-Id: Ia3216956328c32b2109cb2d70ad1105327661f26
This commit is contained in:
Arc Wang
2021-09-28 20:39:15 +08:00
committed by Jason Chiu
parent 929e577e1b
commit a63e9c625d
6 changed files with 126 additions and 28 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.slices;
import static com.android.settings.SettingsActivity.EXTRA_IS_FROM_SLICE;
import static com.android.settings.core.BasePreferenceController.DISABLED_DEPENDENT_SETTING;
import static com.android.settings.slices.SettingsSliceProvider.EXTRA_SLICE_KEY;
@@ -211,7 +212,9 @@ public class SliceBuilderUtils {
.setTitleText(screenTitle)
.setSourceMetricsCategory(sourceMetricsCategory)
.toIntent();
searchDestination.putExtra(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key)
searchDestination
.putExtra(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key)
.putExtra(EXTRA_IS_FROM_SLICE, true)
.setAction("com.android.settings.SEARCH_RESULT_TRAMPOLINE")
.setComponent(null);
searchDestination.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);