Added large heap build variant

pull/212/head
M66B 2 years ago
parent 698af0b31e
commit 6449273f0d

@ -55,6 +55,9 @@ android {
github {
java.srcDirs = ['src/main/java', 'src/play/java', 'src/extra/java']
}
large {
java.srcDirs = ['src/main/java', 'src/play/java', 'src/extra/java']
}
fdroid {
java.srcDirs = ['src/main/java', 'src/fdroid/java', 'src/extra/java']
}
@ -158,6 +161,30 @@ android {
productFlavors {
github {
dimension "all"
manifestPlaceholders.largeHeap = false
buildConfigField "boolean", "TEST_RELEASE", "false"
buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "boolean", "FDROID_RELEASE", "false"
buildConfigField "boolean", "AMAZON_RELEASE", "false"
buildConfigField "String", "PRO_FEATURES_URI", "\"https://email.faircode.eu/donate/\""
buildConfigField "String", "CHANGELOG", "\"https://github.com/M66B/FairEmail/releases/\""
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/FairEmail/releases/latest\""
buildConfigField "String", "GITHUB_LATEST_URI", "\"https://github.com/M66B/FairEmail/releases\""
buildConfigField "String", "BITBUCKET_DOWNLOADS_API", "\"https://api.bitbucket.org/2.0/repositories/M66B/fairemail-test/downloads\""
buildConfigField "String", "BITBUCKET_DOWNLOADS_URI", "\"https://bitbucket.org/M66B/fairemail-test/downloads/\""
buildConfigField "String", "ANNOUNCEMENT_URI", "\"https://gist.githubusercontent.com/M66B/d544192ca56224839d6ba0f2f6314c1f/raw/\""
buildConfigField "String", "CLOUD_URI", "\"https://api.fairemail.net/sync\""
buildConfigField "String", "CLOUD_EMAIL", "\"cloud@in.faircode.eu\""
buildConfigField "String", "TX_URI", localProperties.getProperty("paypal.uri", "\"\"")
buildConfigField "String", "GPA_URI", localProperties.getProperty("gpa.uri", "\"\"")
buildConfigField "String", "INFO_URI", localProperties.getProperty("info.uri", "\"\"")
buildConfigField "String", "DEV_DOMAIN", localProperties.getProperty("dev.domain", "\"\"")
buildConfigField "String", "FDROID", "\"https://f-droid.org/packages/%s/\""
}
large {
dimension "all"
manifestPlaceholders.largeHeap = true
buildConfigField "boolean", "TEST_RELEASE", "false"
buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
@ -180,6 +207,7 @@ android {
}
fdroid {
dimension "all"
manifestPlaceholders.largeHeap = false
buildConfigField "boolean", "TEST_RELEASE", "false"
buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
@ -203,6 +231,7 @@ android {
play {
dimension "all"
//minSdkVersion 23
manifestPlaceholders.largeHeap = false
buildConfigField "boolean", "TEST_RELEASE", "false"
buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "true"
@ -226,6 +255,7 @@ android {
amazon {
dimension "all"
minSdkVersion 23
manifestPlaceholders.largeHeap = false
buildConfigField "boolean", "TEST_RELEASE", "false"
buildConfigField "boolean", "BETA_RELEASE", "true"
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
@ -251,7 +281,7 @@ android {
variantFilter { variant ->
def flavors = variant.flavors*.name
// Builds: release, debug
// Flavors: github, fdroid, play
// Flavors: github, large, fdroid, play
if (variant.buildType.name == "debug" &&
(flavors.contains("fdroid") || flavors.contains("play") || flavors.contains("_amazon"))) {
setIgnore(true)
@ -523,6 +553,7 @@ dependencies {
// https://developer.android.com/google/play/billing/billing_library_releases_notes
// https://android-developers.googleblog.com/2020/06/meet-google-play-billing-library.html
githubImplementation "com.android.billingclient:billing:$billingclient_version"
largeImplementation "com.android.billingclient:billing:$billingclient_version"
playImplementation "com.android.billingclient:billing:$billingclient_version"
// https://developer.amazon.com/docs/in-app-purchasing/iap-get-started.html

@ -111,6 +111,7 @@
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="${largeHeap}"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="true"

@ -118,6 +118,7 @@
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="${largeHeap}"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="true"

@ -118,6 +118,7 @@
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="${largeHeap}"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="true"

@ -111,6 +111,7 @@
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="${largeHeap}"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="true"

@ -2068,11 +2068,21 @@ public class Log {
Helper.formatDuration(running), Helper.formatDuration(cpu), util));
}
Boolean largeHeap;
try {
ApplicationInfo info = pm.getApplicationInfo(context.getPackageName(), 0);
largeHeap = (info.flags & ApplicationInfo.FLAG_LARGE_HEAP) != 0;
} catch (Throwable ex) {
largeHeap = null;
}
ActivityManager am = Helper.getSystemService(context, ActivityManager.class);
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
am.getMemoryInfo(mi);
sb.append(String.format("Memory class: %d/%d MB Total: %s\r\n",
am.getMemoryClass(), am.getLargeMemoryClass(), Helper.humanReadableByteCount(mi.totalMem)));
sb.append(String.format("Memory class: %d/%d Large: %s MB Total: %s\r\n",
am.getMemoryClass(), am.getLargeMemoryClass(),
largeHeap == null ? "?" : Boolean.toString(largeHeap),
Helper.humanReadableByteCount(mi.totalMem)));
long storage_available = Helper.getAvailableStorageSpace();
long storage_total = Helper.getTotalStorageSpace();

@ -111,6 +111,7 @@
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="${largeHeap}"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="true"

Loading…
Cancel
Save