Catch BadParcelableException in RemoteConnection when setting extras.
Unlike the code in Telecom which can use Bundle.setDefusable(..), this framework code is used within a Connection Manager's code space, so the setDefusable method does not work. To prevent crashing the Connection Manager's app, catching the exception and ignoring extras in this case (not much else we can do). I've also filed a bug against the offending component known for putting bad parcelables into the extras. Test: Modified code to force this scenario. Bug: 64499462 Change-Id: If44ad2e2c8e285d513969c6babe5a798242da53d
This commit is contained in:
@@ -25,6 +25,7 @@ import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
import android.net.Uri;
|
||||
import android.os.BadParcelableException;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
@@ -1464,7 +1465,11 @@ public final class RemoteConnection {
|
||||
if (mExtras == null) {
|
||||
mExtras = new Bundle();
|
||||
}
|
||||
mExtras.putAll(extras);
|
||||
try {
|
||||
mExtras.putAll(extras);
|
||||
} catch (BadParcelableException bpe) {
|
||||
Log.w(this, "putExtras: could not unmarshal extras; exception = " + bpe);
|
||||
}
|
||||
|
||||
notifyExtrasChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user