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

Commit 7cabd1b0 authored by William Loh's avatar William Loh Committed by Android (Google) Code Review
Browse files

Merge "Add error logging for IntentFilter parcel errors" into main

parents 99554533 1b7202f5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3141,6 +3141,14 @@ public class IntentFilter implements Parcelable {
            for (int i = 0; i < N; i++) {
                mUriRelativeFilterGroups.add(new UriRelativeFilterGroup(source));
            }
            if (source.dataAvail() > 0) {
                Log.e(TAG, "Parcel data not fully consumed after completed reading"
                        + " UriRelativeFilterGroup data");
            }
        }
        if (source.dataAvail() > 0) {
            Log.e(TAG, "Parcel data not fully consumed when unparceling intent filter",
                    new Exception());
        }
    }

+8 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ import java.util.Objects;
 */
@FlaggedApi(Flags.FLAG_RELATIVE_REFERENCE_INTENT_FILTERS)
public final class UriRelativeFilterGroup {
    private static final String TAG = "UriRelativeFilterGroup";
    private static final String ALLOW_STR = "allow";
    private static final String URI_RELATIVE_FILTER_GROUP_STR = "uriRelativeFilterGroup";

@@ -233,9 +234,16 @@ public final class UriRelativeFilterGroup {
        final int n = mUriRelativeFilters.size();
        if (n > 0) {
            dest.writeInt(n);
            int i = 0;
            Iterator<UriRelativeFilter> it = mUriRelativeFilters.iterator();
            while (it.hasNext()) {
                it.next().writeToParcel(dest, flags);
                i++;
            }
            if (i != n) {
                Log.e(TAG, "UriRelativeFilters was unexpectedly"
                        + " modified while writing to parcel. Expected "
                        + n + " but found " + i + " filters", new Exception());
            }
        } else {
            dest.writeInt(0);