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

Commit 9582b99f 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: Ief77abd46e1108e808718f6d87fc8175aa478f39
parent 5b13bd1e
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.util.Log;

@@ -215,14 +214,14 @@ final class ProvisioningIntentHelper {
     * Returns the first {@link NdefRecord} found with a recognized MIME-type
     */
    private static NdefRecord getFirstNdefRecord(Intent nfcIntent) {
        Parcelable[] ndefMessages = nfcIntent.getParcelableArrayExtra(EXTRA_NDEF_MESSAGES);
        NdefMessage[] ndefMessages = nfcIntent.getParcelableArrayExtra(EXTRA_NDEF_MESSAGES,
                NdefMessage.class);
        if (ndefMessages == null) {
            Log.i(TAG, "No EXTRA_NDEF_MESSAGES from nfcIntent");
            return null;
        }

        for (Parcelable rawMsg : ndefMessages) {
            NdefMessage msg = (NdefMessage) rawMsg;
        for (NdefMessage msg : ndefMessages) {
            for (NdefRecord record : msg.getRecords()) {
                String mimeType = new String(record.getType(), UTF_8);