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

Commit d2a38e87 authored by Dennis Shen's avatar Dennis Shen
Browse files

Fix settings to properties mapper

The existing try catch only guards against IOException, while
Nullpointerexception is not guarded. Explicitly handle the null
exception in the code. The return of sendAconfigdRequests can be null
when the aconfigd socket is not on.

Bug: b/406270206
Test: build aosp next food build, and send a local override
Flag: EXEMPT flag infra
Change-Id: If56565822e304fc789d073cdafae2d2bd48873b2
parent 7cb3bdab
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -232,13 +232,17 @@ public class SettingsToPropertiesMapper {
     */
    static void sendAconfigdRequests(ProtoOutputStream requests) {
        ProtoInputStream returns = sendAconfigdRequests("aconfigd_system", requests);
        if (returns != null) {
            try {
                parseAndLogAconfigdReturn(returns);
            } catch (IOException ioe) {
                logErr("failed to parse aconfigd return", ioe);
            }
        }

        if (enableAconfigdFromMainline()) {
            returns = sendAconfigdRequests("aconfigd_mainline", requests);
            if (returns != null) {
                try {
                    parseAndLogAconfigdReturn(returns);
                } catch (IOException ioe) {
@@ -246,6 +250,7 @@ public class SettingsToPropertiesMapper {
                }
            }
        }
    }

    /**
     * apply flag local override in aconfig new storage