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

Commit 01d159aa authored by Martijn Coenen's avatar Martijn Coenen Committed by Nick Pelly
Browse files

Need to check ndef before writing ndef.

Regression due to all the (re)connect changes.

Change-Id: I637618f63518965e893a5a59db61002271666fa4
parent 4ea442b4
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -148,7 +148,9 @@ public final class Ndef extends BasicTagTechnology {
        checkConnected();

        try {
            int errorCode = mTagService.ndefWrite(mTag.getServiceHandle(), msg);
            int serviceHandle = mTag.getServiceHandle();
            if (mTagService.isNdef(serviceHandle)) {
                int errorCode = mTagService.ndefWrite(serviceHandle, msg);
                switch (errorCode) {
                    case ErrorCodes.SUCCESS:
                        break;
@@ -160,6 +162,10 @@ public final class Ndef extends BasicTagTechnology {
                        // Should not happen
                        throw new IOException();
                }
            }
            else {
                throw new IOException("Tag is not ndef");
            }
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
        }