diff options
| author | Hans Boehm <hboehm@google.com> | 2022-04-13 15:12:20 -0700 |
|---|---|---|
| committer | Hans Boehm <hboehm@google.com> | 2022-04-19 12:57:25 -0700 |
| commit | c8e95b9329d40bd0c35e58dd60185c97d940cebe (patch) | |
| tree | 7fdad552914fe94164b24602570eab9f6477efcc /services/java/com/android/server/SystemServer.java | |
| parent | 70c3d353193a95847094c013d825fe06f34f7418 (diff) | |
Don't preload into nonexistent zygote
We tried to access the first entry of Build.SUPPORTED_32_BIT_ABIS
even when there where none, causing an out of bounds array access.
The resulting exception was handled correctly, so this only
speeds things up a little and avoids log spam.
Bug: 228390898
Test: Build and boot master, Treehugger
Change-Id: I5827c6991065dd50d3f6e797930a9e6b7616de6e
Diffstat (limited to 'services/java/com/android/server/SystemServer.java')
| -rw-r--r-- | services/java/com/android/server/SystemServer.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 8e4afe685372..dc729f23c770 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1382,8 +1382,9 @@ public final class SystemServer implements Dumpable { Slog.i(TAG, SECONDARY_ZYGOTE_PRELOAD); TimingsTraceAndSlog traceLog = TimingsTraceAndSlog.newAsyncLog(); traceLog.traceBegin(SECONDARY_ZYGOTE_PRELOAD); - if (!Process.ZYGOTE_PROCESS.preloadDefault(Build.SUPPORTED_32_BIT_ABIS[0])) { - Slog.e(TAG, "Unable to preload default resources"); + String[] abis32 = Build.SUPPORTED_32_BIT_ABIS; + if (abis32.length > 0 && !Process.ZYGOTE_PROCESS.preloadDefault(abis32[0])) { + Slog.e(TAG, "Unable to preload default resources for secondary"); } traceLog.traceEnd(); } catch (Exception ex) { |
