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

Commit a17d20fa authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Fix Unsafe Parcel Usage

This is a manual fix.
Please review with caution.

Bug: 439097174
Test: build only
Flag: EXEMPT refactor
Change-Id: I597dc777d0598e16235c298008a18aabda1148d6
parent f1da1ff0
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -162,12 +162,7 @@ public final class ParcelableHolder implements Parcelable {


        mParcel.setDataPosition(0);
        mParcel.setDataPosition(0);


        T parcelable = mParcel.readParcelable(clazz.getClassLoader());
        T parcelable = mParcel.readParcelable(clazz.getClassLoader(), clazz);
        if (parcelable != null && !clazz.isInstance(parcelable)) {
            throw new BadParcelableException(
                    "The ParcelableHolder has " + parcelable.getClass().getName()
                    + ", but the requested type is " + clazz.getName());
        }
        mParcelable = parcelable;
        mParcelable = parcelable;


        mParcel.recycle();
        mParcel.recycle();
+1 −1
Original line number Original line Diff line number Diff line
@@ -398,7 +398,7 @@ public class PerformanceCollector {
        iteration.putString(METRIC_KEY_LABEL, label);
        iteration.putString(METRIC_KEY_LABEL, label);
        iteration.putLong(METRIC_KEY_EXECUTION_TIME, mExecTime);
        iteration.putLong(METRIC_KEY_EXECUTION_TIME, mExecTime);
        iteration.putLong(METRIC_KEY_CPU_TIME, mCpuTime);
        iteration.putLong(METRIC_KEY_CPU_TIME, mCpuTime);
        mPerfMeasurement.getParcelableArrayList(METRIC_KEY_ITERATIONS).add(iteration);
        mPerfMeasurement.getParcelableArrayList(METRIC_KEY_ITERATIONS, Bundle.class).add(iteration);


        mExecTime = SystemClock.uptimeMillis();
        mExecTime = SystemClock.uptimeMillis();
        mCpuTime = Process.getElapsedCpuTime();
        mCpuTime = Process.getElapsedCpuTime();