Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8e95b93 authored by Hans Boehm's avatar Hans Boehm
Browse files

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
parent 70c3d353
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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) {