Removing the deprecated close() on DataEventBuffer
Change-Id: Idcda9ab1e24532de552ee597297177dd600f3240
diff --git a/wearable/wear/AgendaData/Wearable/src/main/java/com/example/android/wearable/agendadata/HomeListenerService.java b/wearable/wear/AgendaData/Wearable/src/main/java/com/example/android/wearable/agendadata/HomeListenerService.java
index ef47977..0cbda71 100644
--- a/wearable/wear/AgendaData/Wearable/src/main/java/com/example/android/wearable/agendadata/HomeListenerService.java
+++ b/wearable/wear/AgendaData/Wearable/src/main/java/com/example/android/wearable/agendadata/HomeListenerService.java
@@ -75,7 +75,6 @@
UpdateNotificationForDataItem(event.getDataItem());
}
}
- dataEvents.close();
}
@Override
diff --git a/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java b/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
index e6e4aa2..2a4a353 100644
--- a/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
+++ b/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
@@ -217,7 +217,6 @@
public void onDataChanged(DataEventBuffer dataEvents) {
LOGD(TAG, "onDataChanged: " + dataEvents);
final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents);
- dataEvents.close();
runOnUiThread(new Runnable() {
@Override
public void run() {
diff --git a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerListenerService.java b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerListenerService.java
index 34d3ca3..18e7127 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerListenerService.java
+++ b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerListenerService.java
@@ -60,7 +60,6 @@
public void onDataChanged(DataEventBuffer dataEvents) {
LOGD(TAG, "onDataChanged: " + dataEvents);
final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents);
- dataEvents.close();
if (!mGoogleApiClient.isConnected() || !mGoogleApiClient.isConnecting()) {
ConnectionResult connectionResult = mGoogleApiClient
.blockingConnect(30, TimeUnit.SECONDS);
diff --git a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
index 7d2a28c..e8c86ef 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
+++ b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
@@ -152,7 +152,6 @@
LOGD(TAG, "onDataChanged(): " + dataEvents);
final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents);
- dataEvents.close();
for (DataEvent event : events) {
if (event.getType() == DataEvent.TYPE_CHANGED) {
String path = event.getDataItem().getUri().getPath();
diff --git a/wearable/wear/FindMyPhone/Application/src/main/java/com/example/android/wearable/findphone/SoundAlarmListenerService.java b/wearable/wear/FindMyPhone/Application/src/main/java/com/example/android/wearable/findphone/SoundAlarmListenerService.java
index c89db9d..3de7501 100644
--- a/wearable/wear/FindMyPhone/Application/src/main/java/com/example/android/wearable/findphone/SoundAlarmListenerService.java
+++ b/wearable/wear/FindMyPhone/Application/src/main/java/com/example/android/wearable/findphone/SoundAlarmListenerService.java
@@ -95,7 +95,6 @@
}
}
}
- dataEvents.close();
}
}
diff --git a/wearable/wear/Geofencing/Wearable/src/main/java/com/example/android/wearable/geofencing/HomeListenerService.java b/wearable/wear/Geofencing/Wearable/src/main/java/com/example/android/wearable/geofencing/HomeListenerService.java
index 415fc46..251360c 100644
--- a/wearable/wear/Geofencing/Wearable/src/main/java/com/example/android/wearable/geofencing/HomeListenerService.java
+++ b/wearable/wear/Geofencing/Wearable/src/main/java/com/example/android/wearable/geofencing/HomeListenerService.java
@@ -79,7 +79,6 @@
postNotificationForGeofenceId(geofenceId, event.getDataItem().getUri());
}
}
- dataEvents.close();
}
/**
diff --git a/wearable/wear/Quiz/Application/src/main/java/com/example/android/wearable/quiz/MainActivity.java b/wearable/wear/Quiz/Application/src/main/java/com/example/android/wearable/quiz/MainActivity.java
index 855fcd6..171b8b4 100644
--- a/wearable/wear/Quiz/Application/src/main/java/com/example/android/wearable/quiz/MainActivity.java
+++ b/wearable/wear/Quiz/Application/src/main/java/com/example/android/wearable/quiz/MainActivity.java
@@ -326,7 +326,6 @@
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents);
- dataEvents.close();
runOnUiThread(new Runnable() {
@Override
public void run() {
diff --git a/wearable/wear/Quiz/Wearable/src/main/java/com/example/android/wearable/quiz/QuizListenerService.java b/wearable/wear/Quiz/Wearable/src/main/java/com/example/android/wearable/quiz/QuizListenerService.java
index 95bedf0..327c4b8 100644
--- a/wearable/wear/Quiz/Wearable/src/main/java/com/example/android/wearable/quiz/QuizListenerService.java
+++ b/wearable/wear/Quiz/Wearable/src/main/java/com/example/android/wearable/quiz/QuizListenerService.java
@@ -81,7 +81,6 @@
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents);
- dataEvents.close();
GoogleApiClient googleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/DigitalWatchFaceService.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/DigitalWatchFaceService.java
index 0bc420d..578763c 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/DigitalWatchFaceService.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/DigitalWatchFaceService.java
@@ -522,27 +522,23 @@
@Override // DataApi.DataListener
public void onDataChanged(DataEventBuffer dataEvents) {
- try {
- for (DataEvent dataEvent : dataEvents) {
- if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
- continue;
- }
-
- DataItem dataItem = dataEvent.getDataItem();
- if (!dataItem.getUri().getPath().equals(
- DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
- continue;
- }
-
- DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
- DataMap config = dataMapItem.getDataMap();
- if (Log.isLoggable(TAG, Log.DEBUG)) {
- Log.d(TAG, "Config DataItem updated:" + config);
- }
- updateUiForConfigDataMap(config);
+ for (DataEvent dataEvent : dataEvents) {
+ if (dataEvent.getType() != DataEvent.TYPE_CHANGED) {
+ continue;
}
- } finally {
- dataEvents.close();
+
+ DataItem dataItem = dataEvent.getDataItem();
+ if (!dataItem.getUri().getPath().equals(
+ DigitalWatchFaceUtil.PATH_WITH_FEATURE)) {
+ continue;
+ }
+
+ DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem);
+ DataMap config = dataMapItem.getDataMap();
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "Config DataItem updated:" + config);
+ }
+ updateUiForConfigDataMap(config);
}
}