Merge "getBlobAshmemSize -> getOpenAshmemSize" am: b146c8bedb am: ab8578378d am: 4ef3dc86b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1854070 Change-Id: I13d8848ed6cc4823555af1db46f5e186c292a63e
This commit is contained in:
@@ -401,7 +401,7 @@ public final class Parcel {
|
|||||||
private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000;
|
private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000;
|
||||||
|
|
||||||
@CriticalNative
|
@CriticalNative
|
||||||
private static native long nativeGetBlobAshmemSize(long nativePtr);
|
private static native long nativeGetOpenAshmemSize(long nativePtr);
|
||||||
|
|
||||||
public final static Parcelable.Creator<String> STRING_CREATOR
|
public final static Parcelable.Creator<String> STRING_CREATOR
|
||||||
= new Parcelable.Creator<String>() {
|
= new Parcelable.Creator<String>() {
|
||||||
@@ -4381,8 +4381,8 @@ public final class Parcel {
|
|||||||
/**
|
/**
|
||||||
* @hide For testing
|
* @hide For testing
|
||||||
*/
|
*/
|
||||||
public long getBlobAshmemSize() {
|
public long getOpenAshmemSize() {
|
||||||
return nativeGetBlobAshmemSize(mNativePtr);
|
return nativeGetOpenAshmemSize(mNativePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String valueTypeToString(int type) {
|
private static String valueTypeToString(int type) {
|
||||||
|
|||||||
@@ -740,11 +740,11 @@ static jlong android_os_Parcel_getGlobalAllocCount(JNIEnv* env, jclass clazz)
|
|||||||
return Parcel::getGlobalAllocCount();
|
return Parcel::getGlobalAllocCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jlong android_os_Parcel_getBlobAshmemSize(jlong nativePtr)
|
static jlong android_os_Parcel_getOpenAshmemSize(jlong nativePtr)
|
||||||
{
|
{
|
||||||
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
||||||
if (parcel != NULL) {
|
if (parcel != NULL) {
|
||||||
return parcel->getBlobAshmemSize();
|
return parcel->getOpenAshmemSize();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -852,7 +852,7 @@ static const JNINativeMethod gParcelMethods[] = {
|
|||||||
{"getGlobalAllocCount", "()J", (void*)android_os_Parcel_getGlobalAllocCount},
|
{"getGlobalAllocCount", "()J", (void*)android_os_Parcel_getGlobalAllocCount},
|
||||||
|
|
||||||
// @CriticalNative
|
// @CriticalNative
|
||||||
{"nativeGetBlobAshmemSize", "(J)J", (void*)android_os_Parcel_getBlobAshmemSize},
|
{"nativeGetOpenAshmemSize", "(J)J", (void*)android_os_Parcel_getOpenAshmemSize},
|
||||||
|
|
||||||
// @CriticalNative
|
// @CriticalNative
|
||||||
{"nativeReadCallingWorkSourceUid", "(J)I", (void*)android_os_Parcel_readCallingWorkSourceUid},
|
{"nativeReadCallingWorkSourceUid", "(J)I", (void*)android_os_Parcel_readCallingWorkSourceUid},
|
||||||
|
|||||||
@@ -409,10 +409,10 @@ public class NotificationTests extends AndroidTestCase {
|
|||||||
sleepIfYouCan(500);
|
sleepIfYouCan(500);
|
||||||
|
|
||||||
L("Parceling notifications...");
|
L("Parceling notifications...");
|
||||||
// we want to be able to use this test on older OSes that do not have getBlobAshmemSize
|
// we want to be able to use this test on older OSes that do not have getOpenAshmemSize
|
||||||
Method getBlobAshmemSize = null;
|
Method getOpenAshmemSize = null;
|
||||||
try {
|
try {
|
||||||
getBlobAshmemSize = Parcel.class.getMethod("getBlobAshmemSize");
|
getOpenAshmemSize = Parcel.class.getMethod("getOpenAshmemSize");
|
||||||
} catch (NoSuchMethodException ex) {
|
} catch (NoSuchMethodException ex) {
|
||||||
}
|
}
|
||||||
for (int i=0; i<mNotifications.size(); i++) {
|
for (int i=0; i<mNotifications.size(); i++) {
|
||||||
@@ -424,8 +424,8 @@ public class NotificationTests extends AndroidTestCase {
|
|||||||
time = SystemClock.currentThreadTimeMillis() - time;
|
time = SystemClock.currentThreadTimeMillis() - time;
|
||||||
L(" %s: write parcel=%dms size=%d ashmem=%s",
|
L(" %s: write parcel=%dms size=%d ashmem=%s",
|
||||||
summarize(n), time, p.dataPosition(),
|
summarize(n), time, p.dataPosition(),
|
||||||
(getBlobAshmemSize != null)
|
(getOpenAshmemSize != null)
|
||||||
? getBlobAshmemSize.invoke(p)
|
? getOpenAshmemSize.invoke(p)
|
||||||
: "???");
|
: "???");
|
||||||
p.setDataPosition(0);
|
p.setDataPosition(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user