Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into buildWithGradle
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslashslash committed Mar 10, 2022
2 parents fecc8c5 + 3a9bb04 commit 5de7601
Show file tree
Hide file tree
Showing 874 changed files with 35,140 additions and 30,485 deletions.
55 changes: 53 additions & 2 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ min_launcher3_sdk_version = "26"

android_library {
name: "launcher-aosp-tapl",
libs: [
"framework-statsd",
],
static_libs: [
"androidx.annotation_annotation",
"androidx.test.runner",
Expand Down Expand Up @@ -137,9 +140,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 @@ -180,8 +187,12 @@ android_library {
resource_dirs: [
"quickstep/res",
],
libs: [
"framework-statsd",
],
static_libs: [
"Launcher3ResLib",
"lottie",
"SystemUISharedLib",
"SystemUI-statsd",
],
Expand All @@ -193,16 +204,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 @@ -212,20 +229,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 @@ -241,3 +265,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",
},
}
39 changes: 1 addition & 38 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,43 +53,6 @@ LOCAL_LICENSE_PACKAGE_NAME := Android Launcher3
LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE
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_LICENSE_PACKAGE_NAME := Android Launcher3
LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE
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 @@ -144,7 +107,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
1 change: 0 additions & 1 deletion AndroidManifest-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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
3 changes: 2 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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 @@ -49,7 +50,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
24 changes: 0 additions & 24 deletions buglist_with_title.txt

This file was deleted.

3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath GRADLE_CLASS_PATH
Expand Down Expand Up @@ -171,6 +170,8 @@ dependencies {
implementation "com.google.protobuf:protobuf-lite:3.0.1"
implementation "androidx.slice:slice-core:1.0.0"
implementation project(':plugin_core')

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
18 changes: 12 additions & 6 deletions go/quickstep/res/layout/overview_actions_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- NOTE! don't add dimensions for margins / gravity to root view in this file, they need to be
loaded at runtime. -->
<com.android.quickstep.views.GoOverviewActionsView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom">

<LinearLayout
android:id="@+id/action_buttons"
Expand Down Expand Up @@ -106,14 +105,21 @@

<!-- Unused. Included only for compatibility with parent class. -->
<Button
android:id="@+id/action_share"
android:id="@+id/action_split"
style="@style/GoOverviewActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_share"
android:text="@string/action_share"
android:drawableStart="@drawable/ic_split_screen"
android:text="@string/action_split"
android:theme="@style/ThemeControlHighlightWorkspaceColor"
android:visibility="gone" />

<Space
android:id="@+id/action_split_space"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"
android:visibility="gone" />
</LinearLayout>

</com.android.quickstep.views.GoOverviewActionsView>
Loading

0 comments on commit 5de7601

Please sign in to comment.