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

Commit 75844136 authored by Nate Myren's avatar Nate Myren Committed by Gerrit Code Review
Browse files

Merge "[Binder][XIAOMI][Bugfix] Skip appops header in native parcel. [1/2]" into main

parents cf920879 36ed35e3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -10193,6 +10193,9 @@ public class AppOpsManager {
        }

        p.writeInt(Parcel.EX_HAS_NOTED_APPOPS_REPLY_HEADER);
        final int sizePosition = p.dataPosition();
        // Write size placeholder. With this size we can easily skip it in native.
        p.writeInt(0);

        int numAttributionWithNotesAppOps = notedAppOps.size();
        p.writeInt(numAttributionWithNotesAppOps);
@@ -10209,6 +10212,12 @@ public class AppOpsManager {
                }
            }
        }

        final int payloadPosition = p.dataPosition();
        p.setDataPosition(sizePosition);
        // Total header size including 4 bytes size itself.
        p.writeInt(payloadPosition - sizePosition);
        p.setDataPosition(payloadPosition);
    }

    /**
@@ -10222,6 +10231,8 @@ public class AppOpsManager {
     * @hide
     */
    public static void readAndLogNotedAppops(@NonNull Parcel p) {
        // Skip size.
        p.readInt();
        int numAttributionsWithNotedAppOps = p.readInt();

        for (int i = 0; i < numAttributionsWithNotedAppOps; i++) {