Loading packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java +12 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.recent; import android.app.Activity; import android.app.ActivityManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading @@ -30,6 +31,8 @@ import com.android.systemui.R; import com.android.systemui.SystemUIApplication; import com.android.systemui.statusbar.tablet.StatusBarPanel; import java.util.List; public class RecentsActivity extends Activity { public static final String TOGGLE_RECENTS_INTENT = "com.android.systemui.TOGGLE_RECENTS"; public static final String CLOSE_RECENTS_INTENT = "com.android.systemui.CLOSE_RECENTS"; Loading Loading @@ -122,11 +125,15 @@ public class RecentsActivity extends Activity { public void dismissAndGoBack() { if (mRecentsPanel != null) { final SystemUIApplication app = (SystemUIApplication) getApplication(); final RecentTasksLoader recentTasksLoader = app.getRecentTasksLoader(); TaskDescription firstTask = mRecentsPanel.getBottomTask(); if (firstTask != null && mRecentsPanel.simulateClick(firstTask)) { // recents panel will take care of calling show(false); final ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(2, ActivityManager.RECENT_WITH_EXCLUDED | ActivityManager.RECENT_IGNORE_UNAVAILABLE); if (recentTasks.size() > 1 && mRecentsPanel.simulateClick(recentTasks.get(1).persistentId)) { // recents panel will take care of calling show(false) through simulateClick return; } mRecentsPanel.show(false); Loading packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +2 −2 Original line number Diff line number Diff line Loading @@ -76,11 +76,11 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView } } public View findViewForTask(TaskDescription task) { public View findViewForTask(int persistentTaskId) { for (int i = 0; i < mLinearLayout.getChildCount(); i++) { View v = mLinearLayout.getChildAt(i); RecentsPanelView.ViewHolder holder = (RecentsPanelView.ViewHolder) v.getTag(); if (holder.taskDescription == task) { if (holder.taskDescription.persistentTaskId == persistentTaskId) { return v; } } Loading packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +4 −22 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener public void setAdapter(TaskDescriptionAdapter adapter); public void setCallback(RecentsCallback callback); public void setMinSwipeAlpha(float minAlpha); public View findViewForTask(TaskDescription task); public View findViewForTask(int persistentTaskId); } private final class OnLongClickDelegate implements View.OnLongClickListener { Loading Loading @@ -518,24 +518,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener showIfReady(); } public TaskDescription getBottomTask() { if (mRecentsContainer != null) { ViewGroup container = mRecentsContainer; if (container instanceof RecentsScrollView) { container = (ViewGroup) container.findViewById( R.id.recents_linear_layout); } if (container.getChildCount() > 0) { View v = container.getChildAt(container.getChildCount() - 1); if (v.getTag() instanceof ViewHolder) { ViewHolder h = (ViewHolder)v.getTag(); return h.taskDescription; } } } return null; } public void onWindowAnimationStart() { if (mItemToAnimateInWhenWindowAnimationIsFinished != null) { final int startDelay = 100; Loading Loading @@ -622,11 +604,11 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener setContentDescription(recentAppsAccessibilityDescription); } public boolean simulateClick(TaskDescription task) { public boolean simulateClick(int persistentTaskId) { if (mRecentsContainer instanceof RecentsScrollView){ RecentsScrollView scrollView = (RecentsScrollView) mRecentsContainer; View v = scrollView.findViewForTask(task); View v = scrollView.findViewForTask(persistentTaskId); if (v != null) { handleOnClick(v); return true; Loading packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +2 −2 Original line number Diff line number Diff line Loading @@ -77,11 +77,11 @@ public class RecentsVerticalScrollView extends ScrollView } } public View findViewForTask(TaskDescription task) { public View findViewForTask(int persistentTaskId) { for (int i = 0; i < mLinearLayout.getChildCount(); i++) { View v = mLinearLayout.getChildAt(i); RecentsPanelView.ViewHolder holder = (RecentsPanelView.ViewHolder) v.getTag(); if (holder.taskDescription == task) { if (holder.taskDescription.persistentTaskId == persistentTaskId) { return v; } } Loading Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java +12 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.recent; import android.app.Activity; import android.app.ActivityManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading @@ -30,6 +31,8 @@ import com.android.systemui.R; import com.android.systemui.SystemUIApplication; import com.android.systemui.statusbar.tablet.StatusBarPanel; import java.util.List; public class RecentsActivity extends Activity { public static final String TOGGLE_RECENTS_INTENT = "com.android.systemui.TOGGLE_RECENTS"; public static final String CLOSE_RECENTS_INTENT = "com.android.systemui.CLOSE_RECENTS"; Loading Loading @@ -122,11 +125,15 @@ public class RecentsActivity extends Activity { public void dismissAndGoBack() { if (mRecentsPanel != null) { final SystemUIApplication app = (SystemUIApplication) getApplication(); final RecentTasksLoader recentTasksLoader = app.getRecentTasksLoader(); TaskDescription firstTask = mRecentsPanel.getBottomTask(); if (firstTask != null && mRecentsPanel.simulateClick(firstTask)) { // recents panel will take care of calling show(false); final ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(2, ActivityManager.RECENT_WITH_EXCLUDED | ActivityManager.RECENT_IGNORE_UNAVAILABLE); if (recentTasks.size() > 1 && mRecentsPanel.simulateClick(recentTasks.get(1).persistentId)) { // recents panel will take care of calling show(false) through simulateClick return; } mRecentsPanel.show(false); Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +2 −2 Original line number Diff line number Diff line Loading @@ -76,11 +76,11 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView } } public View findViewForTask(TaskDescription task) { public View findViewForTask(int persistentTaskId) { for (int i = 0; i < mLinearLayout.getChildCount(); i++) { View v = mLinearLayout.getChildAt(i); RecentsPanelView.ViewHolder holder = (RecentsPanelView.ViewHolder) v.getTag(); if (holder.taskDescription == task) { if (holder.taskDescription.persistentTaskId == persistentTaskId) { return v; } } Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java +4 −22 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener public void setAdapter(TaskDescriptionAdapter adapter); public void setCallback(RecentsCallback callback); public void setMinSwipeAlpha(float minAlpha); public View findViewForTask(TaskDescription task); public View findViewForTask(int persistentTaskId); } private final class OnLongClickDelegate implements View.OnLongClickListener { Loading Loading @@ -518,24 +518,6 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener showIfReady(); } public TaskDescription getBottomTask() { if (mRecentsContainer != null) { ViewGroup container = mRecentsContainer; if (container instanceof RecentsScrollView) { container = (ViewGroup) container.findViewById( R.id.recents_linear_layout); } if (container.getChildCount() > 0) { View v = container.getChildAt(container.getChildCount() - 1); if (v.getTag() instanceof ViewHolder) { ViewHolder h = (ViewHolder)v.getTag(); return h.taskDescription; } } } return null; } public void onWindowAnimationStart() { if (mItemToAnimateInWhenWindowAnimationIsFinished != null) { final int startDelay = 100; Loading Loading @@ -622,11 +604,11 @@ public class RecentsPanelView extends FrameLayout implements OnItemClickListener setContentDescription(recentAppsAccessibilityDescription); } public boolean simulateClick(TaskDescription task) { public boolean simulateClick(int persistentTaskId) { if (mRecentsContainer instanceof RecentsScrollView){ RecentsScrollView scrollView = (RecentsScrollView) mRecentsContainer; View v = scrollView.findViewForTask(task); View v = scrollView.findViewForTask(persistentTaskId); if (v != null) { handleOnClick(v); return true; Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +2 −2 Original line number Diff line number Diff line Loading @@ -77,11 +77,11 @@ public class RecentsVerticalScrollView extends ScrollView } } public View findViewForTask(TaskDescription task) { public View findViewForTask(int persistentTaskId) { for (int i = 0; i < mLinearLayout.getChildCount(); i++) { View v = mLinearLayout.getChildAt(i); RecentsPanelView.ViewHolder holder = (RecentsPanelView.ViewHolder) v.getTag(); if (holder.taskDescription == task) { if (holder.taskDescription.persistentTaskId == persistentTaskId) { return v; } } Loading