Moving SysUI with legacy Recents to another build target

- Move all legacy recents code out of the core sysui code
- Add separate target for products which still depend on it
- Move overview proxy implementation into another implementation of the
  recents interface

Test: atest SystemUITests
Test: Push SystemUiWithLegacyRecents to the system image
      adb shell pm disable com.google.android.apps.nexuslauncher/com.android.quickstep.TouchInteractionService
      and ensure that the old recents implementation still works (and split
      screen)

Change-Id: Iad67218ec37c13c79b6393d87f6bdc4f3996e2c6
Signed-off-by: Winson Chung <winsonc@google.com>
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index 9c33116..b770d5c 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -156,3 +156,43 @@
     ],
 
 }
+
+// Only used for products that are shipping legacy Recents
+android_app {
+    name: "SystemUIWithLegacyRecents",
+    overrides: [
+        "SystemUI",
+    ],
+
+    platform_apis: true,
+    certificate: "platform",
+    privileged: true,
+
+    dxflags: ["--multi-dex"],
+    aaptflags: [
+        "--extra-packages",
+        "com.android.keyguard",
+    ],
+    optimize: {
+        proguard_flags_files: ["proguard.flags", "legacy/recents/proguard.flags"],
+    },
+
+    static_libs: [
+        "SystemUI-core",
+    ],
+    libs: [
+        "telephony-common",
+        "android.car",
+        "android.car.user",
+    ],
+
+    srcs: [
+        "legacy/recents/src/**/*.java",
+        "legacy/recents/src/**/I*.aidl",
+    ],
+    resource_dirs: [
+        "legacy/recents/res",
+    ],
+
+    manifest: "legacy/recents/AndroidManifest.xml",
+}