diff options
| author | Mathieu Chartier <mathieuc@google.com> | 2017-06-20 20:06:32 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-06-20 20:06:32 +0000 |
| commit | 490bfbbc27c0fbfc311b88a6499f807e702938be (patch) | |
| tree | c69000baa49582f3a7d679318690043bb632e807 /core/java | |
| parent | bd5d7210621849160bb05902a06a21ed971033e5 (diff) | |
| parent | 956ea5f09de8d6a977ed0b26f3914ed2ffd9d588 (diff) | |
Merge "Disable activity leak detection by default for userdebug" into oc-dev
am: 956ea5f09d
Change-Id: I71d5feb7f558347ddb21dc53e7a7d5b9eda9db6d
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/os/StrictMode.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java index 0611f175e809..2b82c77d5909 100644 --- a/core/java/android/os/StrictMode.java +++ b/core/java/android/os/StrictMode.java @@ -936,6 +936,11 @@ public final class StrictMode { return this; } + Builder disable(int bit) { + mMask &= ~bit; + return this; + } + /** * Construct the VmPolicy instance. * @@ -1214,7 +1219,13 @@ public final class StrictMode { if (IS_USER_BUILD) { setCloseGuardEnabled(false); } else { - VmPolicy.Builder policyBuilder = new VmPolicy.Builder().detectAll().penaltyDropBox(); + VmPolicy.Builder policyBuilder = new VmPolicy.Builder().detectAll(); + if (!IS_ENG_BUILD) { + // Activity leak detection causes too much slowdown for userdebug because of the + // GCs. + policyBuilder = policyBuilder.disable(DETECT_VM_ACTIVITY_LEAKS); + } + policyBuilder = policyBuilder.penaltyDropBox(); if (IS_ENG_BUILD) { policyBuilder.penaltyLog(); } |
