Merge "[Large screen] Make slice deep linking to Settings show in 2-pane" into sc-v2-dev
This commit is contained in:
@@ -61,9 +61,15 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
|
||||
private static final String TAG = "SettingsHomepageActivity";
|
||||
|
||||
// Additional extra of Settings#ACTION_SETTINGS_LARGE_SCREEN_DEEP_LINK.
|
||||
// Put true value to the intent when startActivity for a deep link intent from this Activity.
|
||||
public static final String EXTRA_IS_FROM_SETTINGS_HOMEPAGE = "is_from_settings_homepage";
|
||||
|
||||
// Additional extra of Settings#ACTION_SETTINGS_LARGE_SCREEN_DEEP_LINK.
|
||||
// Set & get Uri of the Intent separately to prevent failure of Intent#ParseUri.
|
||||
public static final String EXTRA_SETTINGS_LARGE_SCREEN_DEEP_LINK_INTENT_DATA =
|
||||
"settings_large_screen_deep_link_intent_data";
|
||||
|
||||
// An alias class name of SettingsHomepageActivity.
|
||||
public static final String ALIAS_DEEP_LINK = "com.android.settings.DeepLinkHomepageActivity";
|
||||
|
||||
@@ -232,10 +238,13 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
targetIntent.replaceExtras(intent);
|
||||
|
||||
targetIntent.putExtra(EXTRA_IS_FROM_SETTINGS_HOMEPAGE, true);
|
||||
targetIntent.putExtra(SettingsActivity.EXTRA_IS_FROM_SLICE, false);
|
||||
|
||||
targetIntent.setData(intent.getParcelableExtra(
|
||||
SettingsHomepageActivity.EXTRA_SETTINGS_LARGE_SCREEN_DEEP_LINK_INTENT_DATA));
|
||||
// Set 2-pane pair rule for the deep link page.
|
||||
ActivityEmbeddingRulesController.registerTwoPanePairRule(this,
|
||||
new ComponentName(Utils.SETTINGS_PACKAGE_NAME, ALIAS_DEEP_LINK),
|
||||
getDeepLinkComponent(),
|
||||
targetComponentName,
|
||||
targetIntent.getAction(),
|
||||
true /* finishPrimaryWithSecondary */,
|
||||
@@ -251,6 +260,10 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
startActivity(targetIntent);
|
||||
}
|
||||
|
||||
protected ComponentName getDeepLinkComponent() {
|
||||
return new ComponentName(Utils.SETTINGS_PACKAGE_NAME, ALIAS_DEEP_LINK);
|
||||
}
|
||||
|
||||
private String getHighlightMenuKey() {
|
||||
final Intent intent = getIntent();
|
||||
if (intent != null && TextUtils.equals(intent.getAction(),
|
||||
|
Reference in New Issue
Block a user