frameworks/base
Revision | 7a5d3a11b5715bc217a4a066c64c9dd6bc11c61c (tree) |
---|---|
Time | 2020-07-11 16:25:30 |
Author | utzcoz <utzcoz@outl...> |
Commiter | utzcoz |
Use systemui recents as default pc recents
1. Enable grid layout of systemui recents.
2. Disable OverviewProxyService to use systemui recents, instead of
3. Show freeform task in systemui recents.
4. Fix IndexOutArrayException of systemui recents grid layout when
Signed-off-by: utzcoz <utzcoz@outlook.com>
@@ -67,7 +67,10 @@ public class TaskStack { | ||
67 | 67 | |
68 | 68 | public TaskStack() { |
69 | 69 | // Ensure that we only show stack tasks |
70 | - mStackTaskList.setFilter((taskIdMap, t, index) -> t.isStackTask); | |
70 | + // region @boringdroid | |
71 | + // We want the recents to show freeform stack too, so we remove the filter. | |
72 | + // mStackTaskList.setFilter((taskIdMap, t, index) -> t.isStackTask); | |
73 | + // endregion | |
71 | 74 | } |
72 | 75 | |
73 | 76 | /** Sets the callbacks for this task stack. */ |
@@ -383,9 +383,15 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis | ||
383 | 383 | } |
384 | 384 | |
385 | 385 | private void updateEnabledState() { |
386 | + // region @boringdroid | |
387 | + // Before there is an ideal overview implementation, we will disable the | |
388 | + // overview proxy service. | |
389 | + /* | |
386 | 390 | mIsEnabled = mContext.getPackageManager().resolveServiceAsUser(mQuickStepIntent, |
387 | 391 | MATCH_DIRECT_BOOT_UNAWARE, |
388 | 392 | ActivityManagerWrapper.getInstance().getCurrentUserId()) != null; |
393 | + */ | |
394 | + // endregion | |
389 | 395 | } |
390 | 396 | |
391 | 397 | @Override |
@@ -91,7 +91,11 @@ public class RecentsConfiguration { | ||
91 | 91 | Resources res = mAppContext.getResources(); |
92 | 92 | fakeShadows = res.getBoolean(R.bool.config_recents_fake_shadows); |
93 | 93 | svelteLevel = res.getInteger(R.integer.recents_svelte_level); |
94 | - isGridEnabled = SystemProperties.getBoolean("ro.recents.grid", false); | |
94 | + // region @boringdroid | |
95 | + // Enable grid recents default. | |
96 | + // isGridEnabled = SystemProperties.getBoolean("ro.recents.grid", false); | |
97 | + isGridEnabled = SystemProperties.getBoolean("ro.recents.grid", true); | |
98 | + // endregion | |
95 | 99 | isLowRamDevice = ActivityManager.isLowRamDeviceStatic(); |
96 | 100 | dragToSplitEnabled = !isLowRamDevice; |
97 | 101 |
@@ -351,6 +351,17 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal | ||
351 | 351 | |
352 | 352 | // Only notify if we are already initialized, otherwise, everything will pick up all the |
353 | 353 | // new and old tasks when we next layout |
354 | + // region @boringdroid | |
355 | + if (useGridLayout() | |
356 | + && stack.getTaskCount() > TaskGridLayoutAlgorithm.MAX_LAYOUT_TASK_COUNT) { | |
357 | + int toIndex = stack.getTaskCount(); | |
358 | + int fromIndex = toIndex - TaskGridLayoutAlgorithm.MAX_LAYOUT_TASK_COUNT; | |
359 | + stack.setTasks( | |
360 | + stack.getTasks().subList(fromIndex, toIndex), | |
361 | + allowNotifyStackChanges && isInitialized | |
362 | + ); | |
363 | + } | |
364 | + // endregion | |
354 | 365 | mStack.setTasks(stack, allowNotifyStackChanges && isInitialized); |
355 | 366 | } |
356 | 367 |