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

Commit 1b0e8d09 authored by Nate Myren's avatar Nate Myren Committed by Automerger Merge Worker
Browse files

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

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3216581



Change-Id: I81d749e0540901f08e97e138d8fe3d107c5ec86a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d7fb91da 75844136
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++) {