diff --git a/Android.bp b/Android.bp index edc3dd934f..ad2f77ee20 100644 --- a/Android.bp +++ b/Android.bp @@ -33,6 +33,9 @@ license { android_library { name: "launcher-aosp-tapl", + libs: [ + "framework-statsd", + ], static_libs: [ "androidx.annotation_annotation", "androidx.test.runner", @@ -112,6 +115,7 @@ android_library { "androidx.preference_preference", "androidx.slice_slice-view", "androidx.cardview_cardview", + "com.google.android.material_material", "iconloader_base", ], manifest: "AndroidManifest-common.xml", @@ -148,9 +152,13 @@ android_app { ], srcs: [ "src/**/*.java", + "src/**/*.kt", "src_shortcuts_overrides/**/*.java", + "src_shortcuts_overrides/**/*.kt", "src_ui_overrides/**/*.java", + "src_ui_overrides/**/*.kt", "ext_tests/src/**/*.java", + "ext_tests/src/**/*.kt", ], resource_dirs: [ "ext_tests/res", @@ -191,8 +199,12 @@ android_library { resource_dirs: [ "quickstep/res", ], + libs: [ + "framework-statsd", + ], static_libs: [ "Launcher3ResLib", + "lottie", "SystemUISharedLib", "SystemUI-statsd", ], @@ -204,7 +216,10 @@ android_library { // Source code used for test helpers filegroup { name: "launcher-src-ext-tests", - srcs: ["ext_tests/src/**/*.java"], + srcs: [ + "ext_tests/src/**/*.java", + "ext_tests/src/**/*.kt", + ], } // Common source files used to build launcher @@ -212,8 +227,11 @@ filegroup { name: "launcher-src-no-build-config", srcs: [ "src/**/*.java", + "src/**/*.kt", "src_shortcuts_overrides/**/*.java", + "src_shortcuts_overrides/**/*.kt", "quickstep/src/**/*.java", + "quickstep/src/**/*.kt", ], } @@ -223,20 +241,27 @@ filegroup { srcs: ["proguard.flags"], } - // Library with all the dependencies for building Launcher Go android_library { name: "LauncherGoResLib", srcs: [ "src/**/*.java", + "src/**/*.kt", "quickstep/src/**/*.java", + "quickstep/src/**/*.kt", "go/src/**/*.java", + "go/src/**/*.kt", "go/quickstep/src/**/*.java", + "go/quickstep/src/**/*.kt", ], resource_dirs: [ "go/res", "go/quickstep/res", ], + // Note the ordering here is important when it comes to resource + // overriding. We want the most specific resource overrides defined + // in QuickstepResLib to take precendece, so it should be the final + // dependency. See b/205278434 for how this can go wrong. static_libs: [ "Launcher3CommonDepsLib", "QuickstepResLib", @@ -252,3 +277,30 @@ android_library { }, } +// Build rule for Quickstep library +android_library { + name: "Launcher3QuickStepLib", + srcs: [ + ":launcher-src-no-build-config", + ], + resource_dirs: [], + libs: [ + "framework-statsd", + ], + // Note the ordering here is important when it comes to resource + // overriding. We want the most specific resource overrides defined + // in QuickstepResLib to take precendece, so it should be the final + // dependency. See b/208647810 for how this can go wrong. + static_libs: [ + "SystemUI-statsd", + "SystemUISharedLib", + "Launcher3CommonDepsLib", + "QuickstepResLib", + ], + manifest: "quickstep/AndroidManifest.xml", + platform_apis: true, + min_sdk_version: "current", + lint: { + baseline_filename: "lint-baseline-launcher3.xml", + }, +} diff --git a/Android.mk b/Android.mk index 6db529f64e..ceaaf138f2 100644 --- a/Android.mk +++ b/Android.mk @@ -49,45 +49,9 @@ LOCAL_MANIFEST_FILE := go/AndroidManifest.xml LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.* LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.txt +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE include $(BUILD_PACKAGE) -# -# Build rule for Quickstep library. -# -include $(CLEAR_VARS) -LOCAL_USE_AAPT2 := true -LOCAL_AAPT2_ONLY := true -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_JAVA_LIBRARIES := \ - SystemUI-statsd \ - SystemUISharedLib -ifneq (,$(wildcard frameworks/base)) - LOCAL_PRIVATE_PLATFORM_APIS := true -else - LOCAL_SDK_VERSION := system_current - LOCAL_MIN_SDK_VERSION := 26 -endif -LOCAL_MODULE := Launcher3QuickStepLib -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.txt -LOCAL_PRIVILEGED_MODULE := true -LOCAL_STATIC_ANDROID_LIBRARIES := Launcher3CommonDepsLib - -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) \ - $(call all-java-files-under, quickstep/src) \ - $(call all-java-files-under, src_shortcuts_overrides) - -LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/quickstep/res -LOCAL_PROGUARD_ENABLED := disabled - - -LOCAL_MANIFEST_FILE := quickstep/AndroidManifest.xml -include $(BUILD_STATIC_JAVA_LIBRARY) - # # Build rule for Quickstep app. # @@ -121,7 +85,7 @@ LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.* LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.txt +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE include $(BUILD_PACKAGE) @@ -141,7 +105,7 @@ else LOCAL_SDK_VERSION := system_current LOCAL_MIN_SDK_VERSION := 26 endif -LOCAL_STATIC_ANDROID_LIBRARIES := Launcher3CommonDepsLib +LOCAL_STATIC_ANDROID_LIBRARIES := LauncherGoResLib LOCAL_SRC_FILES := \ $(call all-java-files-under, src) \ @@ -172,7 +136,7 @@ LOCAL_MANIFEST_FILE := quickstep/AndroidManifest.xml LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.* LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 LOCAL_LICENSE_CONDITIONS := notice -LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE.txt +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE include $(BUILD_PACKAGE) diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml index 728c7e25ac..cb141df421 100644 --- a/AndroidManifest-common.xml +++ b/AndroidManifest-common.xml @@ -33,7 +33,6 @@ with some minor changed based on the derivative app. --> - @@ -149,7 +148,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c1666c022c..d34430c428 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -34,6 +34,7 @@ android:fullBackupOnly="true" android:fullBackupContent="@xml/backupscheme" android:hardwareAccelerated="true" + android:debuggable="true" android:icon="@drawable/ic_launcher_home" android:label="@string/derived_app_name" android:theme="@style/AppTheme" @@ -52,7 +53,7 @@ android:stateNotNeeded="true" android:windowSoftInputMode="adjustPan" android:screenOrientation="unspecified" - android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize|density" + android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize" android:resizeableActivity="true" android:resumeWhilePausing="true" android:taskAffinity="" diff --git a/SystemUIShared/src/com/android/systemui/shared/system/QuickStepContract.java b/SystemUIShared/src/com/android/systemui/shared/system/QuickStepContract.java index 5754a67776..87e6fe60a1 100644 --- a/SystemUIShared/src/com/android/systemui/shared/system/QuickStepContract.java +++ b/SystemUIShared/src/com/android/systemui/shared/system/QuickStepContract.java @@ -297,14 +297,14 @@ public class QuickStepContract { * These values are expressed in pixels because they should not respect display or font * scaling, this means that we don't have to reload them on config changes. */ - public static float getWindowCornerRadius(Resources resources) { + public static float getWindowCornerRadius(Context context) { if (sRecentsDisabled) { return 0; } if (sHasCustomCornerRadius) { return sCustomCornerRadius; } - return ScreenDecorationsUtils.getWindowCornerRadius(resources); + return ScreenDecorationsUtils.getWindowCornerRadius(context); } /** diff --git a/buglist_with_title.txt b/buglist_with_title.txt deleted file mode 100644 index aa8b413284..0000000000 --- a/buglist_with_title.txt +++ /dev/null @@ -1,24 +0,0 @@ -144170434 twickham P1 FIXED Improve Overview -> Home transition ---- -149934536 twickham P2 FIXED Update gesture nav pullback logic ---- -154951045 peanutbutter P1 FIXED Odd animation occuring at times when swiping to home ---- -154964045 awickham P2 FIXED "Clear all" text is not in the middle of app's window vertically ---- -158701272 twickham P4 FIXED Discontinuities when long-swiping to home ---- -160361464 tracyzhou P2 FIXED Place launcher above the target app in live tile mode ---- -160568387 twickham P2 FIXED Can't get to app switcher by swiping up (motion pause not detected) ---- -160718310 xuqiu P1 FIXED With "Select" overview action selected, App icon is missing in other overview apps after orientation change ---- -160748731 sunnygoyal P2 ASSIGNED Unify prediction model with Launcher model ---- -160759508 twickham P2 FIXED Swipe up cannot back to home screen in overview. ---- -161273376 xuqiu P2 FIXED [Overview Actions] Add logging and helpful messages ---- -161536946 twickham P2 FIXED Haptics don't indicate snap-to in overview, ---- -161685099 winsonc P2 FIXED Screen still stay at the quick settings/notification when I swipe up with 3 finger to check the all apps. ---- -161801331 hyunyoungs P2 FIXED Change AllAppsSearch plugin to support only data fetch ---- -161901771 xuqiu P1 FIXED Overlapping layer of highlights with app layout getting darker when keep rotating the device from "Feedback" viewpoint in split screen ---- -161939759 sunnygoyal P2 FIXED RD1A: Going to overview in landscape mode clips the screen content ---- -162012217 perumaal P2 ASSIGNED Leaked Activity Caused by Gleams ---- -162454040 bookatz P2 ASSIGNED Create multiuser test that checks that opening an app works properly ---- -162480567 sfufa P4 FIXED Enable Item Decorations for search items ---- -162564471 tracyzhou P2 FIXED [Live tile] Handle tapping overview actions in live tile mode ---- -162623012 zakcohen P1 ASSIGNED Enable chips flag ---- -162812884 winsonc P2 ASSIGNED [R]The color have not changed in some page after turning on the dark theme. ---- -162861289 hyunyoungs P2 FIXED Add FocusIndicator support to DEVICE_SEARCH feature in S ---- -162871508 sfufa P2 ASSIGNED Introduce support for Hero app section ---- diff --git a/build.gradle b/build.gradle index 4878f4cc3f..22cb59b426 100644 --- a/build.gradle +++ b/build.gradle @@ -348,6 +348,8 @@ dependencies { implementation 'com.google.protobuf:protobuf-javalite:3.8.0' implementation 'com.github.LawnchairLauncher:oss-notices:1.0.2' + + api 'com.airbnb.android:lottie:3.3.0' } protobuf { diff --git a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java index 72b8d3fcae..0f61d149d0 100644 --- a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java +++ b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java @@ -18,6 +18,8 @@ package com.android.launcher3.testing; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; +import android.app.Activity; +import android.app.Application; import android.content.Context; import android.os.Binder; import android.os.Bundle; @@ -31,7 +33,10 @@ import com.android.launcher3.LauncherSettings; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.LinkedList; +import java.util.Map; +import java.util.WeakHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -41,9 +46,48 @@ import java.util.concurrent.TimeUnit; public class DebugTestInformationHandler extends TestInformationHandler { private static LinkedList sLeaks; private static Collection sEvents; + private static Application.ActivityLifecycleCallbacks sActivityLifecycleCallbacks; + private static final Map sActivities = + Collections.synchronizedMap(new WeakHashMap<>()); + private static int sActivitiesCreatedCount = 0; public DebugTestInformationHandler(Context context) { init(context); + if (sActivityLifecycleCallbacks == null) { + sActivityLifecycleCallbacks = new Application.ActivityLifecycleCallbacks() { + @Override + public void onActivityCreated(Activity activity, Bundle bundle) { + sActivities.put(activity, true); + ++sActivitiesCreatedCount; + } + + @Override + public void onActivityStarted(Activity activity) { + } + + @Override + public void onActivityResumed(Activity activity) { + } + + @Override + public void onActivityPaused(Activity activity) { + } + + @Override + public void onActivityStopped(Activity activity) { + } + + @Override + public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { + } + + @Override + public void onActivityDestroyed(Activity activity) { + } + }; + ((Application) context.getApplicationContext()) + .registerActivityLifecycleCallbacks(sActivityLifecycleCallbacks); + } } private static void runGcAndFinalizersSync() { @@ -80,7 +124,7 @@ public class DebugTestInformationHandler extends TestInformationHandler { } @Override - public Bundle call(String method) { + public Bundle call(String method, String arg) { final Bundle response = new Bundle(); switch (method) { case TestProtocol.REQUEST_APP_LIST_FREEZE_FLAGS: { @@ -160,8 +204,22 @@ public class DebugTestInformationHandler extends TestInformationHandler { } } + case TestProtocol.REQUEST_GET_ACTIVITIES_CREATED_COUNT: { + response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, sActivitiesCreatedCount); + return response; + } + + case TestProtocol.REQUEST_GET_ACTIVITIES: { + response.putStringArray(TestProtocol.TEST_INFO_RESPONSE_FIELD, + sActivities.keySet().stream().map( + a -> a.getClass().getSimpleName() + " (" + + (a.isDestroyed() ? "destroyed" : "current") + ")") + .toArray(String[]::new)); + return response; + } + default: - return super.call(method); + return super.call(method, arg); } } } diff --git a/go/AndroidManifest-launcher.xml b/go/AndroidManifest-launcher.xml index 6a8f715bb2..2223036a7a 100644 --- a/go/AndroidManifest-launcher.xml +++ b/go/AndroidManifest-launcher.xml @@ -49,7 +49,7 @@ android:stateNotNeeded="true" android:windowSoftInputMode="adjustPan" android:screenOrientation="unspecified" - android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize|density|uiMode" + android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" android:resizeableActivity="true" android:resumeWhilePausing="true" android:taskAffinity="" diff --git a/go/quickstep/res/layout/overview_actions_container.xml b/go/quickstep/res/layout/overview_actions_container.xml index 0e718ca08d..196541f0a9 100644 --- a/go/quickstep/res/layout/overview_actions_container.xml +++ b/go/quickstep/res/layout/overview_actions_container.xml @@ -14,12 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. --> - + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal|bottom">