From 2a421e71468c5a5354e2f31235f05c1941f15e68 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Wed, 21 Dec 2022 13:20:44 +0100 Subject: [PATCH] Run emulation in a separate process for release builds only --- app/build.gradle | 12 ++++++++---- app/src/main/AndroidManifest.xml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fb114408..f996572b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,9 +34,12 @@ android { } if (isBuildSigned) - manifestPlaceholders = [shouldSaveUserData: "true"] + manifestPlaceholders += [shouldSaveUserData: "true"] else - manifestPlaceholders = [shouldSaveUserData: "false"] + manifestPlaceholders += [shouldSaveUserData: "false"] + + // Only enable separate process for release builds + manifestPlaceholders += [emulationProcess: ""] } /* JVM Bytecode Options */ @@ -71,6 +74,7 @@ android { shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig = isBuildSigned ? signingConfigs.ci : signingConfigs.debug + manifestPlaceholders += [emulationProcess: ":emulationProcess"] } reldebug { @@ -97,14 +101,14 @@ android { productFlavors { full { dimension = "version" - manifestPlaceholders = [appLabel: "Skyline"] + manifestPlaceholders += [appLabel: "Skyline"] } dev { dimension = "version" applicationIdSuffix = ".dev" versionNameSuffix = "-dev" - manifestPlaceholders = [appLabel: "Skyline Dev"] + manifestPlaceholders += [appLabel: "Skyline Dev"] } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6f77432f..b6f50918 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -68,7 +68,7 @@ android:configChanges="orientation|screenSize|uiMode" android:exported="true" android:launchMode="singleTask" - android:process=":emulationProcess" + android:process="${emulationProcess}" android:parentActivityName=".MainActivity">