Commit 4be282cb authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

android: Disable app zygote on oneplus devices

Users reporting issues with DFM installs.

Bug: 1064314
Change-Id: I0b113ce1b822ca8281289372f91681e8a0eb77be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212484
Auto-Submit: Bo <boliu@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771157}
parent 02325939
...@@ -17,6 +17,7 @@ import android.os.UserManager; ...@@ -17,6 +17,7 @@ import android.os.UserManager;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.collection.ArraySet; import androidx.collection.ArraySet;
import org.chromium.base.BuildInfo;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.Log; import org.chromium.base.Log;
import org.chromium.base.SysUtils; import org.chromium.base.SysUtils;
...@@ -128,7 +129,14 @@ public abstract class ChildConnectionAllocator { ...@@ -128,7 +129,14 @@ public abstract class ChildConnectionAllocator {
String serviceClassName, boolean bindToCaller, boolean bindAsExternalService, String serviceClassName, boolean bindToCaller, boolean bindAsExternalService,
boolean useStrongBinding) { boolean useStrongBinding) {
checkServiceExists(context, packageName, serviceClassName); checkServiceExists(context, packageName, serviceClassName);
if (Build.VERSION.SDK_INT == 29) {
// OnePlus devices are having trouble with app zygote in combination with dynamic
// feature modules. See crbug.com/1064314 for details.
BuildInfo buildInfo = BuildInfo.getInstance();
boolean disableZygote = Build.VERSION.SDK_INT == 29
&& buildInfo.androidBuildFingerprint.startsWith("OnePlus/");
if (Build.VERSION.SDK_INT == 29 && !disableZygote) {
UserManager userManager = UserManager userManager =
(UserManager) ContextUtils.getApplicationContext().getSystemService( (UserManager) ContextUtils.getApplicationContext().getSystemService(
Context.USER_SERVICE); Context.USER_SERVICE);
...@@ -141,7 +149,8 @@ public abstract class ChildConnectionAllocator { ...@@ -141,7 +149,8 @@ public abstract class ChildConnectionAllocator {
// On low end devices, we do not expect to have many renderers. As a consequence, the fixed // On low end devices, we do not expect to have many renderers. As a consequence, the fixed
// costs of the app zygote are not recovered. See https://crbug.com/1044579 for context and // costs of the app zygote are not recovered. See https://crbug.com/1044579 for context and
// experimental results. // experimental results.
String suffix = SysUtils.isLowEndDevice() ? NON_ZYGOTE_SUFFIX : ZYGOTE_SUFFIX; String suffix =
(SysUtils.isLowEndDevice() || disableZygote) ? NON_ZYGOTE_SUFFIX : ZYGOTE_SUFFIX;
return new VariableSizeAllocatorImpl(launcherHandler, freeSlotCallback, packageName, return new VariableSizeAllocatorImpl(launcherHandler, freeSlotCallback, packageName,
serviceClassName + suffix, bindToCaller, bindAsExternalService, useStrongBinding, serviceClassName + suffix, bindToCaller, bindAsExternalService, useStrongBinding,
MAX_VARIABLE_ALLOCATED); MAX_VARIABLE_ALLOCATED);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment