Merge "getBlobAshmemSize -> getOpenAshmemSize"

This commit is contained in:
Steven Moreland
2021-10-14 17:43:16 +00:00
committed by Gerrit Code Review
3 changed files with 11 additions and 11 deletions

View File

@@ -401,7 +401,7 @@ public final class Parcel {
private static final int WRITE_EXCEPTION_STACK_TRACE_THRESHOLD_MS = 1000;
@CriticalNative
private static native long nativeGetBlobAshmemSize(long nativePtr);
private static native long nativeGetOpenAshmemSize(long nativePtr);
public final static Parcelable.Creator<String> STRING_CREATOR
= new Parcelable.Creator<String>() {
@@ -4381,8 +4381,8 @@ public final class Parcel {
/**
* @hide For testing
*/
public long getBlobAshmemSize() {
return nativeGetBlobAshmemSize(mNativePtr);
public long getOpenAshmemSize() {
return nativeGetOpenAshmemSize(mNativePtr);
}
private static String valueTypeToString(int type) {

View File

@@ -740,11 +740,11 @@ static jlong android_os_Parcel_getGlobalAllocCount(JNIEnv* env, jclass clazz)
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);
if (parcel != NULL) {
return parcel->getBlobAshmemSize();
return parcel->getOpenAshmemSize();
}
return 0;
}
@@ -852,7 +852,7 @@ static const JNINativeMethod gParcelMethods[] = {
{"getGlobalAllocCount", "()J", (void*)android_os_Parcel_getGlobalAllocCount},
// @CriticalNative
{"nativeGetBlobAshmemSize", "(J)J", (void*)android_os_Parcel_getBlobAshmemSize},
{"nativeGetOpenAshmemSize", "(J)J", (void*)android_os_Parcel_getOpenAshmemSize},
// @CriticalNative
{"nativeReadCallingWorkSourceUid", "(J)I", (void*)android_os_Parcel_readCallingWorkSourceUid},

View File

@@ -409,10 +409,10 @@ public class NotificationTests extends AndroidTestCase {
sleepIfYouCan(500);
L("Parceling notifications...");
// we want to be able to use this test on older OSes that do not have getBlobAshmemSize
Method getBlobAshmemSize = null;
// we want to be able to use this test on older OSes that do not have getOpenAshmemSize
Method getOpenAshmemSize = null;
try {
getBlobAshmemSize = Parcel.class.getMethod("getBlobAshmemSize");
getOpenAshmemSize = Parcel.class.getMethod("getOpenAshmemSize");
} catch (NoSuchMethodException ex) {
}
for (int i=0; i<mNotifications.size(); i++) {
@@ -424,8 +424,8 @@ public class NotificationTests extends AndroidTestCase {
time = SystemClock.currentThreadTimeMillis() - time;
L(" %s: write parcel=%dms size=%d ashmem=%s",
summarize(n), time, p.dataPosition(),
(getBlobAshmemSize != null)
? getBlobAshmemSize.invoke(p)
(getOpenAshmemSize != null)
? getOpenAshmemSize.invoke(p)
: "???");
p.setDataPosition(0);
}