Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-base: Commit

frameworks/base


Commit MetaInfo

Revision7a5d3a11b5715bc217a4a066c64c9dd6bc11c61c (tree)
Zeit2020-07-11 16:25:30
Autorutzcoz <utzcoz@outl...>
Commiterutzcoz

Log Message

Use systemui recents as default pc recents

1. Enable grid layout of systemui recents.
2. Disable OverviewProxyService to use systemui recents, instead of

recents that implements OverviewProxyService such as Launcher3.

3. Show freeform task in systemui recents.
4. Fix IndexOutArrayException of systemui recents grid layout when

starting many freeform tasks.

Signed-off-by: utzcoz <utzcoz@outlook.com>

Ändern Zusammenfassung

Diff

--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/TaskStack.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/TaskStack.java
@@ -67,7 +67,10 @@ public class TaskStack {
6767
6868 public TaskStack() {
6969 // 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
7174 }
7275
7376 /** Sets the callbacks for this task stack. */
--- a/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java
+++ b/packages/SystemUI/src/com/android/systemui/OverviewProxyService.java
@@ -383,9 +383,15 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
383383 }
384384
385385 private void updateEnabledState() {
386+ // region @boringdroid
387+ // Before there is an ideal overview implementation, we will disable the
388+ // overview proxy service.
389+ /*
386390 mIsEnabled = mContext.getPackageManager().resolveServiceAsUser(mQuickStepIntent,
387391 MATCH_DIRECT_BOOT_UNAWARE,
388392 ActivityManagerWrapper.getInstance().getCurrentUserId()) != null;
393+ */
394+ // endregion
389395 }
390396
391397 @Override
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -91,7 +91,11 @@ public class RecentsConfiguration {
9191 Resources res = mAppContext.getResources();
9292 fakeShadows = res.getBoolean(R.bool.config_recents_fake_shadows);
9393 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
9599 isLowRamDevice = ActivityManager.isLowRamDeviceStatic();
96100 dragToSplitEnabled = !isLowRamDevice;
97101
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -351,6 +351,17 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
351351
352352 // Only notify if we are already initialized, otherwise, everything will pick up all the
353353 // 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
354365 mStack.setTasks(stack, allowNotifyStackChanges && isInitialized);
355366 }
356367
Show on old repository browser