resolved conflicts for merge of 8e0cfe7c to lmp-mr1-dev-plus-aosp
Change-Id: I068d2a0fb118d4e2b4c1e546bebfcbc2cb120d36
This commit is contained in:
@@ -43,8 +43,11 @@ static void FromColor_D32(void* dst, const SkColor src[], int width,
|
|||||||
|
|
||||||
static void FromColor_D32_Raw(void* dst, const SkColor src[], int width,
|
static void FromColor_D32_Raw(void* dst, const SkColor src[], int width,
|
||||||
int, int) {
|
int, int) {
|
||||||
|
// Needed to thwart the unreachable code detection from clang.
|
||||||
|
static const bool sk_color_ne_zero = SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER;
|
||||||
|
|
||||||
// SkColor's ordering may be different from SkPMColor
|
// SkColor's ordering may be different from SkPMColor
|
||||||
if (SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER) {
|
if (sk_color_ne_zero) {
|
||||||
memcpy(dst, src, width * sizeof(SkColor));
|
memcpy(dst, src, width * sizeof(SkColor));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,12 +49,6 @@ jmethodID gInsetStruct_constructorMethodID;
|
|||||||
|
|
||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
static inline int32_t validOrNeg1(bool isValid, int32_t value) {
|
|
||||||
// return isValid ? value : -1;
|
|
||||||
SkASSERT((int)isValid == 0 || (int)isValid == 1);
|
|
||||||
return ((int32_t)isValid - 1) | value;
|
|
||||||
}
|
|
||||||
|
|
||||||
jstring getMimeTypeString(JNIEnv* env, SkImageDecoder::Format format) {
|
jstring getMimeTypeString(JNIEnv* env, SkImageDecoder::Format format) {
|
||||||
static const struct {
|
static const struct {
|
||||||
SkImageDecoder::Format fFormat;
|
SkImageDecoder::Format fFormat;
|
||||||
@@ -185,8 +179,8 @@ public:
|
|||||||
|
|
||||||
const size_t size = sk_64_asS32(size64);
|
const size_t size = sk_64_asS32(size64);
|
||||||
if (size > mSize) {
|
if (size > mSize) {
|
||||||
ALOGW("bitmap marked for reuse (%d bytes) can't fit new bitmap (%d bytes)",
|
ALOGW("bitmap marked for reuse (%u bytes) can't fit new bitmap "
|
||||||
mSize, size);
|
"(%zu bytes)", mSize, size);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class SkCanvas;
|
|||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
class Paint;
|
class Paint;
|
||||||
class TypefaceImpl;
|
struct TypefaceImpl;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GraphicsJNI {
|
class GraphicsJNI {
|
||||||
@@ -205,7 +205,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
JavaVM* fVM;
|
JavaVM* fVM;
|
||||||
bool fAllocateInJavaHeap;
|
|
||||||
jbyteArray fStorageObj;
|
jbyteArray fStorageObj;
|
||||||
int fAllocCount;
|
int fAllocCount;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
|
|||||||
const int32_t* yDivs = chunk.getYDivs();
|
const int32_t* yDivs = chunk.getYDivs();
|
||||||
// if our SkCanvas were back by GL we should enable this and draw this as
|
// if our SkCanvas were back by GL we should enable this and draw this as
|
||||||
// a mesh, which will be faster in most cases.
|
// a mesh, which will be faster in most cases.
|
||||||
if (false) {
|
if ((false)) {
|
||||||
SkNinePatch::DrawMesh(canvas, bounds, bitmap,
|
SkNinePatch::DrawMesh(canvas, bounds, bitmap,
|
||||||
xDivs, chunk.numXDivs,
|
xDivs, chunk.numXDivs,
|
||||||
yDivs, chunk.numYDivs,
|
yDivs, chunk.numYDivs,
|
||||||
|
|||||||
@@ -97,12 +97,12 @@ static jlong nativeOpen(JNIEnv* env, jclass thiz, jint fd, jlong size) {
|
|||||||
switch (error) {
|
switch (error) {
|
||||||
case FPDF_ERR_PASSWORD:
|
case FPDF_ERR_PASSWORD:
|
||||||
case FPDF_ERR_SECURITY: {
|
case FPDF_ERR_SECURITY: {
|
||||||
jniThrowException(env, "java/lang/SecurityException",
|
jniThrowExceptionFmt(env, "java/lang/SecurityException",
|
||||||
"cannot create document. Error:" + error);
|
"cannot create document. Error: %ld", error);
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
jniThrowException(env, "java/io/IOException",
|
jniThrowExceptionFmt(env, "java/io/IOException",
|
||||||
"cannot create document. Error:" + error);
|
"cannot create document. Error: %ld", error);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
destroyLibraryIfNeeded();
|
destroyLibraryIfNeeded();
|
||||||
@@ -169,8 +169,8 @@ static void nativeWrite(JNIEnv* env, jclass thiz, jlong documentPtr, jint fd) {
|
|||||||
writer.WriteBlock = &writeBlock;
|
writer.WriteBlock = &writeBlock;
|
||||||
const bool success = FPDF_SaveAsCopy(document, &writer, FPDF_NO_INCREMENTAL);
|
const bool success = FPDF_SaveAsCopy(document, &writer, FPDF_NO_INCREMENTAL);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
jniThrowException(env, "java/io/IOException",
|
jniThrowExceptionFmt(env, "java/io/IOException",
|
||||||
"cannot write to fd. Error:" + errno);
|
"cannot write to fd. Error: %d", errno);
|
||||||
destroyLibraryIfNeeded();
|
destroyLibraryIfNeeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,12 +89,12 @@ static jlong nativeCreate(JNIEnv* env, jclass thiz, jint fd, jlong size) {
|
|||||||
switch (error) {
|
switch (error) {
|
||||||
case FPDF_ERR_PASSWORD:
|
case FPDF_ERR_PASSWORD:
|
||||||
case FPDF_ERR_SECURITY: {
|
case FPDF_ERR_SECURITY: {
|
||||||
jniThrowException(env, "java/lang/SecurityException",
|
jniThrowExceptionFmt(env, "java/lang/SecurityException",
|
||||||
"cannot create document. Error:" + error);
|
"cannot create document. Error: %ld", error);
|
||||||
} break;
|
} break;
|
||||||
default: {
|
default: {
|
||||||
jniThrowException(env, "java/io/IOException",
|
jniThrowExceptionFmt(env, "java/io/IOException",
|
||||||
"cannot create document. Error:" + error);
|
"cannot create document. Error: %ld", error);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
destroyLibraryIfNeeded();
|
destroyLibraryIfNeeded();
|
||||||
|
|||||||
@@ -471,13 +471,13 @@ static
|
|||||||
void multiplyMM(float* r, const float* lhs, const float* rhs)
|
void multiplyMM(float* r, const float* lhs, const float* rhs)
|
||||||
{
|
{
|
||||||
for (int i=0 ; i<4 ; i++) {
|
for (int i=0 ; i<4 ; i++) {
|
||||||
register const float rhs_i0 = rhs[ I(i,0) ];
|
const float rhs_i0 = rhs[ I(i,0) ];
|
||||||
register float ri0 = lhs[ I(0,0) ] * rhs_i0;
|
float ri0 = lhs[ I(0,0) ] * rhs_i0;
|
||||||
register float ri1 = lhs[ I(0,1) ] * rhs_i0;
|
float ri1 = lhs[ I(0,1) ] * rhs_i0;
|
||||||
register float ri2 = lhs[ I(0,2) ] * rhs_i0;
|
float ri2 = lhs[ I(0,2) ] * rhs_i0;
|
||||||
register float ri3 = lhs[ I(0,3) ] * rhs_i0;
|
float ri3 = lhs[ I(0,3) ] * rhs_i0;
|
||||||
for (int j=1 ; j<4 ; j++) {
|
for (int j=1 ; j<4 ; j++) {
|
||||||
register const float rhs_ij = rhs[ I(i,j) ];
|
const float rhs_ij = rhs[ I(i,j) ];
|
||||||
ri0 += lhs[ I(j,0) ] * rhs_ij;
|
ri0 += lhs[ I(j,0) ] * rhs_ij;
|
||||||
ri1 += lhs[ I(j,1) ] * rhs_ij;
|
ri1 += lhs[ I(j,1) ] * rhs_ij;
|
||||||
ri2 += lhs[ I(j,2) ] * rhs_ij;
|
ri2 += lhs[ I(j,2) ] * rhs_ij;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ static jbyteArray DdmHandleNativeHeap_getLeakInfo(JNIEnv* env, jobject) {
|
|||||||
get_malloc_leak_info(&allocBytes, &header.allocSize, &header.allocInfoSize,
|
get_malloc_leak_info(&allocBytes, &header.allocSize, &header.allocInfoSize,
|
||||||
&header.totalMemory, &header.backtraceSize);
|
&header.totalMemory, &header.backtraceSize);
|
||||||
|
|
||||||
ALOGD("*** mapSize: %d allocSize: %d allocInfoSize: %d totalMemory: %d",
|
ALOGD("*** mapSize: %zu allocSize: %zu allocInfoSize: %zu totalMemory: %zu",
|
||||||
header.mapSize, header.allocSize, header.allocInfoSize, header.totalMemory);
|
header.mapSize, header.allocSize, header.allocInfoSize, header.totalMemory);
|
||||||
|
|
||||||
#if defined(__LP64__)
|
#if defined(__LP64__)
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ jbyteArray JNICameraContext::getCallbackBuffer(
|
|||||||
|
|
||||||
// Vector access should be protected by lock in postData()
|
// Vector access should be protected by lock in postData()
|
||||||
if (!buffers->isEmpty()) {
|
if (!buffers->isEmpty()) {
|
||||||
ALOGV("Using callback buffer from queue of length %d", buffers->size());
|
ALOGV("Using callback buffer from queue of length %zu", buffers->size());
|
||||||
jbyteArray globalBuffer = buffers->itemAt(0);
|
jbyteArray globalBuffer = buffers->itemAt(0);
|
||||||
buffers->removeAt(0);
|
buffers->removeAt(0);
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ jbyteArray JNICameraContext::getCallbackBuffer(
|
|||||||
if (obj != NULL) {
|
if (obj != NULL) {
|
||||||
jsize bufferLength = env->GetArrayLength(obj);
|
jsize bufferLength = env->GetArrayLength(obj);
|
||||||
if ((int)bufferLength < (int)bufferSize) {
|
if ((int)bufferLength < (int)bufferSize) {
|
||||||
ALOGE("Callback buffer was too small! Expected %d bytes, but got %d bytes!",
|
ALOGE("Callback buffer was too small! Expected %zu bytes, but got %d bytes!",
|
||||||
bufferSize, bufferLength);
|
bufferSize, bufferLength);
|
||||||
env->DeleteLocalRef(obj);
|
env->DeleteLocalRef(obj);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -444,7 +444,7 @@ void JNICameraContext::addCallbackBuffer(
|
|||||||
jbyteArray callbackBuffer = (jbyteArray)env->NewGlobalRef(cbb);
|
jbyteArray callbackBuffer = (jbyteArray)env->NewGlobalRef(cbb);
|
||||||
mCallbackBuffers.push(callbackBuffer);
|
mCallbackBuffers.push(callbackBuffer);
|
||||||
|
|
||||||
ALOGV("Adding callback buffer to queue, %d total",
|
ALOGV("Adding callback buffer to queue, %zu total",
|
||||||
mCallbackBuffers.size());
|
mCallbackBuffers.size());
|
||||||
|
|
||||||
// We want to make sure the camera knows we're ready for the
|
// We want to make sure the camera knows we're ready for the
|
||||||
@@ -480,7 +480,7 @@ void JNICameraContext::clearCallbackBuffers_l(JNIEnv *env)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JNICameraContext::clearCallbackBuffers_l(JNIEnv *env, Vector<jbyteArray> *buffers) {
|
void JNICameraContext::clearCallbackBuffers_l(JNIEnv *env, Vector<jbyteArray> *buffers) {
|
||||||
ALOGV("Clearing callback buffers, %d remained", buffers->size());
|
ALOGV("Clearing callback buffers, %zu remained", buffers->size());
|
||||||
while (!buffers->isEmpty()) {
|
while (!buffers->isEmpty()) {
|
||||||
env->DeleteGlobalRef(buffers->top());
|
env->DeleteGlobalRef(buffers->top());
|
||||||
buffers->pop();
|
buffers->pop();
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ struct Helpers {
|
|||||||
size_t typeSize = getTypeSize(type);
|
size_t typeSize = getTypeSize(type);
|
||||||
|
|
||||||
if (dataBytes % typeSize != 0) {
|
if (dataBytes % typeSize != 0) {
|
||||||
ALOGE("%s: Expected dataBytes (%ud) to be divisible by typeSize "
|
ALOGE("%s: Expected dataBytes (%zu) to be divisible by typeSize "
|
||||||
"(%ud)", __FUNCTION__, dataBytes, typeSize);
|
"(%zu)", __FUNCTION__, dataBytes, typeSize);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ static jboolean CameraMetadata_isEmpty(JNIEnv *env, jobject thiz) {
|
|||||||
|
|
||||||
jboolean empty = metadata->isEmpty();
|
jboolean empty = metadata->isEmpty();
|
||||||
|
|
||||||
ALOGV("%s: Empty returned %d, entry count was %d",
|
ALOGV("%s: Empty returned %d, entry count was %zu",
|
||||||
__FUNCTION__, empty, metadata->entryCount());
|
__FUNCTION__, empty, metadata->entryCount());
|
||||||
|
|
||||||
return empty;
|
return empty;
|
||||||
@@ -675,7 +675,7 @@ static jint CameraMetadata_getTagFromKey(JNIEnv *env, jobject thiz, jstring keyN
|
|||||||
"Could not find section name for key '%s')", key);
|
"Could not find section name for key '%s')", key);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
ALOGV("%s: Found matched section '%s' (%d)",
|
ALOGV("%s: Found matched section '%s' (%zu)",
|
||||||
__FUNCTION__, section, sectionIndex);
|
__FUNCTION__, section, sectionIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,15 @@
|
|||||||
|
|
||||||
//#define LOG_NDEBUG 0
|
//#define LOG_NDEBUG 0
|
||||||
#define LOG_TAG "DngCreator_JNI"
|
#define LOG_TAG "DngCreator_JNI"
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <utils/Log.h>
|
||||||
|
#include <utils/Errors.h>
|
||||||
|
#include <utils/StrongPointer.h>
|
||||||
|
#include <utils/RefBase.h>
|
||||||
|
#include <utils/Vector.h>
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
|
||||||
#include <system/camera_metadata.h>
|
#include <system/camera_metadata.h>
|
||||||
#include <camera/CameraMetadata.h>
|
#include <camera/CameraMetadata.h>
|
||||||
@@ -27,15 +36,6 @@
|
|||||||
#include <img_utils/Input.h>
|
#include <img_utils/Input.h>
|
||||||
#include <img_utils/StripSource.h>
|
#include <img_utils/StripSource.h>
|
||||||
|
|
||||||
#include <utils/Log.h>
|
|
||||||
#include <utils/Errors.h>
|
|
||||||
#include <utils/StrongPointer.h>
|
|
||||||
#include <utils/RefBase.h>
|
|
||||||
#include <utils/Vector.h>
|
|
||||||
#include <cutils/properties.h>
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "android_runtime/AndroidRuntime.h"
|
#include "android_runtime/AndroidRuntime.h"
|
||||||
#include "android_runtime/android_hardware_camera2_CameraMetadata.h"
|
#include "android_runtime/android_hardware_camera2_CameraMetadata.h"
|
||||||
|
|
||||||
@@ -758,7 +758,8 @@ static status_t generateNoiseProfile(const double* perChannelNoiseProfile, uint8
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (uninitialized) {
|
if (uninitialized) {
|
||||||
ALOGE("%s: No valid NoiseProfile coefficients for color plane %u", __FUNCTION__, p);
|
ALOGE("%s: No valid NoiseProfile coefficients for color plane %zu",
|
||||||
|
__FUNCTION__, p);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1399,8 +1400,9 @@ static void DngCreator_init(JNIEnv* env, jobject thiz, jobject characteristicsPt
|
|||||||
|
|
||||||
if (entry.count > 0) {
|
if (entry.count > 0) {
|
||||||
if (entry.count != numCfaChannels * 2) {
|
if (entry.count != numCfaChannels * 2) {
|
||||||
ALOGW("%s: Invalid entry count %u for noise profile returned in characteristics,"
|
ALOGW("%s: Invalid entry count %zu for noise profile returned "
|
||||||
" no noise profile tag written...", __FUNCTION__, entry.count);
|
"in characteristics, no noise profile tag written...",
|
||||||
|
__FUNCTION__, entry.count);
|
||||||
} else {
|
} else {
|
||||||
if ((err = generateNoiseProfile(entry.data.d, cfaOut, numCfaChannels,
|
if ((err = generateNoiseProfile(entry.data.d, cfaOut, numCfaChannels,
|
||||||
cfaPlaneColor, numPlaneColors, /*out*/ noiseProfile)) == OK) {
|
cfaPlaneColor, numPlaneColors, /*out*/ noiseProfile)) == OK) {
|
||||||
@@ -1795,8 +1797,9 @@ static void DngCreator_nativeWriteImage(JNIEnv* env, jobject thiz, jobject outSt
|
|||||||
jint height, jobject inBuffer, jint rowStride, jint pixStride, jlong offset,
|
jint height, jobject inBuffer, jint rowStride, jint pixStride, jlong offset,
|
||||||
jboolean isDirect) {
|
jboolean isDirect) {
|
||||||
ALOGV("%s:", __FUNCTION__);
|
ALOGV("%s:", __FUNCTION__);
|
||||||
ALOGV("%s: nativeWriteImage called with: width=%d, height=%d, rowStride=%d, pixStride=%d,"
|
ALOGV("%s: nativeWriteImage called with: width=%d, height=%d, "
|
||||||
" offset=%lld", __FUNCTION__, width, height, rowStride, pixStride, offset);
|
"rowStride=%d, pixStride=%d, offset=%" PRId64, __FUNCTION__, width,
|
||||||
|
height, rowStride, pixStride, offset);
|
||||||
uint32_t rStride = static_cast<uint32_t>(rowStride);
|
uint32_t rStride = static_cast<uint32_t>(rowStride);
|
||||||
uint32_t pStride = static_cast<uint32_t>(pixStride);
|
uint32_t pStride = static_cast<uint32_t>(pixStride);
|
||||||
uint32_t uWidth = static_cast<uint32_t>(width);
|
uint32_t uWidth = static_cast<uint32_t>(width);
|
||||||
@@ -1903,12 +1906,12 @@ static void DngCreator_nativeWriteInputStream(JNIEnv* env, jobject thiz, jobject
|
|||||||
uint32_t uHeight = static_cast<uint32_t>(height);
|
uint32_t uHeight = static_cast<uint32_t>(height);
|
||||||
uint64_t uOffset = static_cast<uint32_t>(offset);
|
uint64_t uOffset = static_cast<uint32_t>(offset);
|
||||||
|
|
||||||
ALOGV("%s: nativeWriteInputStream called with: width=%d, height=%d, rowStride=%u,"
|
ALOGV("%s: nativeWriteInputStream called with: width=%d, height=%d, "
|
||||||
"pixStride=%u, offset=%lld", __FUNCTION__, width, height, rowStride, pixStride,
|
"rowStride=%d, pixStride=%d, offset=%" PRId64, __FUNCTION__, width,
|
||||||
offset);
|
height, rowStride, pixStride, offset);
|
||||||
|
|
||||||
sp<JniOutputStream> out = new JniOutputStream(env, outStream);
|
sp<JniOutputStream> out = new JniOutputStream(env, outStream);
|
||||||
if(env->ExceptionCheck()) {
|
if (env->ExceptionCheck()) {
|
||||||
ALOGE("%s: Could not allocate buffers for output stream", __FUNCTION__);
|
ALOGE("%s: Could not allocate buffers for output stream", __FUNCTION__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1187,7 +1187,7 @@ android_media_AudioSystem_listAudioPatches(JNIEnv *env, jobject clazz,
|
|||||||
jStatus = AUDIO_JAVA_ERROR;
|
jStatus = AUDIO_JAVA_ERROR;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
ALOGV("listAudioPatches patch %d num_sources %d num_sinks %d",
|
ALOGV("listAudioPatches patch %zu num_sources %d num_sinks %d",
|
||||||
i, nPatches[i].num_sources, nPatches[i].num_sinks);
|
i, nPatches[i].num_sources, nPatches[i].num_sinks);
|
||||||
|
|
||||||
env->SetIntField(patchHandle, gAudioHandleFields.mId, nPatches[i].id);
|
env->SetIntField(patchHandle, gAudioHandleFields.mId, nPatches[i].id);
|
||||||
@@ -1211,7 +1211,7 @@ android_media_AudioSystem_listAudioPatches(JNIEnv *env, jobject clazz,
|
|||||||
env->SetObjectArrayElement(jSources, j, jSource);
|
env->SetObjectArrayElement(jSources, j, jSource);
|
||||||
env->DeleteLocalRef(jSource);
|
env->DeleteLocalRef(jSource);
|
||||||
jSource = NULL;
|
jSource = NULL;
|
||||||
ALOGV("listAudioPatches patch %d source %d is a %s handle %d",
|
ALOGV("listAudioPatches patch %zu source %zu is a %s handle %d",
|
||||||
i, j,
|
i, j,
|
||||||
nPatches[i].sources[j].type == AUDIO_PORT_TYPE_DEVICE ? "device" : "mix",
|
nPatches[i].sources[j].type == AUDIO_PORT_TYPE_DEVICE ? "device" : "mix",
|
||||||
nPatches[i].sources[j].id);
|
nPatches[i].sources[j].id);
|
||||||
@@ -1236,7 +1236,7 @@ android_media_AudioSystem_listAudioPatches(JNIEnv *env, jobject clazz,
|
|||||||
env->SetObjectArrayElement(jSinks, j, jSink);
|
env->SetObjectArrayElement(jSinks, j, jSink);
|
||||||
env->DeleteLocalRef(jSink);
|
env->DeleteLocalRef(jSink);
|
||||||
jSink = NULL;
|
jSink = NULL;
|
||||||
ALOGV("listAudioPatches patch %d sink %d is a %s handle %d",
|
ALOGV("listAudioPatches patch %zu sink %zu is a %s handle %d",
|
||||||
i, j,
|
i, j,
|
||||||
nPatches[i].sinks[j].type == AUDIO_PORT_TYPE_DEVICE ? "device" : "mix",
|
nPatches[i].sinks[j].type == AUDIO_PORT_TYPE_DEVICE ? "device" : "mix",
|
||||||
nPatches[i].sinks[j].id);
|
nPatches[i].sinks[j].id);
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ private:
|
|||||||
JNIEnv* fEnv;
|
JNIEnv* fEnv;
|
||||||
void* fPointer;
|
void* fPointer;
|
||||||
jarray fArray;
|
jarray fArray;
|
||||||
jint fRemaining;
|
|
||||||
jboolean fCommit;
|
jboolean fCommit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#define LOG_TAG "Trace"
|
#define LOG_TAG "Trace"
|
||||||
// #define LOG_NDEBUG 0
|
// #define LOG_NDEBUG 0
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <JNIHelp.h>
|
#include <JNIHelp.h>
|
||||||
#include <ScopedUtfChars.h>
|
#include <ScopedUtfChars.h>
|
||||||
#include <ScopedStringChars.h>
|
#include <ScopedStringChars.h>
|
||||||
@@ -48,7 +50,7 @@ static void android_os_Trace_nativeTraceCounter(JNIEnv* env, jclass clazz,
|
|||||||
jlong tag, jstring nameStr, jint value) {
|
jlong tag, jstring nameStr, jint value) {
|
||||||
ScopedUtfChars name(env, nameStr);
|
ScopedUtfChars name(env, nameStr);
|
||||||
|
|
||||||
ALOGV("%s: %lld %s %d", __FUNCTION__, tag, name.c_str(), value);
|
ALOGV("%s: %" PRId64 " %s %d", __FUNCTION__, tag, name.c_str(), value);
|
||||||
atrace_int(tag, name.c_str(), value);
|
atrace_int(tag, name.c_str(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,14 +60,14 @@ static void android_os_Trace_nativeTraceBegin(JNIEnv* env, jclass clazz,
|
|||||||
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
|
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
|
||||||
sanitizeString(utf8Chars);
|
sanitizeString(utf8Chars);
|
||||||
|
|
||||||
ALOGV("%s: %lld %s", __FUNCTION__, tag, utf8Chars.string());
|
ALOGV("%s: %" PRId64 " %s", __FUNCTION__, tag, utf8Chars.string());
|
||||||
atrace_begin(tag, utf8Chars.string());
|
atrace_begin(tag, utf8Chars.string());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_os_Trace_nativeTraceEnd(JNIEnv* env, jclass clazz,
|
static void android_os_Trace_nativeTraceEnd(JNIEnv* env, jclass clazz,
|
||||||
jlong tag) {
|
jlong tag) {
|
||||||
|
|
||||||
ALOGV("%s: %lld", __FUNCTION__, tag);
|
ALOGV("%s: %" PRId64, __FUNCTION__, tag);
|
||||||
atrace_end(tag);
|
atrace_end(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +77,7 @@ static void android_os_Trace_nativeAsyncTraceBegin(JNIEnv* env, jclass clazz,
|
|||||||
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
|
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
|
||||||
sanitizeString(utf8Chars);
|
sanitizeString(utf8Chars);
|
||||||
|
|
||||||
ALOGV("%s: %lld %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
|
ALOGV("%s: %" PRId64 " %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
|
||||||
atrace_async_begin(tag, utf8Chars.string(), cookie);
|
atrace_async_begin(tag, utf8Chars.string(), cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +87,7 @@ static void android_os_Trace_nativeAsyncTraceEnd(JNIEnv* env, jclass clazz,
|
|||||||
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
|
String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
|
||||||
sanitizeString(utf8Chars);
|
sanitizeString(utf8Chars);
|
||||||
|
|
||||||
ALOGV("%s: %lld %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
|
ALOGV("%s: %" PRId64 " %s %d", __FUNCTION__, tag, utf8Chars.string(), cookie);
|
||||||
atrace_async_end(tag, utf8Chars.string(), cookie);
|
atrace_async_end(tag, utf8Chars.string(), cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,29 +19,28 @@
|
|||||||
|
|
||||||
#include <android_runtime/android_util_AssetManager.h>
|
#include <android_runtime/android_util_AssetManager.h>
|
||||||
|
|
||||||
#include "jni.h"
|
#include <inttypes.h>
|
||||||
#include "JNIHelp.h"
|
#include <linux/capability.h>
|
||||||
#include "ScopedStringChars.h"
|
|
||||||
#include "ScopedUtfChars.h"
|
|
||||||
#include "android_util_Binder.h"
|
|
||||||
#include <utils/misc.h>
|
|
||||||
#include <android_runtime/AndroidRuntime.h>
|
|
||||||
#include <utils/Log.h>
|
|
||||||
|
|
||||||
#include <androidfw/Asset.h>
|
|
||||||
#include <androidfw/AssetManager.h>
|
|
||||||
#include <androidfw/AttributeFinder.h>
|
|
||||||
#include <androidfw/ResourceTypes.h>
|
|
||||||
|
|
||||||
#include <private/android_filesystem_config.h> // for AID_SYSTEM
|
|
||||||
|
|
||||||
#include "core_jni_helpers.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <linux/capability.h>
|
#include <private/android_filesystem_config.h> // for AID_SYSTEM
|
||||||
|
|
||||||
|
#include "androidfw/Asset.h"
|
||||||
|
#include "androidfw/AssetManager.h"
|
||||||
|
#include "androidfw/AttributeFinder.h"
|
||||||
|
#include "androidfw/ResourceTypes.h"
|
||||||
|
#include "android_runtime/AndroidRuntime.h"
|
||||||
|
#include "android_util_Binder.h"
|
||||||
|
#include "core_jni_helpers.h"
|
||||||
|
#include "jni.h"
|
||||||
|
#include "JNIHelp.h"
|
||||||
|
#include "ScopedStringChars.h"
|
||||||
|
#include "ScopedUtfChars.h"
|
||||||
|
#include "utils/Log.h"
|
||||||
|
#include "utils/misc.h"
|
||||||
|
|
||||||
extern "C" int capget(cap_user_header_t hdrp, cap_user_data_t datap);
|
extern "C" int capget(cap_user_header_t hdrp, cap_user_data_t datap);
|
||||||
extern "C" int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
|
extern "C" int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
|
||||||
|
|
||||||
@@ -1059,8 +1058,8 @@ static jboolean android_content_AssetManager_resolveAttrs(JNIEnv* env, jobject c
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (kDebugStyles) {
|
if (kDebugStyles) {
|
||||||
ALOGI("APPLY STYLE: theme=0x%x defStyleAttr=0x%x defStyleRes=0x%x",
|
ALOGI("APPLY STYLE: theme=0x%" PRIx64 " defStyleAttr=0x%x "
|
||||||
themeToken, defStyleAttr, defStyleRes);
|
"defStyleRes=0x%x", themeToken, defStyleAttr, defStyleRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResTable::Theme* theme = reinterpret_cast<ResTable::Theme*>(themeToken);
|
ResTable::Theme* theme = reinterpret_cast<ResTable::Theme*>(themeToken);
|
||||||
@@ -1262,8 +1261,9 @@ static jboolean android_content_AssetManager_applyStyle(JNIEnv* env, jobject cla
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (kDebugStyles) {
|
if (kDebugStyles) {
|
||||||
ALOGI("APPLY STYLE: theme=0x%x defStyleAttr=0x%x defStyleRes=0x%x xml=0x%x",
|
ALOGI("APPLY STYLE: theme=0x%" PRIx64 " defStyleAttr=0x%x defStyleRes=0x%x "
|
||||||
themeToken, defStyleAttr, defStyleRes, xmlParserToken);
|
"xml=0x%" PRIx64, themeToken, defStyleAttr, defStyleRes,
|
||||||
|
xmlParserToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResTable::Theme* theme = reinterpret_cast<ResTable::Theme*>(themeToken);
|
ResTable::Theme* theme = reinterpret_cast<ResTable::Theme*>(themeToken);
|
||||||
|
|||||||
@@ -208,7 +208,6 @@ static void report_exception(JNIEnv* env, jthrowable excep, const char* msg)
|
|||||||
sleep(60);
|
sleep(60);
|
||||||
ALOGE("Forcefully exiting");
|
ALOGE("Forcefully exiting");
|
||||||
exit(1);
|
exit(1);
|
||||||
*((int *) 1) = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
|
|||||||
@@ -18,9 +18,10 @@
|
|||||||
|
|
||||||
//#define LOG_NDEBUG 0
|
//#define LOG_NDEBUG 0
|
||||||
|
|
||||||
|
|
||||||
#include "JNIHelp.h"
|
#include "JNIHelp.h"
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <android_runtime/AndroidRuntime.h>
|
#include <android_runtime/AndroidRuntime.h>
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
#include <utils/Looper.h>
|
#include <utils/Looper.h>
|
||||||
@@ -144,7 +145,7 @@ int NativeDisplayEventReceiver::handleEvent(int receiveFd, int events, void* dat
|
|||||||
int32_t vsyncDisplayId;
|
int32_t vsyncDisplayId;
|
||||||
uint32_t vsyncCount;
|
uint32_t vsyncCount;
|
||||||
if (processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) {
|
if (processPendingEvents(&vsyncTimestamp, &vsyncDisplayId, &vsyncCount)) {
|
||||||
ALOGV("receiver %p ~ Vsync pulse: timestamp=%lld, id=%d, count=%d",
|
ALOGV("receiver %p ~ Vsync pulse: timestamp=%" PRId64 ", id=%d, count=%d",
|
||||||
this, vsyncTimestamp, vsyncDisplayId, vsyncCount);
|
this, vsyncTimestamp, vsyncDisplayId, vsyncCount);
|
||||||
mWaitingForVsync = false;
|
mWaitingForVsync = false;
|
||||||
dispatchVsync(vsyncTimestamp, vsyncDisplayId, vsyncCount);
|
dispatchVsync(vsyncTimestamp, vsyncDisplayId, vsyncCount);
|
||||||
|
|||||||
@@ -20,12 +20,12 @@
|
|||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
|
||||||
#include <grp.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <grp.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/capability.h>
|
#include <sys/capability.h>
|
||||||
#include <sys/personality.h>
|
#include <sys/personality.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cutils/fs.h>
|
#include <cutils/fs.h>
|
||||||
#include <cutils/multiuser.h>
|
#include <cutils/multiuser.h>
|
||||||
@@ -104,7 +104,7 @@ static void SigChldHandler(int /*signal_number*/) {
|
|||||||
// so that it is restarted by init and system server will be restarted
|
// so that it is restarted by init and system server will be restarted
|
||||||
// from there.
|
// from there.
|
||||||
if (pid == gSystemServerPid) {
|
if (pid == gSystemServerPid) {
|
||||||
ALOGE("Exit zygote because system server (%d) has terminated");
|
ALOGE("Exit zygote because system server (%d) has terminated", pid);
|
||||||
kill(getpid(), SIGKILL);
|
kill(getpid(), SIGKILL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,8 @@ static void SetRLimits(JNIEnv* env, jobjectArray javaRlimits) {
|
|||||||
|
|
||||||
int rc = setrlimit(javaRlimit[0], &rlim);
|
int rc = setrlimit(javaRlimit[0], &rlim);
|
||||||
if (rc == -1) {
|
if (rc == -1) {
|
||||||
ALOGE("setrlimit(%d, {%d, %d}) failed", javaRlimit[0], rlim.rlim_cur, rlim.rlim_max);
|
ALOGE("setrlimit(%d, {%ld, %ld}) failed", javaRlimit[0], rlim.rlim_cur,
|
||||||
|
rlim.rlim_max);
|
||||||
RuntimeAbort(env);
|
RuntimeAbort(env);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,7 +236,7 @@ static void SetCapabilities(JNIEnv* env, int64_t permitted, int64_t effective) {
|
|||||||
capdata[1].permitted = permitted >> 32;
|
capdata[1].permitted = permitted >> 32;
|
||||||
|
|
||||||
if (capset(&capheader, &capdata[0]) == -1) {
|
if (capset(&capheader, &capdata[0]) == -1) {
|
||||||
ALOGE("capset(%lld, %lld) failed", permitted, effective);
|
ALOGE("capset(%" PRId64 ", %" PRId64 ") failed", permitted, effective);
|
||||||
RuntimeAbort(env);
|
RuntimeAbort(env);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user