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

Commit dcdcf650 authored by Eric Rahm's avatar Eric Rahm Committed by Android (Google) Code Review
Browse files

Merge "Prevent BadParcelableException in InCallService"

parents 63015b07 723dac69
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.ServiceInfo;
import android.net.Uri;
import android.os.BadParcelableException;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -2951,11 +2952,14 @@ public final class Call {

        for(String key : bundle.keySet()) {
            if (key != null) {
                final Object value = bundle.get(key);
                final Object newValue = newBundle.get(key);
                if (!newBundle.containsKey(key)) {
                    return false;
                }
                // In case new call extra contains non-framework class objects, return false to
                // force update the call extra
                try {
                    final Object value = bundle.get(key);
                    final Object newValue = newBundle.get(key);
                    if (value instanceof Bundle && newValue instanceof Bundle) {
                        if (!areBundlesEqual((Bundle) value, (Bundle) newValue)) {
                            return false;
@@ -2968,6 +2972,9 @@ public final class Call {
                    } else if (!Objects.equals(value, newValue)) {
                        return false;
                    }
                } catch (BadParcelableException e) {
                    return false;
                }
            }
        }
        return true;