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

Commit 07e6f616 authored by Martijn Coenen's avatar Martijn Coenen Committed by Nick Pelly
Browse files

Check NDEF before calling makeReadOnly().

Change-Id: Iadbaf5c29821eff78ad487b248af529febcdc4ce
parent a701cf85
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ public final class Ndef extends BasicTagTechnology {
        checkConnected();

        try {
            if (mTagService.isNdef(mTag.getServiceHandle())) {
                int errorCode = mTagService.ndefMakeReadOnly(mTag.getServiceHandle());
                switch (errorCode) {
                    case ErrorCodes.SUCCESS:
@@ -233,6 +234,10 @@ public final class Ndef extends BasicTagTechnology {
                        // Should not happen
                        throw new IOException();
                }
           }
           else {
               throw new IOException("Tag is not ndef");
           }
        } catch (RemoteException e) {
            Log.e(TAG, "NFC service dead", e);
            return false;