Merge changes from topic "apr19" into rvc-dev am: b67e70aa40
Change-Id: Id459d6991890200bcb2fe5d1f8ef1db707ad9369
This commit is contained in:
@@ -2301,11 +2301,11 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
priority = parcel.readInt();
|
priority = parcel.readInt();
|
||||||
|
|
||||||
category = parcel.readString();
|
category = parcel.readString8();
|
||||||
|
|
||||||
mGroupKey = parcel.readString();
|
mGroupKey = parcel.readString8();
|
||||||
|
|
||||||
mSortKey = parcel.readString();
|
mSortKey = parcel.readString8();
|
||||||
|
|
||||||
extras = Bundle.setDefusable(parcel.readBundle(), true); // may be null
|
extras = Bundle.setDefusable(parcel.readBundle(), true); // may be null
|
||||||
fixDuplicateExtras();
|
fixDuplicateExtras();
|
||||||
@@ -2329,12 +2329,12 @@ public class Notification implements Parcelable
|
|||||||
color = parcel.readInt();
|
color = parcel.readInt();
|
||||||
|
|
||||||
if (parcel.readInt() != 0) {
|
if (parcel.readInt() != 0) {
|
||||||
mChannelId = parcel.readString();
|
mChannelId = parcel.readString8();
|
||||||
}
|
}
|
||||||
mTimeout = parcel.readLong();
|
mTimeout = parcel.readLong();
|
||||||
|
|
||||||
if (parcel.readInt() != 0) {
|
if (parcel.readInt() != 0) {
|
||||||
mShortcutId = parcel.readString();
|
mShortcutId = parcel.readString8();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parcel.readInt() != 0) {
|
if (parcel.readInt() != 0) {
|
||||||
@@ -2766,11 +2766,11 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
parcel.writeInt(priority);
|
parcel.writeInt(priority);
|
||||||
|
|
||||||
parcel.writeString(category);
|
parcel.writeString8(category);
|
||||||
|
|
||||||
parcel.writeString(mGroupKey);
|
parcel.writeString8(mGroupKey);
|
||||||
|
|
||||||
parcel.writeString(mSortKey);
|
parcel.writeString8(mSortKey);
|
||||||
|
|
||||||
parcel.writeBundle(extras); // null ok
|
parcel.writeBundle(extras); // null ok
|
||||||
|
|
||||||
@@ -2803,7 +2803,7 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
if (mChannelId != null) {
|
if (mChannelId != null) {
|
||||||
parcel.writeInt(1);
|
parcel.writeInt(1);
|
||||||
parcel.writeString(mChannelId);
|
parcel.writeString8(mChannelId);
|
||||||
} else {
|
} else {
|
||||||
parcel.writeInt(0);
|
parcel.writeInt(0);
|
||||||
}
|
}
|
||||||
@@ -2811,7 +2811,7 @@ public class Notification implements Parcelable
|
|||||||
|
|
||||||
if (mShortcutId != null) {
|
if (mShortcutId != null) {
|
||||||
parcel.writeInt(1);
|
parcel.writeInt(1);
|
||||||
parcel.writeString(mShortcutId);
|
parcel.writeString8(mShortcutId);
|
||||||
} else {
|
} else {
|
||||||
parcel.writeInt(0);
|
parcel.writeInt(0);
|
||||||
}
|
}
|
||||||
@@ -8873,7 +8873,7 @@ public class Notification implements Parcelable
|
|||||||
}
|
}
|
||||||
mDesiredHeightResId = in.readInt();
|
mDesiredHeightResId = in.readInt();
|
||||||
if (in.readInt() != 0) {
|
if (in.readInt() != 0) {
|
||||||
mShortcutId = in.readString();
|
mShortcutId = in.readString8();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9029,7 +9029,7 @@ public class Notification implements Parcelable
|
|||||||
out.writeInt(mDesiredHeightResId);
|
out.writeInt(mDesiredHeightResId);
|
||||||
out.writeInt(TextUtils.isEmpty(mShortcutId) ? 0 : 1);
|
out.writeInt(TextUtils.isEmpty(mShortcutId) ? 0 : 1);
|
||||||
if (!TextUtils.isEmpty(mShortcutId)) {
|
if (!TextUtils.isEmpty(mShortcutId)) {
|
||||||
out.writeString(mShortcutId);
|
out.writeString8(mShortcutId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1206,7 +1206,7 @@ public class ClipData implements Parcelable {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dest.writeInt(PARCEL_TYPE_STRING);
|
dest.writeInt(PARCEL_TYPE_STRING);
|
||||||
dest.writeString(text);
|
dest.writeString8(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1215,7 +1215,7 @@ public class ClipData implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private static String readHtmlTextFromParcel(Parcel in) {
|
private static String readHtmlTextFromParcel(Parcel in) {
|
||||||
if (in.readInt() == PARCEL_TYPE_STRING) {
|
if (in.readInt() == PARCEL_TYPE_STRING) {
|
||||||
return in.readString();
|
return in.readString8();
|
||||||
}
|
}
|
||||||
ParcelFileDescriptor pfd =
|
ParcelFileDescriptor pfd =
|
||||||
in.readParcelable(ParcelFileDescriptor.class.getClassLoader());
|
in.readParcelable(ParcelFileDescriptor.class.getClassLoader());
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ public class ContentProviderOperation implements Parcelable {
|
|||||||
private ContentProviderOperation(Parcel source) {
|
private ContentProviderOperation(Parcel source) {
|
||||||
mType = source.readInt();
|
mType = source.readInt();
|
||||||
mUri = Uri.CREATOR.createFromParcel(source);
|
mUri = Uri.CREATOR.createFromParcel(source);
|
||||||
mMethod = source.readInt() != 0 ? source.readString() : null;
|
mMethod = source.readInt() != 0 ? source.readString8() : null;
|
||||||
mArg = source.readInt() != 0 ? source.readString() : null;
|
mArg = source.readInt() != 0 ? source.readString8() : null;
|
||||||
final int valuesSize = source.readInt();
|
final int valuesSize = source.readInt();
|
||||||
if (valuesSize != -1) {
|
if (valuesSize != -1) {
|
||||||
mValues = new ArrayMap<>(valuesSize);
|
mValues = new ArrayMap<>(valuesSize);
|
||||||
@@ -107,7 +107,7 @@ public class ContentProviderOperation implements Parcelable {
|
|||||||
} else {
|
} else {
|
||||||
mExtras = null;
|
mExtras = null;
|
||||||
}
|
}
|
||||||
mSelection = source.readInt() != 0 ? source.readString() : null;
|
mSelection = source.readInt() != 0 ? source.readString8() : null;
|
||||||
mSelectionArgs = source.readSparseArray(null);
|
mSelectionArgs = source.readSparseArray(null);
|
||||||
mExpectedCount = source.readInt() != 0 ? source.readInt() : null;
|
mExpectedCount = source.readInt() != 0 ? source.readInt() : null;
|
||||||
mYieldAllowed = source.readInt() != 0;
|
mYieldAllowed = source.readInt() != 0;
|
||||||
@@ -135,13 +135,13 @@ public class ContentProviderOperation implements Parcelable {
|
|||||||
Uri.writeToParcel(dest, mUri);
|
Uri.writeToParcel(dest, mUri);
|
||||||
if (mMethod != null) {
|
if (mMethod != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
dest.writeString(mMethod);
|
dest.writeString8(mMethod);
|
||||||
} else {
|
} else {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
if (mArg != null) {
|
if (mArg != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
dest.writeString(mArg);
|
dest.writeString8(mArg);
|
||||||
} else {
|
} else {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ public class ContentProviderOperation implements Parcelable {
|
|||||||
}
|
}
|
||||||
if (mSelection != null) {
|
if (mSelection != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
dest.writeString(mSelection);
|
dest.writeString8(mSelection);
|
||||||
} else {
|
} else {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
@@ -591,7 +591,7 @@ public class ContentProviderOperation implements Parcelable {
|
|||||||
public BackReference(Parcel src) {
|
public BackReference(Parcel src) {
|
||||||
this.fromIndex = src.readInt();
|
this.fromIndex = src.readInt();
|
||||||
if (src.readInt() != 0) {
|
if (src.readInt() != 0) {
|
||||||
this.fromKey = src.readString();
|
this.fromKey = src.readString8();
|
||||||
} else {
|
} else {
|
||||||
this.fromKey = null;
|
this.fromKey = null;
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,7 @@ public class ContentProviderOperation implements Parcelable {
|
|||||||
dest.writeInt(fromIndex);
|
dest.writeInt(fromIndex);
|
||||||
if (fromKey != null) {
|
if (fromKey != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
dest.writeString(fromKey);
|
dest.writeString8(fromKey);
|
||||||
} else {
|
} else {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -888,8 +888,8 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
|
|
||||||
public ShortcutIconResource createFromParcel(Parcel source) {
|
public ShortcutIconResource createFromParcel(Parcel source) {
|
||||||
ShortcutIconResource icon = new ShortcutIconResource();
|
ShortcutIconResource icon = new ShortcutIconResource();
|
||||||
icon.packageName = source.readString();
|
icon.packageName = source.readString8();
|
||||||
icon.resourceName = source.readString();
|
icon.resourceName = source.readString8();
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -906,8 +906,8 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
dest.writeString(packageName);
|
dest.writeString8(packageName);
|
||||||
dest.writeString(resourceName);
|
dest.writeString8(resourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -10807,12 +10807,12 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writeToParcel(Parcel out, int flags) {
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
out.writeString(mAction);
|
out.writeString8(mAction);
|
||||||
Uri.writeToParcel(out, mData);
|
Uri.writeToParcel(out, mData);
|
||||||
out.writeString(mType);
|
out.writeString8(mType);
|
||||||
out.writeString(mIdentifier);
|
out.writeString8(mIdentifier);
|
||||||
out.writeInt(mFlags);
|
out.writeInt(mFlags);
|
||||||
out.writeString(mPackage);
|
out.writeString8(mPackage);
|
||||||
ComponentName.writeToParcel(mComponent, out);
|
ComponentName.writeToParcel(mComponent, out);
|
||||||
|
|
||||||
if (mSourceBounds != null) {
|
if (mSourceBounds != null) {
|
||||||
@@ -10826,7 +10826,7 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
final int N = mCategories.size();
|
final int N = mCategories.size();
|
||||||
out.writeInt(N);
|
out.writeInt(N);
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
out.writeString(mCategories.valueAt(i));
|
out.writeString8(mCategories.valueAt(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
out.writeInt(0);
|
out.writeInt(0);
|
||||||
@@ -10865,12 +10865,12 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void readFromParcel(Parcel in) {
|
public void readFromParcel(Parcel in) {
|
||||||
setAction(in.readString());
|
setAction(in.readString8());
|
||||||
mData = Uri.CREATOR.createFromParcel(in);
|
mData = Uri.CREATOR.createFromParcel(in);
|
||||||
mType = in.readString();
|
mType = in.readString8();
|
||||||
mIdentifier = in.readString();
|
mIdentifier = in.readString8();
|
||||||
mFlags = in.readInt();
|
mFlags = in.readInt();
|
||||||
mPackage = in.readString();
|
mPackage = in.readString8();
|
||||||
mComponent = ComponentName.readFromParcel(in);
|
mComponent = ComponentName.readFromParcel(in);
|
||||||
|
|
||||||
if (in.readInt() != 0) {
|
if (in.readInt() != 0) {
|
||||||
@@ -10882,7 +10882,7 @@ public class Intent implements Parcelable, Cloneable {
|
|||||||
mCategories = new ArraySet<String>();
|
mCategories = new ArraySet<String>();
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<N; i++) {
|
for (i=0; i<N; i++) {
|
||||||
mCategories.add(in.readString().intern());
|
mCategories.add(in.readString8().intern());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mCategories = null;
|
mCategories = null;
|
||||||
|
|||||||
@@ -1206,17 +1206,17 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
|||||||
dest.writeInt(theme);
|
dest.writeInt(theme);
|
||||||
dest.writeInt(launchMode);
|
dest.writeInt(launchMode);
|
||||||
dest.writeInt(documentLaunchMode);
|
dest.writeInt(documentLaunchMode);
|
||||||
dest.writeString(permission);
|
dest.writeString8(permission);
|
||||||
dest.writeString(taskAffinity);
|
dest.writeString8(taskAffinity);
|
||||||
dest.writeString(targetActivity);
|
dest.writeString8(targetActivity);
|
||||||
dest.writeString(launchToken);
|
dest.writeString8(launchToken);
|
||||||
dest.writeInt(flags);
|
dest.writeInt(flags);
|
||||||
dest.writeInt(privateFlags);
|
dest.writeInt(privateFlags);
|
||||||
dest.writeInt(screenOrientation);
|
dest.writeInt(screenOrientation);
|
||||||
dest.writeInt(configChanges);
|
dest.writeInt(configChanges);
|
||||||
dest.writeInt(softInputMode);
|
dest.writeInt(softInputMode);
|
||||||
dest.writeInt(uiOptions);
|
dest.writeInt(uiOptions);
|
||||||
dest.writeString(parentActivityName);
|
dest.writeString8(parentActivityName);
|
||||||
dest.writeInt(persistableMode);
|
dest.writeInt(persistableMode);
|
||||||
dest.writeInt(maxRecents);
|
dest.writeInt(maxRecents);
|
||||||
dest.writeInt(lockTaskLaunchMode);
|
dest.writeInt(lockTaskLaunchMode);
|
||||||
@@ -1227,7 +1227,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
|||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
dest.writeInt(resizeMode);
|
dest.writeInt(resizeMode);
|
||||||
dest.writeString(requestedVrComponent);
|
dest.writeString8(requestedVrComponent);
|
||||||
dest.writeInt(rotationAnimation);
|
dest.writeInt(rotationAnimation);
|
||||||
dest.writeInt(colorMode);
|
dest.writeInt(colorMode);
|
||||||
dest.writeFloat(maxAspectRatio);
|
dest.writeFloat(maxAspectRatio);
|
||||||
@@ -1327,17 +1327,17 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
|||||||
theme = source.readInt();
|
theme = source.readInt();
|
||||||
launchMode = source.readInt();
|
launchMode = source.readInt();
|
||||||
documentLaunchMode = source.readInt();
|
documentLaunchMode = source.readInt();
|
||||||
permission = source.readString();
|
permission = source.readString8();
|
||||||
taskAffinity = source.readString();
|
taskAffinity = source.readString8();
|
||||||
targetActivity = source.readString();
|
targetActivity = source.readString8();
|
||||||
launchToken = source.readString();
|
launchToken = source.readString8();
|
||||||
flags = source.readInt();
|
flags = source.readInt();
|
||||||
privateFlags = source.readInt();
|
privateFlags = source.readInt();
|
||||||
screenOrientation = source.readInt();
|
screenOrientation = source.readInt();
|
||||||
configChanges = source.readInt();
|
configChanges = source.readInt();
|
||||||
softInputMode = source.readInt();
|
softInputMode = source.readInt();
|
||||||
uiOptions = source.readInt();
|
uiOptions = source.readInt();
|
||||||
parentActivityName = source.readString();
|
parentActivityName = source.readString8();
|
||||||
persistableMode = source.readInt();
|
persistableMode = source.readInt();
|
||||||
maxRecents = source.readInt();
|
maxRecents = source.readInt();
|
||||||
lockTaskLaunchMode = source.readInt();
|
lockTaskLaunchMode = source.readInt();
|
||||||
@@ -1345,7 +1345,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
|||||||
windowLayout = new WindowLayout(source);
|
windowLayout = new WindowLayout(source);
|
||||||
}
|
}
|
||||||
resizeMode = source.readInt();
|
resizeMode = source.readInt();
|
||||||
requestedVrComponent = source.readString();
|
requestedVrComponent = source.readString8();
|
||||||
rotationAnimation = source.readInt();
|
rotationAnimation = source.readInt();
|
||||||
colorMode = source.readInt();
|
colorMode = source.readInt();
|
||||||
maxAspectRatio = source.readFloat();
|
maxAspectRatio = source.readFloat();
|
||||||
@@ -1386,7 +1386,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
|||||||
gravity = source.readInt();
|
gravity = source.readInt();
|
||||||
minWidth = source.readInt();
|
minWidth = source.readInt();
|
||||||
minHeight = source.readInt();
|
minHeight = source.readInt();
|
||||||
windowLayoutAffinity = source.readString();
|
windowLayoutAffinity = source.readString8();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1476,7 +1476,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
|||||||
dest.writeInt(gravity);
|
dest.writeInt(gravity);
|
||||||
dest.writeInt(minWidth);
|
dest.writeInt(minWidth);
|
||||||
dest.writeInt(minHeight);
|
dest.writeInt(minHeight);
|
||||||
dest.writeString(windowLayoutAffinity);
|
dest.writeString8(windowLayoutAffinity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1704,10 +1704,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super.writeToParcel(dest, parcelableFlags);
|
super.writeToParcel(dest, parcelableFlags);
|
||||||
dest.writeString(taskAffinity);
|
dest.writeString8(taskAffinity);
|
||||||
dest.writeString(permission);
|
dest.writeString8(permission);
|
||||||
dest.writeString(processName);
|
dest.writeString8(processName);
|
||||||
dest.writeString(className);
|
dest.writeString8(className);
|
||||||
dest.writeInt(theme);
|
dest.writeInt(theme);
|
||||||
dest.writeInt(flags);
|
dest.writeInt(flags);
|
||||||
dest.writeInt(privateFlags);
|
dest.writeInt(privateFlags);
|
||||||
@@ -1721,28 +1721,28 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
} else {
|
} else {
|
||||||
dest.writeInt(0);
|
dest.writeInt(0);
|
||||||
}
|
}
|
||||||
dest.writeString(scanSourceDir);
|
dest.writeString8(scanSourceDir);
|
||||||
dest.writeString(scanPublicSourceDir);
|
dest.writeString8(scanPublicSourceDir);
|
||||||
dest.writeString(sourceDir);
|
dest.writeString8(sourceDir);
|
||||||
dest.writeString(publicSourceDir);
|
dest.writeString8(publicSourceDir);
|
||||||
dest.writeStringArray(splitNames);
|
dest.writeStringArray(splitNames);
|
||||||
dest.writeStringArray(splitSourceDirs);
|
dest.writeStringArray(splitSourceDirs);
|
||||||
dest.writeStringArray(splitPublicSourceDirs);
|
dest.writeStringArray(splitPublicSourceDirs);
|
||||||
dest.writeSparseArray((SparseArray) splitDependencies);
|
dest.writeSparseArray((SparseArray) splitDependencies);
|
||||||
dest.writeString(nativeLibraryDir);
|
dest.writeString8(nativeLibraryDir);
|
||||||
dest.writeString(secondaryNativeLibraryDir);
|
dest.writeString8(secondaryNativeLibraryDir);
|
||||||
dest.writeString(nativeLibraryRootDir);
|
dest.writeString8(nativeLibraryRootDir);
|
||||||
dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0);
|
dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0);
|
||||||
dest.writeString(primaryCpuAbi);
|
dest.writeString8(primaryCpuAbi);
|
||||||
dest.writeString(secondaryCpuAbi);
|
dest.writeString8(secondaryCpuAbi);
|
||||||
dest.writeStringArray(resourceDirs);
|
dest.writeStringArray(resourceDirs);
|
||||||
dest.writeString(seInfo);
|
dest.writeString8(seInfo);
|
||||||
dest.writeString(seInfoUser);
|
dest.writeString8(seInfoUser);
|
||||||
dest.writeStringArray(sharedLibraryFiles);
|
dest.writeStringArray(sharedLibraryFiles);
|
||||||
dest.writeTypedList(sharedLibraryInfos);
|
dest.writeTypedList(sharedLibraryInfos);
|
||||||
dest.writeString(dataDir);
|
dest.writeString8(dataDir);
|
||||||
dest.writeString(deviceProtectedDataDir);
|
dest.writeString8(deviceProtectedDataDir);
|
||||||
dest.writeString(credentialProtectedDataDir);
|
dest.writeString8(credentialProtectedDataDir);
|
||||||
dest.writeInt(uid);
|
dest.writeInt(uid);
|
||||||
dest.writeInt(minSdkVersion);
|
dest.writeInt(minSdkVersion);
|
||||||
dest.writeInt(targetSdkVersion);
|
dest.writeInt(targetSdkVersion);
|
||||||
@@ -1750,8 +1750,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
dest.writeInt(enabled ? 1 : 0);
|
dest.writeInt(enabled ? 1 : 0);
|
||||||
dest.writeInt(enabledSetting);
|
dest.writeInt(enabledSetting);
|
||||||
dest.writeInt(installLocation);
|
dest.writeInt(installLocation);
|
||||||
dest.writeString(manageSpaceActivityName);
|
dest.writeString8(manageSpaceActivityName);
|
||||||
dest.writeString(backupAgentName);
|
dest.writeString8(backupAgentName);
|
||||||
dest.writeInt(descriptionRes);
|
dest.writeInt(descriptionRes);
|
||||||
dest.writeInt(uiOptions);
|
dest.writeInt(uiOptions);
|
||||||
dest.writeInt(fullBackupContent);
|
dest.writeInt(fullBackupContent);
|
||||||
@@ -1759,16 +1759,16 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
dest.writeInt(networkSecurityConfigRes);
|
dest.writeInt(networkSecurityConfigRes);
|
||||||
dest.writeInt(category);
|
dest.writeInt(category);
|
||||||
dest.writeInt(targetSandboxVersion);
|
dest.writeInt(targetSandboxVersion);
|
||||||
dest.writeString(classLoaderName);
|
dest.writeString8(classLoaderName);
|
||||||
dest.writeStringArray(splitClassLoaderNames);
|
dest.writeStringArray(splitClassLoaderNames);
|
||||||
dest.writeInt(compileSdkVersion);
|
dest.writeInt(compileSdkVersion);
|
||||||
dest.writeString(compileSdkVersionCodename);
|
dest.writeString8(compileSdkVersionCodename);
|
||||||
dest.writeString(appComponentFactory);
|
dest.writeString8(appComponentFactory);
|
||||||
dest.writeInt(iconRes);
|
dest.writeInt(iconRes);
|
||||||
dest.writeInt(roundIconRes);
|
dest.writeInt(roundIconRes);
|
||||||
dest.writeInt(mHiddenApiPolicy);
|
dest.writeInt(mHiddenApiPolicy);
|
||||||
dest.writeInt(hiddenUntilInstalled ? 1 : 0);
|
dest.writeInt(hiddenUntilInstalled ? 1 : 0);
|
||||||
dest.writeString(zygotePreloadName);
|
dest.writeString8(zygotePreloadName);
|
||||||
dest.writeInt(gwpAsanMode);
|
dest.writeInt(gwpAsanMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1788,10 +1788,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private ApplicationInfo(Parcel source) {
|
private ApplicationInfo(Parcel source) {
|
||||||
super(source);
|
super(source);
|
||||||
taskAffinity = source.readString();
|
taskAffinity = source.readString8();
|
||||||
permission = source.readString();
|
permission = source.readString8();
|
||||||
processName = source.readString();
|
processName = source.readString8();
|
||||||
className = source.readString();
|
className = source.readString8();
|
||||||
theme = source.readInt();
|
theme = source.readInt();
|
||||||
flags = source.readInt();
|
flags = source.readInt();
|
||||||
privateFlags = source.readInt();
|
privateFlags = source.readInt();
|
||||||
@@ -1802,28 +1802,28 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
storageUuid = new UUID(source.readLong(), source.readLong());
|
storageUuid = new UUID(source.readLong(), source.readLong());
|
||||||
volumeUuid = StorageManager.convert(storageUuid);
|
volumeUuid = StorageManager.convert(storageUuid);
|
||||||
}
|
}
|
||||||
scanSourceDir = source.readString();
|
scanSourceDir = source.readString8();
|
||||||
scanPublicSourceDir = source.readString();
|
scanPublicSourceDir = source.readString8();
|
||||||
sourceDir = source.readString();
|
sourceDir = source.readString8();
|
||||||
publicSourceDir = source.readString();
|
publicSourceDir = source.readString8();
|
||||||
splitNames = source.readStringArray();
|
splitNames = source.readStringArray();
|
||||||
splitSourceDirs = source.readStringArray();
|
splitSourceDirs = source.readStringArray();
|
||||||
splitPublicSourceDirs = source.readStringArray();
|
splitPublicSourceDirs = source.readStringArray();
|
||||||
splitDependencies = source.readSparseArray(null);
|
splitDependencies = source.readSparseArray(null);
|
||||||
nativeLibraryDir = source.readString();
|
nativeLibraryDir = source.readString8();
|
||||||
secondaryNativeLibraryDir = source.readString();
|
secondaryNativeLibraryDir = source.readString8();
|
||||||
nativeLibraryRootDir = source.readString();
|
nativeLibraryRootDir = source.readString8();
|
||||||
nativeLibraryRootRequiresIsa = source.readInt() != 0;
|
nativeLibraryRootRequiresIsa = source.readInt() != 0;
|
||||||
primaryCpuAbi = source.readString();
|
primaryCpuAbi = source.readString8();
|
||||||
secondaryCpuAbi = source.readString();
|
secondaryCpuAbi = source.readString8();
|
||||||
resourceDirs = source.readStringArray();
|
resourceDirs = source.readStringArray();
|
||||||
seInfo = source.readString();
|
seInfo = source.readString8();
|
||||||
seInfoUser = source.readString();
|
seInfoUser = source.readString8();
|
||||||
sharedLibraryFiles = source.readStringArray();
|
sharedLibraryFiles = source.readStringArray();
|
||||||
sharedLibraryInfos = source.createTypedArrayList(SharedLibraryInfo.CREATOR);
|
sharedLibraryInfos = source.createTypedArrayList(SharedLibraryInfo.CREATOR);
|
||||||
dataDir = source.readString();
|
dataDir = source.readString8();
|
||||||
deviceProtectedDataDir = source.readString();
|
deviceProtectedDataDir = source.readString8();
|
||||||
credentialProtectedDataDir = source.readString();
|
credentialProtectedDataDir = source.readString8();
|
||||||
uid = source.readInt();
|
uid = source.readInt();
|
||||||
minSdkVersion = source.readInt();
|
minSdkVersion = source.readInt();
|
||||||
targetSdkVersion = source.readInt();
|
targetSdkVersion = source.readInt();
|
||||||
@@ -1831,8 +1831,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
enabled = source.readInt() != 0;
|
enabled = source.readInt() != 0;
|
||||||
enabledSetting = source.readInt();
|
enabledSetting = source.readInt();
|
||||||
installLocation = source.readInt();
|
installLocation = source.readInt();
|
||||||
manageSpaceActivityName = source.readString();
|
manageSpaceActivityName = source.readString8();
|
||||||
backupAgentName = source.readString();
|
backupAgentName = source.readString8();
|
||||||
descriptionRes = source.readInt();
|
descriptionRes = source.readInt();
|
||||||
uiOptions = source.readInt();
|
uiOptions = source.readInt();
|
||||||
fullBackupContent = source.readInt();
|
fullBackupContent = source.readInt();
|
||||||
@@ -1840,16 +1840,16 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
networkSecurityConfigRes = source.readInt();
|
networkSecurityConfigRes = source.readInt();
|
||||||
category = source.readInt();
|
category = source.readInt();
|
||||||
targetSandboxVersion = source.readInt();
|
targetSandboxVersion = source.readInt();
|
||||||
classLoaderName = source.readString();
|
classLoaderName = source.readString8();
|
||||||
splitClassLoaderNames = source.readStringArray();
|
splitClassLoaderNames = source.readStringArray();
|
||||||
compileSdkVersion = source.readInt();
|
compileSdkVersion = source.readInt();
|
||||||
compileSdkVersionCodename = source.readString();
|
compileSdkVersionCodename = source.readString8();
|
||||||
appComponentFactory = source.readString();
|
appComponentFactory = source.readString8();
|
||||||
iconRes = source.readInt();
|
iconRes = source.readInt();
|
||||||
roundIconRes = source.readInt();
|
roundIconRes = source.readInt();
|
||||||
mHiddenApiPolicy = source.readInt();
|
mHiddenApiPolicy = source.readInt();
|
||||||
hiddenUntilInstalled = source.readInt() != 0;
|
hiddenUntilInstalled = source.readInt() != 0;
|
||||||
zygotePreloadName = source.readString();
|
zygotePreloadName = source.readString8();
|
||||||
gwpAsanMode = source.readInt();
|
gwpAsanMode = source.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,8 +197,8 @@ public class ComponentInfo extends PackageItemInfo {
|
|||||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||||
super.writeToParcel(dest, parcelableFlags);
|
super.writeToParcel(dest, parcelableFlags);
|
||||||
applicationInfo.writeToParcel(dest, parcelableFlags);
|
applicationInfo.writeToParcel(dest, parcelableFlags);
|
||||||
dest.writeString(processName);
|
dest.writeString8(processName);
|
||||||
dest.writeString(splitName);
|
dest.writeString8(splitName);
|
||||||
dest.writeInt(descriptionRes);
|
dest.writeInt(descriptionRes);
|
||||||
dest.writeInt(enabled ? 1 : 0);
|
dest.writeInt(enabled ? 1 : 0);
|
||||||
dest.writeInt(exported ? 1 : 0);
|
dest.writeInt(exported ? 1 : 0);
|
||||||
@@ -208,8 +208,8 @@ public class ComponentInfo extends PackageItemInfo {
|
|||||||
protected ComponentInfo(Parcel source) {
|
protected ComponentInfo(Parcel source) {
|
||||||
super(source);
|
super(source);
|
||||||
applicationInfo = ApplicationInfo.CREATOR.createFromParcel(source);
|
applicationInfo = ApplicationInfo.CREATOR.createFromParcel(source);
|
||||||
processName = source.readString();
|
processName = source.readString8();
|
||||||
splitName = source.readString();
|
splitName = source.readString8();
|
||||||
descriptionRes = source.readInt();
|
descriptionRes = source.readInt();
|
||||||
enabled = (source.readInt() != 0);
|
enabled = (source.readInt() != 0);
|
||||||
exported = (source.readInt() != 0);
|
exported = (source.readInt() != 0);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class FeatureInfo implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||||
dest.writeString(name);
|
dest.writeString8(name);
|
||||||
dest.writeInt(version);
|
dest.writeInt(version);
|
||||||
dest.writeInt(reqGlEsVersion);
|
dest.writeInt(reqGlEsVersion);
|
||||||
dest.writeInt(flags);
|
dest.writeInt(flags);
|
||||||
@@ -138,7 +138,7 @@ public class FeatureInfo implements Parcelable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private FeatureInfo(Parcel source) {
|
private FeatureInfo(Parcel source) {
|
||||||
name = source.readString();
|
name = source.readString8();
|
||||||
version = source.readInt();
|
version = source.readInt();
|
||||||
reqGlEsVersion = source.readInt();
|
reqGlEsVersion = source.readInt();
|
||||||
flags = source.readInt();
|
flags = source.readInt();
|
||||||
|
|||||||
@@ -157,21 +157,21 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
|
|
||||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||||
super.writeToParcel(dest, parcelableFlags);
|
super.writeToParcel(dest, parcelableFlags);
|
||||||
dest.writeString(targetPackage);
|
dest.writeString8(targetPackage);
|
||||||
dest.writeString(targetProcesses);
|
dest.writeString8(targetProcesses);
|
||||||
dest.writeString(sourceDir);
|
dest.writeString8(sourceDir);
|
||||||
dest.writeString(publicSourceDir);
|
dest.writeString8(publicSourceDir);
|
||||||
dest.writeStringArray(splitNames);
|
dest.writeStringArray(splitNames);
|
||||||
dest.writeStringArray(splitSourceDirs);
|
dest.writeStringArray(splitSourceDirs);
|
||||||
dest.writeStringArray(splitPublicSourceDirs);
|
dest.writeStringArray(splitPublicSourceDirs);
|
||||||
dest.writeSparseArray((SparseArray) splitDependencies);
|
dest.writeSparseArray((SparseArray) splitDependencies);
|
||||||
dest.writeString(dataDir);
|
dest.writeString8(dataDir);
|
||||||
dest.writeString(deviceProtectedDataDir);
|
dest.writeString8(deviceProtectedDataDir);
|
||||||
dest.writeString(credentialProtectedDataDir);
|
dest.writeString8(credentialProtectedDataDir);
|
||||||
dest.writeString(primaryCpuAbi);
|
dest.writeString8(primaryCpuAbi);
|
||||||
dest.writeString(secondaryCpuAbi);
|
dest.writeString8(secondaryCpuAbi);
|
||||||
dest.writeString(nativeLibraryDir);
|
dest.writeString8(nativeLibraryDir);
|
||||||
dest.writeString(secondaryNativeLibraryDir);
|
dest.writeString8(secondaryNativeLibraryDir);
|
||||||
dest.writeInt((handleProfiling == false) ? 0 : 1);
|
dest.writeInt((handleProfiling == false) ? 0 : 1);
|
||||||
dest.writeInt((functionalTest == false) ? 0 : 1);
|
dest.writeInt((functionalTest == false) ? 0 : 1);
|
||||||
}
|
}
|
||||||
@@ -189,21 +189,21 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private InstrumentationInfo(Parcel source) {
|
private InstrumentationInfo(Parcel source) {
|
||||||
super(source);
|
super(source);
|
||||||
targetPackage = source.readString();
|
targetPackage = source.readString8();
|
||||||
targetProcesses = source.readString();
|
targetProcesses = source.readString8();
|
||||||
sourceDir = source.readString();
|
sourceDir = source.readString8();
|
||||||
publicSourceDir = source.readString();
|
publicSourceDir = source.readString8();
|
||||||
splitNames = source.readStringArray();
|
splitNames = source.readStringArray();
|
||||||
splitSourceDirs = source.readStringArray();
|
splitSourceDirs = source.readStringArray();
|
||||||
splitPublicSourceDirs = source.readStringArray();
|
splitPublicSourceDirs = source.readStringArray();
|
||||||
splitDependencies = source.readSparseArray(null);
|
splitDependencies = source.readSparseArray(null);
|
||||||
dataDir = source.readString();
|
dataDir = source.readString8();
|
||||||
deviceProtectedDataDir = source.readString();
|
deviceProtectedDataDir = source.readString8();
|
||||||
credentialProtectedDataDir = source.readString();
|
credentialProtectedDataDir = source.readString8();
|
||||||
primaryCpuAbi = source.readString();
|
primaryCpuAbi = source.readString8();
|
||||||
secondaryCpuAbi = source.readString();
|
secondaryCpuAbi = source.readString8();
|
||||||
nativeLibraryDir = source.readString();
|
nativeLibraryDir = source.readString8();
|
||||||
secondaryNativeLibraryDir = source.readString();
|
secondaryNativeLibraryDir = source.readString8();
|
||||||
handleProfiling = source.readInt() != 0;
|
handleProfiling = source.readInt() != 0;
|
||||||
functionalTest = source.readInt() != 0;
|
functionalTest = source.readInt() != 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -441,14 +441,14 @@ public class PackageInfo implements Parcelable {
|
|||||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||||
// Allow ApplicationInfo to be squashed.
|
// Allow ApplicationInfo to be squashed.
|
||||||
final boolean prevAllowSquashing = dest.allowSquashing();
|
final boolean prevAllowSquashing = dest.allowSquashing();
|
||||||
dest.writeString(packageName);
|
dest.writeString8(packageName);
|
||||||
dest.writeStringArray(splitNames);
|
dest.writeStringArray(splitNames);
|
||||||
dest.writeInt(versionCode);
|
dest.writeInt(versionCode);
|
||||||
dest.writeInt(versionCodeMajor);
|
dest.writeInt(versionCodeMajor);
|
||||||
dest.writeString(versionName);
|
dest.writeString8(versionName);
|
||||||
dest.writeInt(baseRevisionCode);
|
dest.writeInt(baseRevisionCode);
|
||||||
dest.writeIntArray(splitRevisionCodes);
|
dest.writeIntArray(splitRevisionCodes);
|
||||||
dest.writeString(sharedUserId);
|
dest.writeString8(sharedUserId);
|
||||||
dest.writeInt(sharedUserLabel);
|
dest.writeInt(sharedUserLabel);
|
||||||
if (applicationInfo != null) {
|
if (applicationInfo != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
@@ -475,14 +475,14 @@ public class PackageInfo implements Parcelable {
|
|||||||
dest.writeInt(isStub ? 1 : 0);
|
dest.writeInt(isStub ? 1 : 0);
|
||||||
dest.writeInt(coreApp ? 1 : 0);
|
dest.writeInt(coreApp ? 1 : 0);
|
||||||
dest.writeInt(requiredForAllUsers ? 1 : 0);
|
dest.writeInt(requiredForAllUsers ? 1 : 0);
|
||||||
dest.writeString(restrictedAccountType);
|
dest.writeString8(restrictedAccountType);
|
||||||
dest.writeString(requiredAccountType);
|
dest.writeString8(requiredAccountType);
|
||||||
dest.writeString(overlayTarget);
|
dest.writeString8(overlayTarget);
|
||||||
dest.writeString(overlayCategory);
|
dest.writeString8(overlayCategory);
|
||||||
dest.writeInt(overlayPriority);
|
dest.writeInt(overlayPriority);
|
||||||
dest.writeBoolean(mOverlayIsStatic);
|
dest.writeBoolean(mOverlayIsStatic);
|
||||||
dest.writeInt(compileSdkVersion);
|
dest.writeInt(compileSdkVersion);
|
||||||
dest.writeString(compileSdkVersionCodename);
|
dest.writeString8(compileSdkVersionCodename);
|
||||||
if (signingInfo != null) {
|
if (signingInfo != null) {
|
||||||
dest.writeInt(1);
|
dest.writeInt(1);
|
||||||
signingInfo.writeToParcel(dest, parcelableFlags);
|
signingInfo.writeToParcel(dest, parcelableFlags);
|
||||||
@@ -508,14 +508,14 @@ public class PackageInfo implements Parcelable {
|
|||||||
|
|
||||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||||
private PackageInfo(Parcel source) {
|
private PackageInfo(Parcel source) {
|
||||||
packageName = source.readString();
|
packageName = source.readString8();
|
||||||
splitNames = source.createStringArray();
|
splitNames = source.createStringArray();
|
||||||
versionCode = source.readInt();
|
versionCode = source.readInt();
|
||||||
versionCodeMajor = source.readInt();
|
versionCodeMajor = source.readInt();
|
||||||
versionName = source.readString();
|
versionName = source.readString8();
|
||||||
baseRevisionCode = source.readInt();
|
baseRevisionCode = source.readInt();
|
||||||
splitRevisionCodes = source.createIntArray();
|
splitRevisionCodes = source.createIntArray();
|
||||||
sharedUserId = source.readString();
|
sharedUserId = source.readString8();
|
||||||
sharedUserLabel = source.readInt();
|
sharedUserLabel = source.readInt();
|
||||||
int hasApp = source.readInt();
|
int hasApp = source.readInt();
|
||||||
if (hasApp != 0) {
|
if (hasApp != 0) {
|
||||||
@@ -540,14 +540,14 @@ public class PackageInfo implements Parcelable {
|
|||||||
isStub = source.readInt() != 0;
|
isStub = source.readInt() != 0;
|
||||||
coreApp = source.readInt() != 0;
|
coreApp = source.readInt() != 0;
|
||||||
requiredForAllUsers = source.readInt() != 0;
|
requiredForAllUsers = source.readInt() != 0;
|
||||||
restrictedAccountType = source.readString();
|
restrictedAccountType = source.readString8();
|
||||||
requiredAccountType = source.readString();
|
requiredAccountType = source.readString8();
|
||||||
overlayTarget = source.readString();
|
overlayTarget = source.readString8();
|
||||||
overlayCategory = source.readString();
|
overlayCategory = source.readString8();
|
||||||
overlayPriority = source.readInt();
|
overlayPriority = source.readInt();
|
||||||
mOverlayIsStatic = source.readBoolean();
|
mOverlayIsStatic = source.readBoolean();
|
||||||
compileSdkVersion = source.readInt();
|
compileSdkVersion = source.readInt();
|
||||||
compileSdkVersionCodename = source.readString();
|
compileSdkVersionCodename = source.readString8();
|
||||||
int hasSigningInfo = source.readInt();
|
int hasSigningInfo = source.readInt();
|
||||||
if (hasSigningInfo != 0) {
|
if (hasSigningInfo != 0) {
|
||||||
signingInfo = SigningInfo.CREATOR.createFromParcel(source);
|
signingInfo = SigningInfo.CREATOR.createFromParcel(source);
|
||||||
|
|||||||
@@ -422,8 +422,8 @@ public class PackageItemInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||||
dest.writeString(name);
|
dest.writeString8(name);
|
||||||
dest.writeString(packageName);
|
dest.writeString8(packageName);
|
||||||
dest.writeInt(labelRes);
|
dest.writeInt(labelRes);
|
||||||
TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
|
TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
|
||||||
dest.writeInt(icon);
|
dest.writeInt(icon);
|
||||||
@@ -452,8 +452,8 @@ public class PackageItemInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected PackageItemInfo(Parcel source) {
|
protected PackageItemInfo(Parcel source) {
|
||||||
name = source.readString();
|
name = source.readString8();
|
||||||
packageName = source.readString();
|
packageName = source.readString8();
|
||||||
labelRes = source.readInt();
|
labelRes = source.readInt();
|
||||||
nonLocalizedLabel
|
nonLocalizedLabel
|
||||||
= TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
|
= TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
|
||||||
|
|||||||
@@ -78,10 +78,19 @@ public class PackageParserCacheHelper {
|
|||||||
/**
|
/**
|
||||||
* Read an string index from a parcel, and returns the corresponding string from the pool.
|
* Read an string index from a parcel, and returns the corresponding string from the pool.
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public String readString(Parcel p) {
|
public String readString(Parcel p) {
|
||||||
return mStrings.get(p.readInt());
|
return mStrings.get(p.readInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String readString8(Parcel p) {
|
||||||
|
return readString(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String readString16(Parcel p) {
|
||||||
|
return readString(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,7 +119,6 @@ public class PackageParserCacheHelper {
|
|||||||
* Instead of writing a string directly to a parcel, this method adds it to the pool,
|
* Instead of writing a string directly to a parcel, this method adds it to the pool,
|
||||||
* and write the index in the pool to the parcel.
|
* and write the index in the pool to the parcel.
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public void writeString(Parcel p, String s) {
|
public void writeString(Parcel p, String s) {
|
||||||
final Integer cur = mIndexes.get(s);
|
final Integer cur = mIndexes.get(s);
|
||||||
if (cur != null) {
|
if (cur != null) {
|
||||||
@@ -133,6 +141,16 @@ public class PackageParserCacheHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeString8(Parcel p, String s) {
|
||||||
|
writeString(p, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeString16(Parcel p, String s) {
|
||||||
|
writeString(p, s);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes a parcel by appending the string pool at the end and updating the pool offset,
|
* Closes a parcel by appending the string pool at the end and updating the pool offset,
|
||||||
* which it assumes is at the first byte. It also uninstalls itself as a read-write helper.
|
* which it assumes is at the first byte. It also uninstalls itself as a read-write helper.
|
||||||
|
|||||||
@@ -145,9 +145,9 @@ public final class ProviderInfo extends ComponentInfo
|
|||||||
|
|
||||||
@Override public void writeToParcel(Parcel out, int parcelableFlags) {
|
@Override public void writeToParcel(Parcel out, int parcelableFlags) {
|
||||||
super.writeToParcel(out, parcelableFlags);
|
super.writeToParcel(out, parcelableFlags);
|
||||||
out.writeString(authority);
|
out.writeString8(authority);
|
||||||
out.writeString(readPermission);
|
out.writeString8(readPermission);
|
||||||
out.writeString(writePermission);
|
out.writeString8(writePermission);
|
||||||
out.writeInt(grantUriPermissions ? 1 : 0);
|
out.writeInt(grantUriPermissions ? 1 : 0);
|
||||||
out.writeInt(forceUriPermissions ? 1 : 0);
|
out.writeInt(forceUriPermissions ? 1 : 0);
|
||||||
out.writeTypedArray(uriPermissionPatterns, parcelableFlags);
|
out.writeTypedArray(uriPermissionPatterns, parcelableFlags);
|
||||||
@@ -175,9 +175,9 @@ public final class ProviderInfo extends ComponentInfo
|
|||||||
|
|
||||||
private ProviderInfo(Parcel in) {
|
private ProviderInfo(Parcel in) {
|
||||||
super(in);
|
super(in);
|
||||||
authority = in.readString();
|
authority = in.readString8();
|
||||||
readPermission = in.readString();
|
readPermission = in.readString8();
|
||||||
writePermission = in.readString();
|
writePermission = in.readString8();
|
||||||
grantUriPermissions = in.readInt() != 0;
|
grantUriPermissions = in.readInt() != 0;
|
||||||
forceUriPermissions = in.readInt() != 0;
|
forceUriPermissions = in.readInt() != 0;
|
||||||
uriPermissionPatterns = in.createTypedArray(PatternMatcher.CREATOR);
|
uriPermissionPatterns = in.createTypedArray(PatternMatcher.CREATOR);
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ public class ServiceInfo extends ComponentInfo
|
|||||||
|
|
||||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||||
super.writeToParcel(dest, parcelableFlags);
|
super.writeToParcel(dest, parcelableFlags);
|
||||||
dest.writeString(permission);
|
dest.writeString8(permission);
|
||||||
dest.writeInt(flags);
|
dest.writeInt(flags);
|
||||||
dest.writeInt(mForegroundServiceType);
|
dest.writeInt(mForegroundServiceType);
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ public class ServiceInfo extends ComponentInfo
|
|||||||
|
|
||||||
private ServiceInfo(Parcel source) {
|
private ServiceInfo(Parcel source) {
|
||||||
super(source);
|
super(source);
|
||||||
permission = source.readString();
|
permission = source.readString8();
|
||||||
flags = source.readInt();
|
flags = source.readInt();
|
||||||
mForegroundServiceType = source.readInt();
|
mForegroundServiceType = source.readInt();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -500,7 +500,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Uri readFrom(Parcel parcel) {
|
static Uri readFrom(Parcel parcel) {
|
||||||
return new StringUri(parcel.readString());
|
return new StringUri(parcel.readString8());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
@@ -509,7 +509,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
|
|
||||||
public void writeToParcel(Parcel parcel, int flags) {
|
public void writeToParcel(Parcel parcel, int flags) {
|
||||||
parcel.writeInt(TYPE_ID);
|
parcel.writeInt(TYPE_ID);
|
||||||
parcel.writeString(uriString);
|
parcel.writeString8(uriString);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Cached scheme separator index. */
|
/** Cached scheme separator index. */
|
||||||
@@ -875,7 +875,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
|
|
||||||
static Uri readFrom(Parcel parcel) {
|
static Uri readFrom(Parcel parcel) {
|
||||||
return new OpaqueUri(
|
return new OpaqueUri(
|
||||||
parcel.readString(),
|
parcel.readString8(),
|
||||||
Part.readFrom(parcel),
|
Part.readFrom(parcel),
|
||||||
Part.readFrom(parcel)
|
Part.readFrom(parcel)
|
||||||
);
|
);
|
||||||
@@ -887,7 +887,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
|
|
||||||
public void writeToParcel(Parcel parcel, int flags) {
|
public void writeToParcel(Parcel parcel, int flags) {
|
||||||
parcel.writeInt(TYPE_ID);
|
parcel.writeInt(TYPE_ID);
|
||||||
parcel.writeString(scheme);
|
parcel.writeString8(scheme);
|
||||||
ssp.writeTo(parcel);
|
ssp.writeTo(parcel);
|
||||||
fragment.writeTo(parcel);
|
fragment.writeTo(parcel);
|
||||||
}
|
}
|
||||||
@@ -1195,7 +1195,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
|
|
||||||
static Uri readFrom(Parcel parcel) {
|
static Uri readFrom(Parcel parcel) {
|
||||||
return new HierarchicalUri(
|
return new HierarchicalUri(
|
||||||
parcel.readString(),
|
parcel.readString8(),
|
||||||
Part.readFrom(parcel),
|
Part.readFrom(parcel),
|
||||||
PathPart.readFrom(parcel),
|
PathPart.readFrom(parcel),
|
||||||
Part.readFrom(parcel),
|
Part.readFrom(parcel),
|
||||||
@@ -1209,7 +1209,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
|
|
||||||
public void writeToParcel(Parcel parcel, int flags) {
|
public void writeToParcel(Parcel parcel, int flags) {
|
||||||
parcel.writeInt(TYPE_ID);
|
parcel.writeInt(TYPE_ID);
|
||||||
parcel.writeString(scheme);
|
parcel.writeString8(scheme);
|
||||||
authority.writeTo(parcel);
|
authority.writeTo(parcel);
|
||||||
path.writeTo(parcel);
|
path.writeTo(parcel);
|
||||||
query.writeTo(parcel);
|
query.writeTo(parcel);
|
||||||
@@ -2028,7 +2028,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
+ mCanonicalRepresentation + ")");
|
+ mCanonicalRepresentation + ")");
|
||||||
}
|
}
|
||||||
parcel.writeInt(mCanonicalRepresentation);
|
parcel.writeInt(mCanonicalRepresentation);
|
||||||
parcel.writeString(canonicalValue);
|
parcel.writeString8(canonicalValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2060,7 +2060,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
|
|
||||||
static Part readFrom(Parcel parcel) {
|
static Part readFrom(Parcel parcel) {
|
||||||
int representation = parcel.readInt();
|
int representation = parcel.readInt();
|
||||||
String value = parcel.readString();
|
String value = parcel.readString8();
|
||||||
switch (representation) {
|
switch (representation) {
|
||||||
case REPRESENTATION_ENCODED:
|
case REPRESENTATION_ENCODED:
|
||||||
return fromEncoded(value);
|
return fromEncoded(value);
|
||||||
@@ -2251,9 +2251,9 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
|||||||
int representation = parcel.readInt();
|
int representation = parcel.readInt();
|
||||||
switch (representation) {
|
switch (representation) {
|
||||||
case REPRESENTATION_ENCODED:
|
case REPRESENTATION_ENCODED:
|
||||||
return fromEncoded(parcel.readString());
|
return fromEncoded(parcel.readString8());
|
||||||
case REPRESENTATION_DECODED:
|
case REPRESENTATION_DECODED:
|
||||||
return fromDecoded(parcel.readString());
|
return fromDecoded(parcel.readString8());
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("Unknown representation: " + representation);
|
throw new IllegalArgumentException("Unknown representation: " + representation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -307,7 +307,9 @@ public final class Parcel {
|
|||||||
@FastNative
|
@FastNative
|
||||||
private static native void nativeWriteDouble(long nativePtr, double val);
|
private static native void nativeWriteDouble(long nativePtr, double val);
|
||||||
@FastNative
|
@FastNative
|
||||||
static native void nativeWriteString(long nativePtr, String val);
|
private static native void nativeWriteString8(long nativePtr, String val);
|
||||||
|
@FastNative
|
||||||
|
private static native void nativeWriteString16(long nativePtr, String val);
|
||||||
@FastNative
|
@FastNative
|
||||||
private static native void nativeWriteStrongBinder(long nativePtr, IBinder val);
|
private static native void nativeWriteStrongBinder(long nativePtr, IBinder val);
|
||||||
@FastNative
|
@FastNative
|
||||||
@@ -325,7 +327,9 @@ public final class Parcel {
|
|||||||
@CriticalNative
|
@CriticalNative
|
||||||
private static native double nativeReadDouble(long nativePtr);
|
private static native double nativeReadDouble(long nativePtr);
|
||||||
@FastNative
|
@FastNative
|
||||||
static native String nativeReadString(long nativePtr);
|
private static native String nativeReadString8(long nativePtr);
|
||||||
|
@FastNative
|
||||||
|
private static native String nativeReadString16(long nativePtr);
|
||||||
@FastNative
|
@FastNative
|
||||||
private static native IBinder nativeReadStrongBinder(long nativePtr);
|
private static native IBinder nativeReadStrongBinder(long nativePtr);
|
||||||
@FastNative
|
@FastNative
|
||||||
@@ -386,8 +390,12 @@ public final class Parcel {
|
|||||||
* must use {@link #writeStringNoHelper(String)} to avoid
|
* must use {@link #writeStringNoHelper(String)} to avoid
|
||||||
* infinity recursive calls.
|
* infinity recursive calls.
|
||||||
*/
|
*/
|
||||||
public void writeString(Parcel p, String s) {
|
public void writeString8(Parcel p, String s) {
|
||||||
nativeWriteString(p.mNativePtr, s);
|
p.writeString8NoHelper(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeString16(Parcel p, String s) {
|
||||||
|
p.writeString16NoHelper(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -395,8 +403,12 @@ public final class Parcel {
|
|||||||
* must use {@link #readStringNoHelper()} to avoid
|
* must use {@link #readStringNoHelper()} to avoid
|
||||||
* infinity recursive calls.
|
* infinity recursive calls.
|
||||||
*/
|
*/
|
||||||
public String readString(Parcel p) {
|
public String readString8(Parcel p) {
|
||||||
return nativeReadString(p.mNativePtr);
|
return p.readString8NoHelper();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String readString16(Parcel p) {
|
||||||
|
return p.readString16NoHelper();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -759,7 +771,17 @@ public final class Parcel {
|
|||||||
* growing dataCapacity() if needed.
|
* growing dataCapacity() if needed.
|
||||||
*/
|
*/
|
||||||
public final void writeString(@Nullable String val) {
|
public final void writeString(@Nullable String val) {
|
||||||
mReadWriteHelper.writeString(this, val);
|
writeString16(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public final void writeString8(@Nullable String val) {
|
||||||
|
mReadWriteHelper.writeString8(this, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public final void writeString16(@Nullable String val) {
|
||||||
|
mReadWriteHelper.writeString16(this, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -770,7 +792,17 @@ public final class Parcel {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void writeStringNoHelper(@Nullable String val) {
|
public void writeStringNoHelper(@Nullable String val) {
|
||||||
nativeWriteString(mNativePtr, val);
|
writeString16NoHelper(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public void writeString8NoHelper(@Nullable String val) {
|
||||||
|
nativeWriteString8(mNativePtr, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public void writeString16NoHelper(@Nullable String val) {
|
||||||
|
nativeWriteString16(mNativePtr, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2337,7 +2369,17 @@ public final class Parcel {
|
|||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public final String readString() {
|
public final String readString() {
|
||||||
return mReadWriteHelper.readString(this);
|
return readString16();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public final @Nullable String readString8() {
|
||||||
|
return mReadWriteHelper.readString8(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public final @Nullable String readString16() {
|
||||||
|
return mReadWriteHelper.readString16(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2347,9 +2389,18 @@ public final class Parcel {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable String readStringNoHelper() {
|
||||||
public String readStringNoHelper() {
|
return readString16NoHelper();
|
||||||
return nativeReadString(mNativePtr);
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public @Nullable String readString8NoHelper() {
|
||||||
|
return nativeReadString8(mNativePtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** {@hide} */
|
||||||
|
public @Nullable String readString16NoHelper() {
|
||||||
|
return nativeReadString16(mNativePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -748,7 +748,7 @@ public class TextUtils {
|
|||||||
int parcelableFlags) {
|
int parcelableFlags) {
|
||||||
if (cs instanceof Spanned) {
|
if (cs instanceof Spanned) {
|
||||||
p.writeInt(0);
|
p.writeInt(0);
|
||||||
p.writeString(cs.toString());
|
p.writeString8(cs.toString());
|
||||||
|
|
||||||
Spanned sp = (Spanned) cs;
|
Spanned sp = (Spanned) cs;
|
||||||
Object[] os = sp.getSpans(0, cs.length(), Object.class);
|
Object[] os = sp.getSpans(0, cs.length(), Object.class);
|
||||||
@@ -785,9 +785,9 @@ public class TextUtils {
|
|||||||
} else {
|
} else {
|
||||||
p.writeInt(1);
|
p.writeInt(1);
|
||||||
if (cs != null) {
|
if (cs != null) {
|
||||||
p.writeString(cs.toString());
|
p.writeString8(cs.toString());
|
||||||
} else {
|
} else {
|
||||||
p.writeString(null);
|
p.writeString8(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -807,7 +807,7 @@ public class TextUtils {
|
|||||||
public CharSequence createFromParcel(Parcel p) {
|
public CharSequence createFromParcel(Parcel p) {
|
||||||
int kind = p.readInt();
|
int kind = p.readInt();
|
||||||
|
|
||||||
String string = p.readString();
|
String string = p.readString8();
|
||||||
if (string == null) {
|
if (string == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1213,7 +1213,7 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
|
|
||||||
BitmapReflectionAction(Parcel in) {
|
BitmapReflectionAction(Parcel in) {
|
||||||
viewId = in.readInt();
|
viewId = in.readInt();
|
||||||
methodName = in.readString();
|
methodName = in.readString8();
|
||||||
bitmapId = in.readInt();
|
bitmapId = in.readInt();
|
||||||
bitmap = mBitmapCache.getBitmapForId(bitmapId);
|
bitmap = mBitmapCache.getBitmapForId(bitmapId);
|
||||||
}
|
}
|
||||||
@@ -1221,7 +1221,7 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
@Override
|
@Override
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
dest.writeInt(viewId);
|
dest.writeInt(viewId);
|
||||||
dest.writeString(methodName);
|
dest.writeString8(methodName);
|
||||||
dest.writeInt(bitmapId);
|
dest.writeInt(bitmapId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1282,7 +1282,7 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
|
|
||||||
ReflectionAction(Parcel in) {
|
ReflectionAction(Parcel in) {
|
||||||
this.viewId = in.readInt();
|
this.viewId = in.readInt();
|
||||||
this.methodName = in.readString();
|
this.methodName = in.readString8();
|
||||||
this.type = in.readInt();
|
this.type = in.readInt();
|
||||||
//noinspection ConstantIfStatement
|
//noinspection ConstantIfStatement
|
||||||
if (false) {
|
if (false) {
|
||||||
@@ -1318,7 +1318,7 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
this.value = (char)in.readInt();
|
this.value = (char)in.readInt();
|
||||||
break;
|
break;
|
||||||
case STRING:
|
case STRING:
|
||||||
this.value = in.readString();
|
this.value = in.readString8();
|
||||||
break;
|
break;
|
||||||
case CHAR_SEQUENCE:
|
case CHAR_SEQUENCE:
|
||||||
this.value = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
this.value = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||||
@@ -1347,7 +1347,7 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
|
|
||||||
public void writeToParcel(Parcel out, int flags) {
|
public void writeToParcel(Parcel out, int flags) {
|
||||||
out.writeInt(this.viewId);
|
out.writeInt(this.viewId);
|
||||||
out.writeString(this.methodName);
|
out.writeString8(this.methodName);
|
||||||
out.writeInt(this.type);
|
out.writeInt(this.type);
|
||||||
//noinspection ConstantIfStatement
|
//noinspection ConstantIfStatement
|
||||||
if (false) {
|
if (false) {
|
||||||
@@ -1383,7 +1383,7 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
out.writeInt((int)((Character)this.value).charValue());
|
out.writeInt((int)((Character)this.value).charValue());
|
||||||
break;
|
break;
|
||||||
case STRING:
|
case STRING:
|
||||||
out.writeString((String)this.value);
|
out.writeString8((String)this.value);
|
||||||
break;
|
break;
|
||||||
case CHAR_SEQUENCE:
|
case CHAR_SEQUENCE:
|
||||||
TextUtils.writeToParcel((CharSequence)this.value, out, flags);
|
TextUtils.writeToParcel((CharSequence)this.value, out, flags);
|
||||||
|
|||||||
@@ -273,7 +273,28 @@ static void android_os_Parcel_writeDouble(JNIEnv* env, jclass clazz, jlong nativ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_os_Parcel_writeString(JNIEnv* env, jclass clazz, jlong nativePtr, jstring val)
|
static void android_os_Parcel_writeString8(JNIEnv* env, jclass clazz, jlong nativePtr, jstring val)
|
||||||
|
{
|
||||||
|
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
||||||
|
if (parcel != NULL) {
|
||||||
|
status_t err = NO_MEMORY;
|
||||||
|
if (val) {
|
||||||
|
const size_t len = env->GetStringUTFLength(val);
|
||||||
|
const char* str = env->GetStringUTFChars(val, 0);
|
||||||
|
if (str) {
|
||||||
|
err = parcel->writeString8(str, len);
|
||||||
|
env->ReleaseStringUTFChars(val, str);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
err = parcel->writeString8(NULL, 0);
|
||||||
|
}
|
||||||
|
if (err != NO_ERROR) {
|
||||||
|
signalExceptionForError(env, clazz, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void android_os_Parcel_writeString16(JNIEnv* env, jclass clazz, jlong nativePtr, jstring val)
|
||||||
{
|
{
|
||||||
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
||||||
if (parcel != NULL) {
|
if (parcel != NULL) {
|
||||||
@@ -444,7 +465,21 @@ static jdouble android_os_Parcel_readDouble(jlong nativePtr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static jstring android_os_Parcel_readString(JNIEnv* env, jclass clazz, jlong nativePtr)
|
static jstring android_os_Parcel_readString8(JNIEnv* env, jclass clazz, jlong nativePtr)
|
||||||
|
{
|
||||||
|
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
||||||
|
if (parcel != NULL) {
|
||||||
|
size_t len;
|
||||||
|
const char* str = parcel->readString8Inplace(&len);
|
||||||
|
if (str) {
|
||||||
|
return env->NewStringUTF(str);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static jstring android_os_Parcel_readString16(JNIEnv* env, jclass clazz, jlong nativePtr)
|
||||||
{
|
{
|
||||||
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
Parcel* parcel = reinterpret_cast<Parcel*>(nativePtr);
|
||||||
if (parcel != NULL) {
|
if (parcel != NULL) {
|
||||||
@@ -722,7 +757,9 @@ static const JNINativeMethod gParcelMethods[] = {
|
|||||||
// @FastNative
|
// @FastNative
|
||||||
{"nativeWriteDouble", "(JD)V", (void*)android_os_Parcel_writeDouble},
|
{"nativeWriteDouble", "(JD)V", (void*)android_os_Parcel_writeDouble},
|
||||||
// @FastNative
|
// @FastNative
|
||||||
{"nativeWriteString", "(JLjava/lang/String;)V", (void*)android_os_Parcel_writeString},
|
{"nativeWriteString8", "(JLjava/lang/String;)V", (void*)android_os_Parcel_writeString8},
|
||||||
|
// @FastNative
|
||||||
|
{"nativeWriteString16", "(JLjava/lang/String;)V", (void*)android_os_Parcel_writeString16},
|
||||||
// @FastNative
|
// @FastNative
|
||||||
{"nativeWriteStrongBinder", "(JLandroid/os/IBinder;)V", (void*)android_os_Parcel_writeStrongBinder},
|
{"nativeWriteStrongBinder", "(JLandroid/os/IBinder;)V", (void*)android_os_Parcel_writeStrongBinder},
|
||||||
// @FastNative
|
// @FastNative
|
||||||
@@ -740,7 +777,9 @@ static const JNINativeMethod gParcelMethods[] = {
|
|||||||
// @CriticalNative
|
// @CriticalNative
|
||||||
{"nativeReadDouble", "(J)D", (void*)android_os_Parcel_readDouble},
|
{"nativeReadDouble", "(J)D", (void*)android_os_Parcel_readDouble},
|
||||||
// @FastNative
|
// @FastNative
|
||||||
{"nativeReadString", "(J)Ljava/lang/String;", (void*)android_os_Parcel_readString},
|
{"nativeReadString8", "(J)Ljava/lang/String;", (void*)android_os_Parcel_readString8},
|
||||||
|
// @FastNative
|
||||||
|
{"nativeReadString16", "(J)Ljava/lang/String;", (void*)android_os_Parcel_readString16},
|
||||||
// @FastNative
|
// @FastNative
|
||||||
{"nativeReadStrongBinder", "(J)Landroid/os/IBinder;", (void*)android_os_Parcel_readStrongBinder},
|
{"nativeReadStrongBinder", "(J)Landroid/os/IBinder;", (void*)android_os_Parcel_readStrongBinder},
|
||||||
// @FastNative
|
// @FastNative
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package android.os;
|
||||||
|
|
||||||
|
import com.google.caliper.AfterExperiment;
|
||||||
|
import com.google.caliper.BeforeExperiment;
|
||||||
|
import com.google.caliper.Param;
|
||||||
|
|
||||||
|
public class ParcelStringBenchmark {
|
||||||
|
|
||||||
|
@Param({"com.example.typical_package_name", "從不喜歡孤單一個 - 蘇永康/吳雨霏"})
|
||||||
|
String mValue;
|
||||||
|
|
||||||
|
private Parcel mParcel;
|
||||||
|
|
||||||
|
@BeforeExperiment
|
||||||
|
protected void setUp() {
|
||||||
|
mParcel = Parcel.obtain();
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterExperiment
|
||||||
|
protected void tearDown() {
|
||||||
|
mParcel.recycle();
|
||||||
|
mParcel = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void timeWriteString8(int reps) {
|
||||||
|
for (int i = 0; i < reps; i++) {
|
||||||
|
mParcel.setDataPosition(0);
|
||||||
|
mParcel.writeString8(mValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void timeReadString8(int reps) {
|
||||||
|
mParcel.writeString8(mValue);
|
||||||
|
|
||||||
|
for (int i = 0; i < reps; i++) {
|
||||||
|
mParcel.setDataPosition(0);
|
||||||
|
mParcel.readString8();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void timeWriteString16(int reps) {
|
||||||
|
for (int i = 0; i < reps; i++) {
|
||||||
|
mParcel.setDataPosition(0);
|
||||||
|
mParcel.writeString16(mValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void timeReadString16(int reps) {
|
||||||
|
mParcel.writeString16(mValue);
|
||||||
|
|
||||||
|
for (int i = 0; i < reps; i++) {
|
||||||
|
mParcel.setDataPosition(0);
|
||||||
|
mParcel.readString16();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -87,4 +87,27 @@ public class ParcelTest {
|
|||||||
|
|
||||||
p.recycle();
|
p.recycle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify that writing/reading UTF-8 and UTF-16 strings works well.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testStrings() {
|
||||||
|
final String[] strings = {
|
||||||
|
null, "", "abc\0def", "com.example.typical_package_name",
|
||||||
|
"從不喜歡孤單一個 - 蘇永康/吳雨霏", "example"
|
||||||
|
};
|
||||||
|
|
||||||
|
final Parcel p = Parcel.obtain();
|
||||||
|
for (String string : strings) {
|
||||||
|
p.writeString8(string);
|
||||||
|
p.writeString16(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
p.setDataPosition(0);
|
||||||
|
for (String string : strings) {
|
||||||
|
assertEquals(string, p.readString8());
|
||||||
|
assertEquals(string, p.readString16());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user