+ @Override
+ public void removePin() {
+ try {
+ m.setRegistrationLockPin(Optional.absent());
+ } catch (UnauthenticatedResponseException e) {
+ throw new Error.Failure("Remove pin failed with unauthenticated response: " + e.getMessage());
+ } catch (IOException e) {
+ throw new Error.Failure("Remove pin error: " + e.getMessage());
+ }
+ }
+
+ @Override
+ public void setPin(String registrationLockPin) {
+ try {
+ m.setRegistrationLockPin(Optional.of(registrationLockPin));
+ } catch (UnauthenticatedResponseException e) {
+ throw new Error.Failure("Set pin error failed with unauthenticated response: " + e.getMessage());
+ } catch (IOException e) {
+ throw new Error.Failure("Set pin error: " + e.getMessage());
+ }
+ }
+