Merge "Support launching activities in a new task for Injection." into sc-v2-dev am: 8e50f97838 am: a488452f95
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15959435 Change-Id: I85306ed321c2f07719cf9f22aaac44f5101d58aa
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settingslib.drawer;
|
||||
|
||||
import static com.android.settingslib.drawer.TileUtils.META_DATA_KEY_ORDER;
|
||||
import static com.android.settingslib.drawer.TileUtils.META_DATA_KEY_PROFILE;
|
||||
import static com.android.settingslib.drawer.TileUtils.META_DATA_NEW_TASK;
|
||||
import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_ICON;
|
||||
import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_KEYHINT;
|
||||
import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SUMMARY;
|
||||
@@ -328,6 +329,18 @@ public abstract class Tile implements Parcelable {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the {@link Activity} should be launched in a separate task.
|
||||
*/
|
||||
public boolean isNewTask(Context context) {
|
||||
ensureMetadataNotStale(context);
|
||||
if (mMetaData != null
|
||||
&& mMetaData.containsKey(META_DATA_NEW_TASK)) {
|
||||
return mMetaData.getBoolean(META_DATA_NEW_TASK);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures metadata is not stale for this tile.
|
||||
*/
|
||||
|
||||
@@ -229,6 +229,13 @@ public class TileUtils {
|
||||
*/
|
||||
public static final String META_DATA_KEY_PROFILE = "com.android.settings.profile";
|
||||
|
||||
/**
|
||||
* Name of the meta-data item that should be set in the AndroidManifest.xml
|
||||
* to specify whether the {@link android.app.Activity} should be launched in a separate task.
|
||||
* This should be a boolean value {@code true} or {@code false}, set using {@code android:value}
|
||||
*/
|
||||
public static final String META_DATA_NEW_TASK = "com.android.settings.new_task";
|
||||
|
||||
/**
|
||||
* Build a list of DashboardCategory.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user