Loading packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +6 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.recents; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.util.DisplayMetrics; import android.util.TypedValue; Loading @@ -31,6 +32,7 @@ public class RecentsConfiguration { DisplayMetrics mDisplayMetrics; public Rect systemInsets = new Rect(); public Rect displayRect = new Rect(); /** Private constructor */ private RecentsConfiguration() {} Loading @@ -51,10 +53,11 @@ public class RecentsConfiguration { /** Updates the state, given the specified context */ void update(Context context) { mDisplayMetrics = context.getResources().getDisplayMetrics(); Resources res = context.getResources(); DisplayMetrics dm = res.getDisplayMetrics(); mDisplayMetrics = dm; boolean isPortrait = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; displayRect.set(0, 0, dm.widthPixels, dm.heightPixels); } public void updateSystemInsets(Rect insets) { Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +14 −6 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.recents.views; import android.app.ActivityOptions; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; Loading Loading @@ -210,11 +211,14 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV int offsetX = 0; int offsetY = 0; if (tv == null) { // Launch the activity // If there is no actual task view, then use the stack view as the source view // and then offset to the expected transform rect, but bound this to just // outside the display rect (to ensure we don't animate from too far away) RecentsConfiguration config = RecentsConfiguration.getInstance(); sourceView = stackView; transform = stackView.getStackTransform(stack.indexOfTask(task)); offsetX = transform.rect.left; offsetY = transform.rect.top; offsetY = Math.min(transform.rect.top, config.displayRect.height()); } else { transform = stackView.getStackTransform(stack.indexOfTask(task)); } Loading Loading @@ -242,11 +246,15 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV i.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK); try { if (opts != null) { getContext().startActivityAsUser(i, opts.toBundle(), UserHandle.CURRENT); } else { getContext().startActivityAsUser(i, UserHandle.CURRENT); } } catch (ActivityNotFoundException anfe) { Console.logError(getContext(), "Could not start Activity"); } Console.logTraceTime(Constants.DebugFlags.App.TimeRecentsLaunchTask, Constants.DebugFlags.App.TimeRecentsLaunchKey, "startActivity"); Loading Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +6 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.recents; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.util.DisplayMetrics; import android.util.TypedValue; Loading @@ -31,6 +32,7 @@ public class RecentsConfiguration { DisplayMetrics mDisplayMetrics; public Rect systemInsets = new Rect(); public Rect displayRect = new Rect(); /** Private constructor */ private RecentsConfiguration() {} Loading @@ -51,10 +53,11 @@ public class RecentsConfiguration { /** Updates the state, given the specified context */ void update(Context context) { mDisplayMetrics = context.getResources().getDisplayMetrics(); Resources res = context.getResources(); DisplayMetrics dm = res.getDisplayMetrics(); mDisplayMetrics = dm; boolean isPortrait = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; displayRect.set(0, 0, dm.widthPixels, dm.heightPixels); } public void updateSystemInsets(Rect insets) { Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +14 −6 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.recents.views; import android.app.ActivityOptions; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; Loading Loading @@ -210,11 +211,14 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV int offsetX = 0; int offsetY = 0; if (tv == null) { // Launch the activity // If there is no actual task view, then use the stack view as the source view // and then offset to the expected transform rect, but bound this to just // outside the display rect (to ensure we don't animate from too far away) RecentsConfiguration config = RecentsConfiguration.getInstance(); sourceView = stackView; transform = stackView.getStackTransform(stack.indexOfTask(task)); offsetX = transform.rect.left; offsetY = transform.rect.top; offsetY = Math.min(transform.rect.top, config.displayRect.height()); } else { transform = stackView.getStackTransform(stack.indexOfTask(task)); } Loading Loading @@ -242,11 +246,15 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV i.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK); try { if (opts != null) { getContext().startActivityAsUser(i, opts.toBundle(), UserHandle.CURRENT); } else { getContext().startActivityAsUser(i, UserHandle.CURRENT); } } catch (ActivityNotFoundException anfe) { Console.logError(getContext(), "Could not start Activity"); } Console.logTraceTime(Constants.DebugFlags.App.TimeRecentsLaunchTask, Constants.DebugFlags.App.TimeRecentsLaunchKey, "startActivity"); Loading