Merge "Ensure that we don't show excluded tasks when we are not in that task (Bug 17657618) - Fix regression with launching an affiliated task due to clipping changes (Bug 17755902) - Tweaking previous changes to home transition - Disable the debug mode option" into lmp-dev
This commit is contained in:
@@ -161,12 +161,9 @@
|
|||||||
duration of the transition in to recents from home. -->
|
duration of the transition in to recents from home. -->
|
||||||
<integer name="recents_animate_task_enter_from_home_delay">150</integer>
|
<integer name="recents_animate_task_enter_from_home_delay">150</integer>
|
||||||
<!-- The min animation duration for animating the task in when transitioning from home. -->
|
<!-- The min animation duration for animating the task in when transitioning from home. -->
|
||||||
<integer name="recents_animate_task_enter_from_home_duration">200</integer>
|
<integer name="recents_animate_task_enter_from_home_duration">250</integer>
|
||||||
<!-- The total animation stagger delay when entering from home. -->
|
<!-- The animation stagger to apply to each task animation when transitioning from home. -->
|
||||||
<integer name="recents_animate_task_enter_from_home_stagger_delay">110</integer>
|
<integer name="recents_animate_task_enter_from_home_stagger_delay">12</integer>
|
||||||
<!-- The total animation duration added to the last card when entering from home.
|
|
||||||
This value is partialy also added to the previous tasks -->
|
|
||||||
<integer name="recents_animate_task_enter_from_home_stagger_duration">72</integer>
|
|
||||||
<!-- The short duration when animating in/out the lock to app button. -->
|
<!-- The short duration when animating in/out the lock to app button. -->
|
||||||
<integer name="recents_animate_lock_to_app_button_short_duration">150</integer>
|
<integer name="recents_animate_lock_to_app_button_short_duration">150</integer>
|
||||||
<!-- The long duration when animating in/out the lock to app button. -->
|
<!-- The long duration when animating in/out the lock to app button. -->
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
|
|||||||
void showRelativeAffiliatedTask(boolean showNextTask) {
|
void showRelativeAffiliatedTask(boolean showNextTask) {
|
||||||
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
||||||
TaskStack stack = loader.getTaskStack(mSystemServicesProxy, mContext.getResources(),
|
TaskStack stack = loader.getTaskStack(mSystemServicesProxy, mContext.getResources(),
|
||||||
-1, -1, false, null, null);
|
-1, -1, false, true, null, null);
|
||||||
// Return early if there are no tasks
|
// Return early if there are no tasks
|
||||||
if (stack.getTaskCount() == 0) return;
|
if (stack.getTaskCount() == 0) return;
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
|
|||||||
// Get the stack of tasks that we are animating into
|
// Get the stack of tasks that we are animating into
|
||||||
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
||||||
TaskStack stack = loader.getTaskStack(mSystemServicesProxy, mContext.getResources(),
|
TaskStack stack = loader.getTaskStack(mSystemServicesProxy, mContext.getResources(),
|
||||||
runningTaskId, -1, false, null, null);
|
runningTaskId, -1, false, isTopTaskHome, null, null);
|
||||||
if (stack.getTaskCount() == 0) {
|
if (stack.getTaskCount() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -485,7 +485,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
|
|||||||
// which can differ depending on the number of items in the list.
|
// which can differ depending on the number of items in the list.
|
||||||
SystemServicesProxy ssp = mSystemServicesProxy;
|
SystemServicesProxy ssp = mSystemServicesProxy;
|
||||||
List<ActivityManager.RecentTaskInfo> recentTasks =
|
List<ActivityManager.RecentTaskInfo> recentTasks =
|
||||||
ssp.getRecentTasks(3, UserHandle.CURRENT.getIdentifier());
|
ssp.getRecentTasks(3, UserHandle.CURRENT.getIdentifier(), isTopTaskHome);
|
||||||
boolean useThumbnailTransition = !isTopTaskHome;
|
boolean useThumbnailTransition = !isTopTaskHome;
|
||||||
boolean hasRecentTasks = !recentTasks.isEmpty();
|
boolean hasRecentTasks = !recentTasks.isEmpty();
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ public class Constants {
|
|||||||
public static final boolean EnableTaskBarTouchEvents = true;
|
public static final boolean EnableTaskBarTouchEvents = true;
|
||||||
// Enables app-info pane on long-pressing the icon
|
// Enables app-info pane on long-pressing the icon
|
||||||
public static final boolean EnableDevAppInfoOnLongPress = true;
|
public static final boolean EnableDevAppInfoOnLongPress = true;
|
||||||
|
// Enables debug mode
|
||||||
|
public static final boolean EnableDebugMode = false;
|
||||||
// Enables the search bar layout
|
// Enables the search bar layout
|
||||||
public static final boolean EnableSearchLayout = true;
|
public static final boolean EnableSearchLayout = true;
|
||||||
// Enables the thumbnail alpha on the front-most task
|
// Enables the thumbnail alpha on the front-most task
|
||||||
|
|||||||
@@ -182,14 +182,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
|||||||
|
|
||||||
/** Updates the set of recent tasks */
|
/** Updates the set of recent tasks */
|
||||||
void updateRecentsTasks(Intent launchIntent) {
|
void updateRecentsTasks(Intent launchIntent) {
|
||||||
// Load all the tasks
|
|
||||||
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
|
||||||
SpaceNode root = loader.reload(this, Constants.Values.RecentsTaskLoader.PreloadFirstTasksCount);
|
|
||||||
ArrayList<TaskStack> stacks = root.getStacks();
|
|
||||||
if (!stacks.isEmpty()) {
|
|
||||||
mRecentsView.setTaskStacks(root.getStacks());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the configuration based on the launch intent
|
// Update the configuration based on the launch intent
|
||||||
boolean fromSearchHome = launchIntent.getBooleanExtra(
|
boolean fromSearchHome = launchIntent.getBooleanExtra(
|
||||||
AlternateRecentsComponent.EXTRA_FROM_SEARCH_HOME, false);
|
AlternateRecentsComponent.EXTRA_FROM_SEARCH_HOME, false);
|
||||||
@@ -203,6 +195,16 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
|
|||||||
AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1);
|
AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1);
|
||||||
mConfig.launchedWithAltTab = launchIntent.getBooleanExtra(
|
mConfig.launchedWithAltTab = launchIntent.getBooleanExtra(
|
||||||
AlternateRecentsComponent.EXTRA_TRIGGERED_FROM_ALT_TAB, false);
|
AlternateRecentsComponent.EXTRA_TRIGGERED_FROM_ALT_TAB, false);
|
||||||
|
|
||||||
|
// Load all the tasks
|
||||||
|
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
|
||||||
|
SpaceNode root = loader.reload(this,
|
||||||
|
Constants.Values.RecentsTaskLoader.PreloadFirstTasksCount,
|
||||||
|
mConfig.launchedFromHome);
|
||||||
|
ArrayList<TaskStack> stacks = root.getStacks();
|
||||||
|
if (!stacks.isEmpty()) {
|
||||||
|
mRecentsView.setTaskStacks(root.getStacks());
|
||||||
|
}
|
||||||
mConfig.launchedWithNoRecentTasks = !root.hasTasks();
|
mConfig.launchedWithNoRecentTasks = !root.hasTasks();
|
||||||
|
|
||||||
// Create the home intent runnable
|
// Create the home intent runnable
|
||||||
|
|||||||
@@ -220,8 +220,6 @@ public class RecentsConfiguration {
|
|||||||
res.getInteger(R.integer.recents_animate_task_enter_from_home_duration);
|
res.getInteger(R.integer.recents_animate_task_enter_from_home_duration);
|
||||||
taskViewEnterFromHomeStaggerDelay =
|
taskViewEnterFromHomeStaggerDelay =
|
||||||
res.getInteger(R.integer.recents_animate_task_enter_from_home_stagger_delay);
|
res.getInteger(R.integer.recents_animate_task_enter_from_home_stagger_delay);
|
||||||
taskViewEnterFromHomeStaggerDuration =
|
|
||||||
res.getInteger(R.integer.recents_animate_task_enter_from_home_stagger_duration);
|
|
||||||
taskViewExitToHomeDuration =
|
taskViewExitToHomeDuration =
|
||||||
res.getInteger(R.integer.recents_animate_task_exit_to_home_duration);
|
res.getInteger(R.integer.recents_animate_task_exit_to_home_duration);
|
||||||
taskViewRemoveAnimDuration =
|
taskViewRemoveAnimDuration =
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.recents.misc;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import com.android.systemui.recents.Constants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A trigger for catching a debug chord.
|
* A trigger for catching a debug chord.
|
||||||
@@ -48,6 +49,8 @@ public class DebugTrigger {
|
|||||||
* then we just call the callback.
|
* then we just call the callback.
|
||||||
*/
|
*/
|
||||||
public void onKeyEvent(int keyCode) {
|
public void onKeyEvent(int keyCode) {
|
||||||
|
if (!Constants.DebugFlags.App.EnableDebugMode) return;
|
||||||
|
|
||||||
if (mLastKeyCode == 0) {
|
if (mLastKeyCode == 0) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
|
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
|
||||||
mLastKeyCode = keyCode;
|
mLastKeyCode = keyCode;
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ public class SystemServicesProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a list of the recents tasks */
|
/** Returns a list of the recents tasks */
|
||||||
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int numLatestTasks, int userId) {
|
public List<ActivityManager.RecentTaskInfo> getRecentTasks(int numLatestTasks, int userId,
|
||||||
|
boolean isTopTaskHome) {
|
||||||
if (mAm == null) return null;
|
if (mAm == null) return null;
|
||||||
|
|
||||||
// If we are mocking, then create some recent tasks
|
// If we are mocking, then create some recent tasks
|
||||||
@@ -195,10 +196,11 @@ public class SystemServicesProxy {
|
|||||||
// tasks
|
// tasks
|
||||||
|
|
||||||
// Check the first non-recents task, include this task even if it is marked as excluded
|
// Check the first non-recents task, include this task even if it is marked as excluded
|
||||||
// from recents. In other words, only remove excluded tasks if it is not the first task
|
// from recents if we are currently in the app. In other words, only remove excluded
|
||||||
|
// tasks if it is not the first active task.
|
||||||
boolean isExcluded = (t.baseIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
boolean isExcluded = (t.baseIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
||||||
== Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
|
== Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
|
||||||
if (isExcluded && !isFirstValidTask) {
|
if (isExcluded && (isTopTaskHome || !isFirstValidTask)) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,11 +322,12 @@ public class RecentsTaskLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Gets the list of recent tasks, ordered from back to front. */
|
/** Gets the list of recent tasks, ordered from back to front. */
|
||||||
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp) {
|
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp,
|
||||||
|
boolean isTopTaskHome) {
|
||||||
RecentsConfiguration config = RecentsConfiguration.getInstance();
|
RecentsConfiguration config = RecentsConfiguration.getInstance();
|
||||||
List<ActivityManager.RecentTaskInfo> tasks =
|
List<ActivityManager.RecentTaskInfo> tasks =
|
||||||
ssp.getRecentTasks(config.maxNumTasksToLoad,
|
ssp.getRecentTasks(config.maxNumTasksToLoad, UserHandle.CURRENT.getIdentifier(),
|
||||||
UserHandle.CURRENT.getIdentifier());
|
isTopTaskHome);
|
||||||
Collections.reverse(tasks);
|
Collections.reverse(tasks);
|
||||||
return tasks;
|
return tasks;
|
||||||
}
|
}
|
||||||
@@ -408,11 +409,11 @@ public class RecentsTaskLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Reload the set of recent tasks */
|
/** Reload the set of recent tasks */
|
||||||
public SpaceNode reload(Context context, int preloadCount) {
|
public SpaceNode reload(Context context, int preloadCount, boolean isTopTaskHome) {
|
||||||
ArrayList<Task.TaskKey> taskKeys = new ArrayList<Task.TaskKey>();
|
ArrayList<Task.TaskKey> taskKeys = new ArrayList<Task.TaskKey>();
|
||||||
ArrayList<Task> tasksToLoad = new ArrayList<Task>();
|
ArrayList<Task> tasksToLoad = new ArrayList<Task>();
|
||||||
TaskStack stack = getTaskStack(mSystemServicesProxy, context.getResources(),
|
TaskStack stack = getTaskStack(mSystemServicesProxy, context.getResources(),
|
||||||
-1, preloadCount, true, taskKeys, tasksToLoad);
|
-1, preloadCount, true, isTopTaskHome, taskKeys, tasksToLoad);
|
||||||
SpaceNode root = new SpaceNode();
|
SpaceNode root = new SpaceNode();
|
||||||
root.setStack(stack);
|
root.setStack(stack);
|
||||||
|
|
||||||
@@ -429,10 +430,10 @@ public class RecentsTaskLoader {
|
|||||||
/** Creates a lightweight stack of the current recent tasks, without thumbnails and icons. */
|
/** Creates a lightweight stack of the current recent tasks, without thumbnails and icons. */
|
||||||
public TaskStack getTaskStack(SystemServicesProxy ssp, Resources res,
|
public TaskStack getTaskStack(SystemServicesProxy ssp, Resources res,
|
||||||
int preloadTaskId, int preloadTaskCount,
|
int preloadTaskId, int preloadTaskCount,
|
||||||
boolean loadTaskThumbnails, List<Task.TaskKey> taskKeysOut,
|
boolean loadTaskThumbnails, boolean isTopTaskHome,
|
||||||
List<Task> tasksToLoadOut) {
|
List<Task.TaskKey> taskKeysOut, List<Task> tasksToLoadOut) {
|
||||||
RecentsConfiguration config = RecentsConfiguration.getInstance();
|
RecentsConfiguration config = RecentsConfiguration.getInstance();
|
||||||
List<ActivityManager.RecentTaskInfo> tasks = getRecentTasks(ssp);
|
List<ActivityManager.RecentTaskInfo> tasks = getRecentTasks(ssp, isTopTaskHome);
|
||||||
HashMap<Task.ComponentNameKey, ActivityInfoHandle> activityInfoCache =
|
HashMap<Task.ComponentNameKey, ActivityInfoHandle> activityInfoCache =
|
||||||
new HashMap<Task.ComponentNameKey, ActivityInfoHandle>();
|
new HashMap<Task.ComponentNameKey, ActivityInfoHandle>();
|
||||||
ArrayList<Task> tasksToAdd = new ArrayList<Task>();
|
ArrayList<Task> tasksToAdd = new ArrayList<Task>();
|
||||||
|
|||||||
@@ -743,6 +743,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
|
|||||||
for (int i = 0; i < childCount; i++) {
|
for (int i = 0; i < childCount; i++) {
|
||||||
TaskView t = (TaskView) getChildAt(i);
|
TaskView t = (TaskView) getChildAt(i);
|
||||||
if (t == tv) {
|
if (t == tv) {
|
||||||
|
t.setClipViewInStack(false);
|
||||||
t.startLaunchTaskAnimation(r, true, true, lockToTask);
|
t.startLaunchTaskAnimation(r, true, true, lockToTask);
|
||||||
} else {
|
} else {
|
||||||
boolean occludesLaunchTarget = launchTargetTask.group.isTaskAboveTask(t.getTask(),
|
boolean occludesLaunchTarget = launchTargetTask.group.isTaskAboveTask(t.getTask(),
|
||||||
|
|||||||
@@ -418,22 +418,21 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
|
|||||||
} else if (mConfig.launchedFromHome) {
|
} else if (mConfig.launchedFromHome) {
|
||||||
// Animate the tasks up
|
// Animate the tasks up
|
||||||
int frontIndex = (ctx.currentStackViewCount - ctx.currentStackViewIndex - 1);
|
int frontIndex = (ctx.currentStackViewCount - ctx.currentStackViewIndex - 1);
|
||||||
float fraction = (float) frontIndex / (ctx.currentStackViewCount - 1);
|
int delay = mConfig.taskViewEnterFromHomeDelay +
|
||||||
fraction = (float) Math.pow(fraction, 0.85f);
|
frontIndex * mConfig.taskViewEnterFromHomeStaggerDelay;
|
||||||
int delay = (int) (mConfig.taskViewEnterFromHomeDelay +
|
|
||||||
fraction * mConfig.taskViewEnterFromHomeStaggerDelay);
|
setScaleX(transform.scale);
|
||||||
long delayIncrease = (long) (fraction * mConfig.taskViewEnterFromHomeStaggerDuration);
|
setScaleY(transform.scale);
|
||||||
if (!mConfig.fakeShadows) {
|
if (!mConfig.fakeShadows) {
|
||||||
animate().translationZ(transform.translationZ);
|
animate().translationZ(transform.translationZ);
|
||||||
}
|
}
|
||||||
animate()
|
animate()
|
||||||
.scaleX(transform.scale)
|
|
||||||
.scaleY(transform.scale)
|
|
||||||
.translationY(transform.translationY)
|
.translationY(transform.translationY)
|
||||||
.setStartDelay(delay)
|
.setStartDelay(delay)
|
||||||
.setUpdateListener(ctx.updateListener)
|
.setUpdateListener(ctx.updateListener)
|
||||||
.setInterpolator(mConfig.quintOutInterpolator)
|
.setInterpolator(mConfig.quintOutInterpolator)
|
||||||
.setDuration(mConfig.taskViewEnterFromHomeDuration + delayIncrease)
|
.setDuration(mConfig.taskViewEnterFromHomeDuration +
|
||||||
|
frontIndex * mConfig.taskViewEnterFromHomeStaggerDelay)
|
||||||
.withEndAction(new Runnable() {
|
.withEndAction(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user