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

Commit 0c1c1eb1 authored by Martijn Coenen's avatar Martijn Coenen Committed by Android (Google) Code Review
Browse files

Merge "Allow formatting a tag as NDEF without a message."

parents b956ef3a 2976da03
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -137,7 +137,12 @@ public final class NdefFormatable extends BasicTagTechnology {
                    throw new IOException();
                    throw new IOException();
            }
            }
            // Now check and see if the format worked
            // Now check and see if the format worked
            if (tagService.isNdef(serviceHandle)) {
            if (!tagService.isNdef(serviceHandle)) {
                throw new IOException();
            }

            // Write a message, if one was provided
            if (firstMessage != null) {
                errorCode = tagService.ndefWrite(serviceHandle, firstMessage);
                errorCode = tagService.ndefWrite(serviceHandle, firstMessage);
                switch (errorCode) {
                switch (errorCode) {
                    case ErrorCodes.SUCCESS:
                    case ErrorCodes.SUCCESS:
@@ -150,9 +155,8 @@ public final class NdefFormatable extends BasicTagTechnology {
                        // Should not happen
                        // Should not happen
                        throw new IOException();
                        throw new IOException();
                }
                }
            } else {
                throw new IOException();
            }
            }

            // optionally make read-only
            // optionally make read-only
            if (makeReadOnly) {
            if (makeReadOnly) {
                errorCode = tagService.ndefMakeReadOnly(serviceHandle);
                errorCode = tagService.ndefMakeReadOnly(serviceHandle);