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

Commit 207ea788 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Catch exceptions when creating AIDL nanoapp binary"

parents 01f8f40c 46a8fc71
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -165,7 +165,18 @@ import java.util.List;
        aidlNanoAppBinary.flags = nanoAppBinary.getFlags();
        aidlNanoAppBinary.targetChreApiMajorVersion = nanoAppBinary.getTargetChreApiMajorVersion();
        aidlNanoAppBinary.targetChreApiMinorVersion = nanoAppBinary.getTargetChreApiMinorVersion();
        // This explicit definition is required to avoid erroneous behavior at the binder.
        aidlNanoAppBinary.customBinary = new byte[0];

        // Log exceptions while processing the binary, but continue to pass down the binary
        // since the error checking is deferred to the Context Hub.
        try {
            aidlNanoAppBinary.customBinary = nanoAppBinary.getBinaryNoHeader();
        } catch (IndexOutOfBoundsException e) {
            Log.w(TAG, e.getMessage());
        } catch (NullPointerException e) {
            Log.w(TAG, "NanoApp binary was null");
        }

        return aidlNanoAppBinary;
    }