Merge "Migrate libcamera2ndk to ndk_library."
diff --git a/drm/libmediadrm/Android.mk b/drm/libmediadrm/Android.mk
index 6a2ed31..f1c6b00 100644
--- a/drm/libmediadrm/Android.mk
+++ b/drm/libmediadrm/Android.mk
@@ -23,9 +23,6 @@
 	libstagefright_foundation \
 	libutils
 
-LOCAL_C_INCLUDES := \
-    libcore/include
-
 LOCAL_CFLAGS += -Werror -Wno-error=deprecated-declarations -Wall
 LOCAL_CLANG := true
 
diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h
index cec9d99..389ec01 100644
--- a/include/media/mediaplayer.h
+++ b/include/media/mediaplayer.h
@@ -30,7 +30,7 @@
 #include <utils/KeyedVector.h>
 #include <utils/String8.h>
 
-class ANativeWindow;
+struct ANativeWindow;
 
 namespace android {
 
diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk
index 31a6992..98ccc42 100644
--- a/media/libmediaplayerservice/Android.mk
+++ b/media/libmediaplayerservice/Android.mk
@@ -55,7 +55,6 @@
     $(TOP)/frameworks/native/include/media/openmax                  \
     $(TOP)/frameworks/native/include/media/hardware                 \
     $(TOP)/external/tremolo/Tremolo                                 \
-    libcore/include                                                 \
 
 LOCAL_CFLAGS += -Werror -Wno-error=deprecated-declarations -Wall
 LOCAL_CLANG := true
diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp
index f75706b..8afb7e9 100644
--- a/media/libstagefright/MediaCodecList.cpp
+++ b/media/libstagefright/MediaCodecList.cpp
@@ -1165,7 +1165,9 @@
         CHECK(info != NULL);
         AString componentName = info->getCodecName();
 
-        if (!((flags & kHardwareCodecsOnly) && !isSoftwareCodec(componentName))) {
+        if ((flags & kHardwareCodecsOnly) && isSoftwareCodec(componentName)) {
+            ALOGV("skipping SW codec '%s'", componentName.c_str());
+        } else {
             matches->push(componentName);
             ALOGV("matching '%s'", componentName.c_str());
         }
diff --git a/media/libstagefright/omx/GraphicBufferSource.cpp b/media/libstagefright/omx/GraphicBufferSource.cpp
index 422f87f..63424f7 100644
--- a/media/libstagefright/omx/GraphicBufferSource.cpp
+++ b/media/libstagefright/omx/GraphicBufferSource.cpp
@@ -921,11 +921,12 @@
  * frameNum: frame number of the frame being released
  * buffer: GraphicBuffer pointer to release (note this must not be & as we
  *         will clear the original mBufferSlot in persistent case)
+ *         Use NOLINT to supress warning on the copy of 'buffer'.
  * fence: fence of the frame being released
  */
 void GraphicBufferSource::releaseBuffer(
         int &id, uint64_t frameNum,
-        const sp<GraphicBuffer> &buffer, const sp<Fence> &fence) {
+        const sp<GraphicBuffer> buffer, const sp<Fence> &fence) {  // NOLINT
     if (mIsPersistent) {
         mConsumer->detachBuffer(id);
         mBufferSlot[id] = NULL;
diff --git a/media/libstagefright/omx/GraphicBufferSource.h b/media/libstagefright/omx/GraphicBufferSource.h
index 3fcab2b..c8b0e62 100644
--- a/media/libstagefright/omx/GraphicBufferSource.h
+++ b/media/libstagefright/omx/GraphicBufferSource.h
@@ -242,7 +242,7 @@
     // Release buffer to the consumer
     void releaseBuffer(
             int &id, uint64_t frameNum,
-            const sp<GraphicBuffer> &buffer, const sp<Fence> &fence);
+            const sp<GraphicBuffer> buffer, const sp<Fence> &fence);
 
     void setLatestBuffer_l(const BufferItem &item, bool dropped);
     bool repeatLatestBuffer_l();
diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk
index 4f826e5..5388adc 100644
--- a/services/audioflinger/Android.mk
+++ b/services/audioflinger/Android.mk
@@ -34,7 +34,6 @@
 LOCAL_C_INCLUDES := \
     $(TOPDIR)frameworks/av/services/audiopolicy \
     $(TOPDIR)external/sonic \
-    libcore/include \
     $(call include-path-for, audio-effects) \
     $(call include-path-for, audio-utils)
 
diff --git a/services/audioflinger/AudioResamplerDyn.cpp b/services/audioflinger/AudioResamplerDyn.cpp
index e615700..b7ca5d9 100644
--- a/services/audioflinger/AudioResamplerDyn.cpp
+++ b/services/audioflinger/AudioResamplerDyn.cpp
@@ -520,7 +520,7 @@
         //        inFrameCount, outputIndex, outFrameCount, phaseFraction, phaseWrapLimit);
 
         // check inputIndex overflow
-        ALOG_ASSERT(inputIndex <= mBuffer.frameCount, "inputIndex%d > frameCount%d",
+        ALOG_ASSERT(inputIndex <= mBuffer.frameCount, "inputIndex%zu > frameCount%zu",
                 inputIndex, mBuffer.frameCount);
         // Buffer is empty, fetch a new one if necessary (inFrameCount > 0).
         // We may not fetch a new buffer if the existing data is sufficient.
@@ -591,7 +591,7 @@
         // We arrive here when we're finished or when the input buffer runs out.
         // Regardless we need to release the input buffer if we've acquired it.
         if (inputIndex > 0) {  // we've acquired a buffer (alternatively could check frameCount)
-            ALOG_ASSERT(inputIndex == frameCount, "inputIndex(%d) != frameCount(%d)",
+            ALOG_ASSERT(inputIndex == frameCount, "inputIndex(%zu) != frameCount(%zu)",
                     inputIndex, frameCount);  // must have been fully read.
             inputIndex = 0;
             provider->releaseBuffer(&mBuffer);
@@ -603,7 +603,7 @@
     // inputIndex must be zero in all three cases:
     // (1) the buffer never was been acquired; (2) the buffer was
     // released at "done:"; or (3) getNextBuffer() failed.
-    ALOG_ASSERT(inputIndex == 0, "Releasing: inputindex:%d frameCount:%d  phaseFraction:%u",
+    ALOG_ASSERT(inputIndex == 0, "Releasing: inputindex:%zu frameCount:%zu  phaseFraction:%u",
             inputIndex, mBuffer.frameCount, phaseFraction);
     ALOG_ASSERT(mBuffer.frameCount == 0); // there must be no frames in the buffer
     mInBuffer.setImpulse(impulse);