Merge "Avoid reading network stats when disabled."
diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h
index 83cda86..da85a9a 100644
--- a/include/utils/GenerationCache.h
+++ b/include/utils/GenerationCache.h
@@ -88,11 +88,13 @@
void attachToCache(const sp<Entry<K, V> >& entry);
void detachFromCache(const sp<Entry<K, V> >& entry);
+
+ const V mNullValue;
}; // class GenerationCache
template<typename K, typename V>
GenerationCache<K, V>::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity),
- mListener(NULL) {
+ mListener(NULL), mNullValue(NULL) {
};
template<typename K, typename V>
@@ -154,7 +156,7 @@
return entry->value;
}
- return NULL;
+ return mNullValue;
}
template<typename K, typename V>
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 6f3051a..4310bed 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -500,8 +500,8 @@
eglDestroySyncKHR(dpy, fence);
}
- ST_LOGV("dequeueBuffer: returning slot=%d buf=%p flags=%#x", buf,
- mSlots[buf].mGraphicBuffer->handle, returnFlags);
+ ST_LOGV("dequeueBuffer: returning slot=%d buf=%p flags=%#x", *outBuf,
+ mSlots[*outBuf].mGraphicBuffer->handle, returnFlags);
return returnFlags;
}
diff --git a/opengl/libs/ETC1/etc1.cpp b/opengl/libs/ETC1/etc1.cpp
index 5ed2c3c..97d1085 100644
--- a/opengl/libs/ETC1/etc1.cpp
+++ b/opengl/libs/ETC1/etc1.cpp
@@ -149,13 +149,13 @@
static
inline int convert8To4(int b) {
int c = b & 0xff;
- return divideBy255(b * 15);
+ return divideBy255(c * 15);
}
static
inline int convert8To5(int b) {
int c = b & 0xff;
- return divideBy255(b * 31);
+ return divideBy255(c * 31);
}
static