From b01064bc7204ada3ec1b8adec3c74d4aada27289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giovanni=20Ortu=C3=B1o?= Date: Tue, 2 Dec 2014 13:48:14 -0800 Subject: [PATCH] App behaves correctly when there are no changes to the beacon --- .../src/main/java/org/uribeacon/config/ProtocolV2.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android-uribeacon/uribeacon-library/src/main/java/org/uribeacon/config/ProtocolV2.java b/android-uribeacon/uribeacon-library/src/main/java/org/uribeacon/config/ProtocolV2.java index aad962d..f2b09f8 100644 --- a/android-uribeacon/uribeacon-library/src/main/java/org/uribeacon/config/ProtocolV2.java +++ b/android-uribeacon/uribeacon-library/src/main/java/org/uribeacon/config/ProtocolV2.java @@ -100,6 +100,10 @@ public void writeUriBeacon(ConfigUriBeacon configUriBeacon) throws URISyntaxExce if (configUriBeacon.getLockState()) { mLastUUID = LOCK; } + // If there are no changes or the only change is that the beacon was unlocked, return. + if (mLastUUID == null) { + mUriBeaconCallback.onUriBeaconWrite(BluetoothGatt.GATT_SUCCESS); + } // Start enqueing writes if (!configUriBeacon.getUriString().equals(mConfigUriBeacon.getUriString())) { mService.writeCharacteristic(DATA, configUriBeacon.getUriBytes());