Skip to content

Commit

Permalink
Merge remote-tracking branch 'aosp/android12L-release' into 12.1-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
suphon-t committed May 8, 2022
2 parents a0f5e6d + 62d30d7 commit 11e1a2f
Show file tree
Hide file tree
Showing 825 changed files with 38,251 additions and 29,197 deletions.
56 changes: 54 additions & 2 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ license {

android_library {
name: "launcher-aosp-tapl",
libs: [
"framework-statsd",
],
static_libs: [
"androidx.annotation_annotation",
"androidx.test.runner",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -191,8 +199,12 @@ android_library {
resource_dirs: [
"quickstep/res",
],
libs: [
"framework-statsd",
],
static_libs: [
"Launcher3ResLib",
"lottie",
"SystemUISharedLib",
"SystemUI-statsd",
],
Expand All @@ -204,16 +216,22 @@ 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
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",
],
}

Expand All @@ -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",
Expand All @@ -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",
},
}
44 changes: 4 additions & 40 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down Expand Up @@ -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)


Expand All @@ -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) \
Expand Down Expand Up @@ -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)


Expand Down
3 changes: 1 addition & 2 deletions AndroidManifest-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
with some minor changed based on the derivative app.
-->

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
Expand Down Expand Up @@ -149,7 +148,7 @@
<activity
android:name="com.android.launcher3.settings.SettingsActivity"
android:label="@string/settings_button_text"
android:theme="@style/HomeSettingsTheme"
android:theme="@style/HomeSettings.Theme"
android:exported="true"
android:autoRemoveFromRecents="true">
<intent-filter android:priority="-1">
Expand Down
3 changes: 2 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ public static boolean isLegacyMode(int mode) {
* 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);
}

/**
Expand Down
24 changes: 0 additions & 24 deletions buglist_with_title.txt

This file was deleted.

2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

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;
Expand All @@ -31,7 +33,10 @@

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;

Expand All @@ -41,9 +46,48 @@
public class DebugTestInformationHandler extends TestInformationHandler {
private static LinkedList sLeaks;
private static Collection<String> sEvents;
private static Application.ActivityLifecycleCallbacks sActivityLifecycleCallbacks;
private static final Map<Activity, Boolean> 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() {
Expand Down Expand Up @@ -80,7 +124,7 @@ protected void finalize() throws Throwable {
}

@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: {
Expand Down Expand Up @@ -160,8 +204,22 @@ public Bundle call(String method) {
}
}

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);
}
}
}
2 changes: 1 addition & 1 deletion go/AndroidManifest-launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
Loading

0 comments on commit 11e1a2f

Please sign in to comment.