Merge changes from topic "apr19" into rvc-dev am: b67e70aa40 am: ed91f7aabf
Change-Id: I9713e76a78868c7ef2e57c697e141643e1681a81
This commit is contained in:
@@ -2301,11 +2301,11 @@ public class Notification implements Parcelable
|
||||
|
||||
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
|
||||
fixDuplicateExtras();
|
||||
@@ -2329,12 +2329,12 @@ public class Notification implements Parcelable
|
||||
color = parcel.readInt();
|
||||
|
||||
if (parcel.readInt() != 0) {
|
||||
mChannelId = parcel.readString();
|
||||
mChannelId = parcel.readString8();
|
||||
}
|
||||
mTimeout = parcel.readLong();
|
||||
|
||||
if (parcel.readInt() != 0) {
|
||||
mShortcutId = parcel.readString();
|
||||
mShortcutId = parcel.readString8();
|
||||
}
|
||||
|
||||
if (parcel.readInt() != 0) {
|
||||
@@ -2766,11 +2766,11 @@ public class Notification implements Parcelable
|
||||
|
||||
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
|
||||
|
||||
@@ -2803,7 +2803,7 @@ public class Notification implements Parcelable
|
||||
|
||||
if (mChannelId != null) {
|
||||
parcel.writeInt(1);
|
||||
parcel.writeString(mChannelId);
|
||||
parcel.writeString8(mChannelId);
|
||||
} else {
|
||||
parcel.writeInt(0);
|
||||
}
|
||||
@@ -2811,7 +2811,7 @@ public class Notification implements Parcelable
|
||||
|
||||
if (mShortcutId != null) {
|
||||
parcel.writeInt(1);
|
||||
parcel.writeString(mShortcutId);
|
||||
parcel.writeString8(mShortcutId);
|
||||
} else {
|
||||
parcel.writeInt(0);
|
||||
}
|
||||
@@ -8873,7 +8873,7 @@ public class Notification implements Parcelable
|
||||
}
|
||||
mDesiredHeightResId = in.readInt();
|
||||
if (in.readInt() != 0) {
|
||||
mShortcutId = in.readString();
|
||||
mShortcutId = in.readString8();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9029,7 +9029,7 @@ public class Notification implements Parcelable
|
||||
out.writeInt(mDesiredHeightResId);
|
||||
out.writeInt(TextUtils.isEmpty(mShortcutId) ? 0 : 1);
|
||||
if (!TextUtils.isEmpty(mShortcutId)) {
|
||||
out.writeString(mShortcutId);
|
||||
out.writeString8(mShortcutId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1206,7 +1206,7 @@ public class ClipData implements Parcelable {
|
||||
}
|
||||
} else {
|
||||
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) {
|
||||
if (in.readInt() == PARCEL_TYPE_STRING) {
|
||||
return in.readString();
|
||||
return in.readString8();
|
||||
}
|
||||
ParcelFileDescriptor pfd =
|
||||
in.readParcelable(ParcelFileDescriptor.class.getClassLoader());
|
||||
|
||||
@@ -91,8 +91,8 @@ public class ContentProviderOperation implements Parcelable {
|
||||
private ContentProviderOperation(Parcel source) {
|
||||
mType = source.readInt();
|
||||
mUri = Uri.CREATOR.createFromParcel(source);
|
||||
mMethod = source.readInt() != 0 ? source.readString() : null;
|
||||
mArg = source.readInt() != 0 ? source.readString() : null;
|
||||
mMethod = source.readInt() != 0 ? source.readString8() : null;
|
||||
mArg = source.readInt() != 0 ? source.readString8() : null;
|
||||
final int valuesSize = source.readInt();
|
||||
if (valuesSize != -1) {
|
||||
mValues = new ArrayMap<>(valuesSize);
|
||||
@@ -107,7 +107,7 @@ public class ContentProviderOperation implements Parcelable {
|
||||
} else {
|
||||
mExtras = null;
|
||||
}
|
||||
mSelection = source.readInt() != 0 ? source.readString() : null;
|
||||
mSelection = source.readInt() != 0 ? source.readString8() : null;
|
||||
mSelectionArgs = source.readSparseArray(null);
|
||||
mExpectedCount = source.readInt() != 0 ? source.readInt() : null;
|
||||
mYieldAllowed = source.readInt() != 0;
|
||||
@@ -135,13 +135,13 @@ public class ContentProviderOperation implements Parcelable {
|
||||
Uri.writeToParcel(dest, mUri);
|
||||
if (mMethod != null) {
|
||||
dest.writeInt(1);
|
||||
dest.writeString(mMethod);
|
||||
dest.writeString8(mMethod);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
if (mArg != null) {
|
||||
dest.writeInt(1);
|
||||
dest.writeString(mArg);
|
||||
dest.writeString8(mArg);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
@@ -159,7 +159,7 @@ public class ContentProviderOperation implements Parcelable {
|
||||
}
|
||||
if (mSelection != null) {
|
||||
dest.writeInt(1);
|
||||
dest.writeString(mSelection);
|
||||
dest.writeString8(mSelection);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
@@ -591,7 +591,7 @@ public class ContentProviderOperation implements Parcelable {
|
||||
public BackReference(Parcel src) {
|
||||
this.fromIndex = src.readInt();
|
||||
if (src.readInt() != 0) {
|
||||
this.fromKey = src.readString();
|
||||
this.fromKey = src.readString8();
|
||||
} else {
|
||||
this.fromKey = null;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ public class ContentProviderOperation implements Parcelable {
|
||||
dest.writeInt(fromIndex);
|
||||
if (fromKey != null) {
|
||||
dest.writeInt(1);
|
||||
dest.writeString(fromKey);
|
||||
dest.writeString8(fromKey);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
|
||||
@@ -888,8 +888,8 @@ public class Intent implements Parcelable, Cloneable {
|
||||
|
||||
public ShortcutIconResource createFromParcel(Parcel source) {
|
||||
ShortcutIconResource icon = new ShortcutIconResource();
|
||||
icon.packageName = source.readString();
|
||||
icon.resourceName = source.readString();
|
||||
icon.packageName = source.readString8();
|
||||
icon.resourceName = source.readString8();
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -906,8 +906,8 @@ public class Intent implements Parcelable, Cloneable {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(packageName);
|
||||
dest.writeString(resourceName);
|
||||
dest.writeString8(packageName);
|
||||
dest.writeString8(resourceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -10807,12 +10807,12 @@ public class Intent implements Parcelable, Cloneable {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(mAction);
|
||||
out.writeString8(mAction);
|
||||
Uri.writeToParcel(out, mData);
|
||||
out.writeString(mType);
|
||||
out.writeString(mIdentifier);
|
||||
out.writeString8(mType);
|
||||
out.writeString8(mIdentifier);
|
||||
out.writeInt(mFlags);
|
||||
out.writeString(mPackage);
|
||||
out.writeString8(mPackage);
|
||||
ComponentName.writeToParcel(mComponent, out);
|
||||
|
||||
if (mSourceBounds != null) {
|
||||
@@ -10826,7 +10826,7 @@ public class Intent implements Parcelable, Cloneable {
|
||||
final int N = mCategories.size();
|
||||
out.writeInt(N);
|
||||
for (int i=0; i<N; i++) {
|
||||
out.writeString(mCategories.valueAt(i));
|
||||
out.writeString8(mCategories.valueAt(i));
|
||||
}
|
||||
} else {
|
||||
out.writeInt(0);
|
||||
@@ -10865,12 +10865,12 @@ public class Intent implements Parcelable, Cloneable {
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel in) {
|
||||
setAction(in.readString());
|
||||
setAction(in.readString8());
|
||||
mData = Uri.CREATOR.createFromParcel(in);
|
||||
mType = in.readString();
|
||||
mIdentifier = in.readString();
|
||||
mType = in.readString8();
|
||||
mIdentifier = in.readString8();
|
||||
mFlags = in.readInt();
|
||||
mPackage = in.readString();
|
||||
mPackage = in.readString8();
|
||||
mComponent = ComponentName.readFromParcel(in);
|
||||
|
||||
if (in.readInt() != 0) {
|
||||
@@ -10882,7 +10882,7 @@ public class Intent implements Parcelable, Cloneable {
|
||||
mCategories = new ArraySet<String>();
|
||||
int i;
|
||||
for (i=0; i<N; i++) {
|
||||
mCategories.add(in.readString().intern());
|
||||
mCategories.add(in.readString8().intern());
|
||||
}
|
||||
} else {
|
||||
mCategories = null;
|
||||
|
||||
@@ -1206,17 +1206,17 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
||||
dest.writeInt(theme);
|
||||
dest.writeInt(launchMode);
|
||||
dest.writeInt(documentLaunchMode);
|
||||
dest.writeString(permission);
|
||||
dest.writeString(taskAffinity);
|
||||
dest.writeString(targetActivity);
|
||||
dest.writeString(launchToken);
|
||||
dest.writeString8(permission);
|
||||
dest.writeString8(taskAffinity);
|
||||
dest.writeString8(targetActivity);
|
||||
dest.writeString8(launchToken);
|
||||
dest.writeInt(flags);
|
||||
dest.writeInt(privateFlags);
|
||||
dest.writeInt(screenOrientation);
|
||||
dest.writeInt(configChanges);
|
||||
dest.writeInt(softInputMode);
|
||||
dest.writeInt(uiOptions);
|
||||
dest.writeString(parentActivityName);
|
||||
dest.writeString8(parentActivityName);
|
||||
dest.writeInt(persistableMode);
|
||||
dest.writeInt(maxRecents);
|
||||
dest.writeInt(lockTaskLaunchMode);
|
||||
@@ -1227,7 +1227,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
dest.writeInt(resizeMode);
|
||||
dest.writeString(requestedVrComponent);
|
||||
dest.writeString8(requestedVrComponent);
|
||||
dest.writeInt(rotationAnimation);
|
||||
dest.writeInt(colorMode);
|
||||
dest.writeFloat(maxAspectRatio);
|
||||
@@ -1327,17 +1327,17 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
||||
theme = source.readInt();
|
||||
launchMode = source.readInt();
|
||||
documentLaunchMode = source.readInt();
|
||||
permission = source.readString();
|
||||
taskAffinity = source.readString();
|
||||
targetActivity = source.readString();
|
||||
launchToken = source.readString();
|
||||
permission = source.readString8();
|
||||
taskAffinity = source.readString8();
|
||||
targetActivity = source.readString8();
|
||||
launchToken = source.readString8();
|
||||
flags = source.readInt();
|
||||
privateFlags = source.readInt();
|
||||
screenOrientation = source.readInt();
|
||||
configChanges = source.readInt();
|
||||
softInputMode = source.readInt();
|
||||
uiOptions = source.readInt();
|
||||
parentActivityName = source.readString();
|
||||
parentActivityName = source.readString8();
|
||||
persistableMode = source.readInt();
|
||||
maxRecents = source.readInt();
|
||||
lockTaskLaunchMode = source.readInt();
|
||||
@@ -1345,7 +1345,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
||||
windowLayout = new WindowLayout(source);
|
||||
}
|
||||
resizeMode = source.readInt();
|
||||
requestedVrComponent = source.readString();
|
||||
requestedVrComponent = source.readString8();
|
||||
rotationAnimation = source.readInt();
|
||||
colorMode = source.readInt();
|
||||
maxAspectRatio = source.readFloat();
|
||||
@@ -1386,7 +1386,7 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
|
||||
gravity = source.readInt();
|
||||
minWidth = 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(minWidth);
|
||||
dest.writeInt(minHeight);
|
||||
dest.writeString(windowLayoutAffinity);
|
||||
dest.writeString8(windowLayoutAffinity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1704,10 +1704,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
return;
|
||||
}
|
||||
super.writeToParcel(dest, parcelableFlags);
|
||||
dest.writeString(taskAffinity);
|
||||
dest.writeString(permission);
|
||||
dest.writeString(processName);
|
||||
dest.writeString(className);
|
||||
dest.writeString8(taskAffinity);
|
||||
dest.writeString8(permission);
|
||||
dest.writeString8(processName);
|
||||
dest.writeString8(className);
|
||||
dest.writeInt(theme);
|
||||
dest.writeInt(flags);
|
||||
dest.writeInt(privateFlags);
|
||||
@@ -1721,28 +1721,28 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
dest.writeString(scanSourceDir);
|
||||
dest.writeString(scanPublicSourceDir);
|
||||
dest.writeString(sourceDir);
|
||||
dest.writeString(publicSourceDir);
|
||||
dest.writeString8(scanSourceDir);
|
||||
dest.writeString8(scanPublicSourceDir);
|
||||
dest.writeString8(sourceDir);
|
||||
dest.writeString8(publicSourceDir);
|
||||
dest.writeStringArray(splitNames);
|
||||
dest.writeStringArray(splitSourceDirs);
|
||||
dest.writeStringArray(splitPublicSourceDirs);
|
||||
dest.writeSparseArray((SparseArray) splitDependencies);
|
||||
dest.writeString(nativeLibraryDir);
|
||||
dest.writeString(secondaryNativeLibraryDir);
|
||||
dest.writeString(nativeLibraryRootDir);
|
||||
dest.writeString8(nativeLibraryDir);
|
||||
dest.writeString8(secondaryNativeLibraryDir);
|
||||
dest.writeString8(nativeLibraryRootDir);
|
||||
dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0);
|
||||
dest.writeString(primaryCpuAbi);
|
||||
dest.writeString(secondaryCpuAbi);
|
||||
dest.writeString8(primaryCpuAbi);
|
||||
dest.writeString8(secondaryCpuAbi);
|
||||
dest.writeStringArray(resourceDirs);
|
||||
dest.writeString(seInfo);
|
||||
dest.writeString(seInfoUser);
|
||||
dest.writeString8(seInfo);
|
||||
dest.writeString8(seInfoUser);
|
||||
dest.writeStringArray(sharedLibraryFiles);
|
||||
dest.writeTypedList(sharedLibraryInfos);
|
||||
dest.writeString(dataDir);
|
||||
dest.writeString(deviceProtectedDataDir);
|
||||
dest.writeString(credentialProtectedDataDir);
|
||||
dest.writeString8(dataDir);
|
||||
dest.writeString8(deviceProtectedDataDir);
|
||||
dest.writeString8(credentialProtectedDataDir);
|
||||
dest.writeInt(uid);
|
||||
dest.writeInt(minSdkVersion);
|
||||
dest.writeInt(targetSdkVersion);
|
||||
@@ -1750,8 +1750,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeInt(enabled ? 1 : 0);
|
||||
dest.writeInt(enabledSetting);
|
||||
dest.writeInt(installLocation);
|
||||
dest.writeString(manageSpaceActivityName);
|
||||
dest.writeString(backupAgentName);
|
||||
dest.writeString8(manageSpaceActivityName);
|
||||
dest.writeString8(backupAgentName);
|
||||
dest.writeInt(descriptionRes);
|
||||
dest.writeInt(uiOptions);
|
||||
dest.writeInt(fullBackupContent);
|
||||
@@ -1759,16 +1759,16 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeInt(networkSecurityConfigRes);
|
||||
dest.writeInt(category);
|
||||
dest.writeInt(targetSandboxVersion);
|
||||
dest.writeString(classLoaderName);
|
||||
dest.writeString8(classLoaderName);
|
||||
dest.writeStringArray(splitClassLoaderNames);
|
||||
dest.writeInt(compileSdkVersion);
|
||||
dest.writeString(compileSdkVersionCodename);
|
||||
dest.writeString(appComponentFactory);
|
||||
dest.writeString8(compileSdkVersionCodename);
|
||||
dest.writeString8(appComponentFactory);
|
||||
dest.writeInt(iconRes);
|
||||
dest.writeInt(roundIconRes);
|
||||
dest.writeInt(mHiddenApiPolicy);
|
||||
dest.writeInt(hiddenUntilInstalled ? 1 : 0);
|
||||
dest.writeString(zygotePreloadName);
|
||||
dest.writeString8(zygotePreloadName);
|
||||
dest.writeInt(gwpAsanMode);
|
||||
}
|
||||
|
||||
@@ -1788,10 +1788,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
@SuppressWarnings("unchecked")
|
||||
private ApplicationInfo(Parcel source) {
|
||||
super(source);
|
||||
taskAffinity = source.readString();
|
||||
permission = source.readString();
|
||||
processName = source.readString();
|
||||
className = source.readString();
|
||||
taskAffinity = source.readString8();
|
||||
permission = source.readString8();
|
||||
processName = source.readString8();
|
||||
className = source.readString8();
|
||||
theme = source.readInt();
|
||||
flags = source.readInt();
|
||||
privateFlags = source.readInt();
|
||||
@@ -1802,28 +1802,28 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
storageUuid = new UUID(source.readLong(), source.readLong());
|
||||
volumeUuid = StorageManager.convert(storageUuid);
|
||||
}
|
||||
scanSourceDir = source.readString();
|
||||
scanPublicSourceDir = source.readString();
|
||||
sourceDir = source.readString();
|
||||
publicSourceDir = source.readString();
|
||||
scanSourceDir = source.readString8();
|
||||
scanPublicSourceDir = source.readString8();
|
||||
sourceDir = source.readString8();
|
||||
publicSourceDir = source.readString8();
|
||||
splitNames = source.readStringArray();
|
||||
splitSourceDirs = source.readStringArray();
|
||||
splitPublicSourceDirs = source.readStringArray();
|
||||
splitDependencies = source.readSparseArray(null);
|
||||
nativeLibraryDir = source.readString();
|
||||
secondaryNativeLibraryDir = source.readString();
|
||||
nativeLibraryRootDir = source.readString();
|
||||
nativeLibraryDir = source.readString8();
|
||||
secondaryNativeLibraryDir = source.readString8();
|
||||
nativeLibraryRootDir = source.readString8();
|
||||
nativeLibraryRootRequiresIsa = source.readInt() != 0;
|
||||
primaryCpuAbi = source.readString();
|
||||
secondaryCpuAbi = source.readString();
|
||||
primaryCpuAbi = source.readString8();
|
||||
secondaryCpuAbi = source.readString8();
|
||||
resourceDirs = source.readStringArray();
|
||||
seInfo = source.readString();
|
||||
seInfoUser = source.readString();
|
||||
seInfo = source.readString8();
|
||||
seInfoUser = source.readString8();
|
||||
sharedLibraryFiles = source.readStringArray();
|
||||
sharedLibraryInfos = source.createTypedArrayList(SharedLibraryInfo.CREATOR);
|
||||
dataDir = source.readString();
|
||||
deviceProtectedDataDir = source.readString();
|
||||
credentialProtectedDataDir = source.readString();
|
||||
dataDir = source.readString8();
|
||||
deviceProtectedDataDir = source.readString8();
|
||||
credentialProtectedDataDir = source.readString8();
|
||||
uid = source.readInt();
|
||||
minSdkVersion = source.readInt();
|
||||
targetSdkVersion = source.readInt();
|
||||
@@ -1831,8 +1831,8 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
enabled = source.readInt() != 0;
|
||||
enabledSetting = source.readInt();
|
||||
installLocation = source.readInt();
|
||||
manageSpaceActivityName = source.readString();
|
||||
backupAgentName = source.readString();
|
||||
manageSpaceActivityName = source.readString8();
|
||||
backupAgentName = source.readString8();
|
||||
descriptionRes = source.readInt();
|
||||
uiOptions = source.readInt();
|
||||
fullBackupContent = source.readInt();
|
||||
@@ -1840,16 +1840,16 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
networkSecurityConfigRes = source.readInt();
|
||||
category = source.readInt();
|
||||
targetSandboxVersion = source.readInt();
|
||||
classLoaderName = source.readString();
|
||||
classLoaderName = source.readString8();
|
||||
splitClassLoaderNames = source.readStringArray();
|
||||
compileSdkVersion = source.readInt();
|
||||
compileSdkVersionCodename = source.readString();
|
||||
appComponentFactory = source.readString();
|
||||
compileSdkVersionCodename = source.readString8();
|
||||
appComponentFactory = source.readString8();
|
||||
iconRes = source.readInt();
|
||||
roundIconRes = source.readInt();
|
||||
mHiddenApiPolicy = source.readInt();
|
||||
hiddenUntilInstalled = source.readInt() != 0;
|
||||
zygotePreloadName = source.readString();
|
||||
zygotePreloadName = source.readString8();
|
||||
gwpAsanMode = source.readInt();
|
||||
}
|
||||
|
||||
|
||||
@@ -197,8 +197,8 @@ public class ComponentInfo extends PackageItemInfo {
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
super.writeToParcel(dest, parcelableFlags);
|
||||
applicationInfo.writeToParcel(dest, parcelableFlags);
|
||||
dest.writeString(processName);
|
||||
dest.writeString(splitName);
|
||||
dest.writeString8(processName);
|
||||
dest.writeString8(splitName);
|
||||
dest.writeInt(descriptionRes);
|
||||
dest.writeInt(enabled ? 1 : 0);
|
||||
dest.writeInt(exported ? 1 : 0);
|
||||
@@ -208,8 +208,8 @@ public class ComponentInfo extends PackageItemInfo {
|
||||
protected ComponentInfo(Parcel source) {
|
||||
super(source);
|
||||
applicationInfo = ApplicationInfo.CREATOR.createFromParcel(source);
|
||||
processName = source.readString();
|
||||
splitName = source.readString();
|
||||
processName = source.readString8();
|
||||
splitName = source.readString8();
|
||||
descriptionRes = source.readInt();
|
||||
enabled = (source.readInt() != 0);
|
||||
exported = (source.readInt() != 0);
|
||||
|
||||
@@ -108,7 +108,7 @@ public class FeatureInfo implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
dest.writeString(name);
|
||||
dest.writeString8(name);
|
||||
dest.writeInt(version);
|
||||
dest.writeInt(reqGlEsVersion);
|
||||
dest.writeInt(flags);
|
||||
@@ -138,7 +138,7 @@ public class FeatureInfo implements Parcelable {
|
||||
};
|
||||
|
||||
private FeatureInfo(Parcel source) {
|
||||
name = source.readString();
|
||||
name = source.readString8();
|
||||
version = source.readInt();
|
||||
reqGlEsVersion = source.readInt();
|
||||
flags = source.readInt();
|
||||
|
||||
@@ -157,21 +157,21 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable {
|
||||
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
super.writeToParcel(dest, parcelableFlags);
|
||||
dest.writeString(targetPackage);
|
||||
dest.writeString(targetProcesses);
|
||||
dest.writeString(sourceDir);
|
||||
dest.writeString(publicSourceDir);
|
||||
dest.writeString8(targetPackage);
|
||||
dest.writeString8(targetProcesses);
|
||||
dest.writeString8(sourceDir);
|
||||
dest.writeString8(publicSourceDir);
|
||||
dest.writeStringArray(splitNames);
|
||||
dest.writeStringArray(splitSourceDirs);
|
||||
dest.writeStringArray(splitPublicSourceDirs);
|
||||
dest.writeSparseArray((SparseArray) splitDependencies);
|
||||
dest.writeString(dataDir);
|
||||
dest.writeString(deviceProtectedDataDir);
|
||||
dest.writeString(credentialProtectedDataDir);
|
||||
dest.writeString(primaryCpuAbi);
|
||||
dest.writeString(secondaryCpuAbi);
|
||||
dest.writeString(nativeLibraryDir);
|
||||
dest.writeString(secondaryNativeLibraryDir);
|
||||
dest.writeString8(dataDir);
|
||||
dest.writeString8(deviceProtectedDataDir);
|
||||
dest.writeString8(credentialProtectedDataDir);
|
||||
dest.writeString8(primaryCpuAbi);
|
||||
dest.writeString8(secondaryCpuAbi);
|
||||
dest.writeString8(nativeLibraryDir);
|
||||
dest.writeString8(secondaryNativeLibraryDir);
|
||||
dest.writeInt((handleProfiling == false) ? 0 : 1);
|
||||
dest.writeInt((functionalTest == false) ? 0 : 1);
|
||||
}
|
||||
@@ -189,21 +189,21 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable {
|
||||
@SuppressWarnings("unchecked")
|
||||
private InstrumentationInfo(Parcel source) {
|
||||
super(source);
|
||||
targetPackage = source.readString();
|
||||
targetProcesses = source.readString();
|
||||
sourceDir = source.readString();
|
||||
publicSourceDir = source.readString();
|
||||
targetPackage = source.readString8();
|
||||
targetProcesses = source.readString8();
|
||||
sourceDir = source.readString8();
|
||||
publicSourceDir = source.readString8();
|
||||
splitNames = source.readStringArray();
|
||||
splitSourceDirs = source.readStringArray();
|
||||
splitPublicSourceDirs = source.readStringArray();
|
||||
splitDependencies = source.readSparseArray(null);
|
||||
dataDir = source.readString();
|
||||
deviceProtectedDataDir = source.readString();
|
||||
credentialProtectedDataDir = source.readString();
|
||||
primaryCpuAbi = source.readString();
|
||||
secondaryCpuAbi = source.readString();
|
||||
nativeLibraryDir = source.readString();
|
||||
secondaryNativeLibraryDir = source.readString();
|
||||
dataDir = source.readString8();
|
||||
deviceProtectedDataDir = source.readString8();
|
||||
credentialProtectedDataDir = source.readString8();
|
||||
primaryCpuAbi = source.readString8();
|
||||
secondaryCpuAbi = source.readString8();
|
||||
nativeLibraryDir = source.readString8();
|
||||
secondaryNativeLibraryDir = source.readString8();
|
||||
handleProfiling = source.readInt() != 0;
|
||||
functionalTest = source.readInt() != 0;
|
||||
}
|
||||
|
||||
@@ -441,14 +441,14 @@ public class PackageInfo implements Parcelable {
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
// Allow ApplicationInfo to be squashed.
|
||||
final boolean prevAllowSquashing = dest.allowSquashing();
|
||||
dest.writeString(packageName);
|
||||
dest.writeString8(packageName);
|
||||
dest.writeStringArray(splitNames);
|
||||
dest.writeInt(versionCode);
|
||||
dest.writeInt(versionCodeMajor);
|
||||
dest.writeString(versionName);
|
||||
dest.writeString8(versionName);
|
||||
dest.writeInt(baseRevisionCode);
|
||||
dest.writeIntArray(splitRevisionCodes);
|
||||
dest.writeString(sharedUserId);
|
||||
dest.writeString8(sharedUserId);
|
||||
dest.writeInt(sharedUserLabel);
|
||||
if (applicationInfo != null) {
|
||||
dest.writeInt(1);
|
||||
@@ -475,14 +475,14 @@ public class PackageInfo implements Parcelable {
|
||||
dest.writeInt(isStub ? 1 : 0);
|
||||
dest.writeInt(coreApp ? 1 : 0);
|
||||
dest.writeInt(requiredForAllUsers ? 1 : 0);
|
||||
dest.writeString(restrictedAccountType);
|
||||
dest.writeString(requiredAccountType);
|
||||
dest.writeString(overlayTarget);
|
||||
dest.writeString(overlayCategory);
|
||||
dest.writeString8(restrictedAccountType);
|
||||
dest.writeString8(requiredAccountType);
|
||||
dest.writeString8(overlayTarget);
|
||||
dest.writeString8(overlayCategory);
|
||||
dest.writeInt(overlayPriority);
|
||||
dest.writeBoolean(mOverlayIsStatic);
|
||||
dest.writeInt(compileSdkVersion);
|
||||
dest.writeString(compileSdkVersionCodename);
|
||||
dest.writeString8(compileSdkVersionCodename);
|
||||
if (signingInfo != null) {
|
||||
dest.writeInt(1);
|
||||
signingInfo.writeToParcel(dest, parcelableFlags);
|
||||
@@ -508,14 +508,14 @@ public class PackageInfo implements Parcelable {
|
||||
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||
private PackageInfo(Parcel source) {
|
||||
packageName = source.readString();
|
||||
packageName = source.readString8();
|
||||
splitNames = source.createStringArray();
|
||||
versionCode = source.readInt();
|
||||
versionCodeMajor = source.readInt();
|
||||
versionName = source.readString();
|
||||
versionName = source.readString8();
|
||||
baseRevisionCode = source.readInt();
|
||||
splitRevisionCodes = source.createIntArray();
|
||||
sharedUserId = source.readString();
|
||||
sharedUserId = source.readString8();
|
||||
sharedUserLabel = source.readInt();
|
||||
int hasApp = source.readInt();
|
||||
if (hasApp != 0) {
|
||||
@@ -540,14 +540,14 @@ public class PackageInfo implements Parcelable {
|
||||
isStub = source.readInt() != 0;
|
||||
coreApp = source.readInt() != 0;
|
||||
requiredForAllUsers = source.readInt() != 0;
|
||||
restrictedAccountType = source.readString();
|
||||
requiredAccountType = source.readString();
|
||||
overlayTarget = source.readString();
|
||||
overlayCategory = source.readString();
|
||||
restrictedAccountType = source.readString8();
|
||||
requiredAccountType = source.readString8();
|
||||
overlayTarget = source.readString8();
|
||||
overlayCategory = source.readString8();
|
||||
overlayPriority = source.readInt();
|
||||
mOverlayIsStatic = source.readBoolean();
|
||||
compileSdkVersion = source.readInt();
|
||||
compileSdkVersionCodename = source.readString();
|
||||
compileSdkVersionCodename = source.readString8();
|
||||
int hasSigningInfo = source.readInt();
|
||||
if (hasSigningInfo != 0) {
|
||||
signingInfo = SigningInfo.CREATOR.createFromParcel(source);
|
||||
|
||||
@@ -422,8 +422,8 @@ public class PackageItemInfo {
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
dest.writeString(name);
|
||||
dest.writeString(packageName);
|
||||
dest.writeString8(name);
|
||||
dest.writeString8(packageName);
|
||||
dest.writeInt(labelRes);
|
||||
TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
|
||||
dest.writeInt(icon);
|
||||
@@ -452,8 +452,8 @@ public class PackageItemInfo {
|
||||
}
|
||||
|
||||
protected PackageItemInfo(Parcel source) {
|
||||
name = source.readString();
|
||||
packageName = source.readString();
|
||||
name = source.readString8();
|
||||
packageName = source.readString8();
|
||||
labelRes = source.readInt();
|
||||
nonLocalizedLabel
|
||||
= 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.
|
||||
*/
|
||||
@Override
|
||||
public String readString(Parcel p) {
|
||||
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,
|
||||
* and write the index in the pool to the parcel.
|
||||
*/
|
||||
@Override
|
||||
public void writeString(Parcel p, String s) {
|
||||
final Integer cur = mIndexes.get(s);
|
||||
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,
|
||||
* 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) {
|
||||
super.writeToParcel(out, parcelableFlags);
|
||||
out.writeString(authority);
|
||||
out.writeString(readPermission);
|
||||
out.writeString(writePermission);
|
||||
out.writeString8(authority);
|
||||
out.writeString8(readPermission);
|
||||
out.writeString8(writePermission);
|
||||
out.writeInt(grantUriPermissions ? 1 : 0);
|
||||
out.writeInt(forceUriPermissions ? 1 : 0);
|
||||
out.writeTypedArray(uriPermissionPatterns, parcelableFlags);
|
||||
@@ -175,9 +175,9 @@ public final class ProviderInfo extends ComponentInfo
|
||||
|
||||
private ProviderInfo(Parcel in) {
|
||||
super(in);
|
||||
authority = in.readString();
|
||||
readPermission = in.readString();
|
||||
writePermission = in.readString();
|
||||
authority = in.readString8();
|
||||
readPermission = in.readString8();
|
||||
writePermission = in.readString8();
|
||||
grantUriPermissions = in.readInt() != 0;
|
||||
forceUriPermissions = in.readInt() != 0;
|
||||
uriPermissionPatterns = in.createTypedArray(PatternMatcher.CREATOR);
|
||||
|
||||
@@ -244,7 +244,7 @@ public class ServiceInfo extends ComponentInfo
|
||||
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
super.writeToParcel(dest, parcelableFlags);
|
||||
dest.writeString(permission);
|
||||
dest.writeString8(permission);
|
||||
dest.writeInt(flags);
|
||||
dest.writeInt(mForegroundServiceType);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ public class ServiceInfo extends ComponentInfo
|
||||
|
||||
private ServiceInfo(Parcel source) {
|
||||
super(source);
|
||||
permission = source.readString();
|
||||
permission = source.readString8();
|
||||
flags = source.readInt();
|
||||
mForegroundServiceType = source.readInt();
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
}
|
||||
|
||||
static Uri readFrom(Parcel parcel) {
|
||||
return new StringUri(parcel.readString());
|
||||
return new StringUri(parcel.readString8());
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
@@ -509,7 +509,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeInt(TYPE_ID);
|
||||
parcel.writeString(uriString);
|
||||
parcel.writeString8(uriString);
|
||||
}
|
||||
|
||||
/** Cached scheme separator index. */
|
||||
@@ -875,7 +875,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
|
||||
static Uri readFrom(Parcel parcel) {
|
||||
return new OpaqueUri(
|
||||
parcel.readString(),
|
||||
parcel.readString8(),
|
||||
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) {
|
||||
parcel.writeInt(TYPE_ID);
|
||||
parcel.writeString(scheme);
|
||||
parcel.writeString8(scheme);
|
||||
ssp.writeTo(parcel);
|
||||
fragment.writeTo(parcel);
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
|
||||
static Uri readFrom(Parcel parcel) {
|
||||
return new HierarchicalUri(
|
||||
parcel.readString(),
|
||||
parcel.readString8(),
|
||||
Part.readFrom(parcel),
|
||||
PathPart.readFrom(parcel),
|
||||
Part.readFrom(parcel),
|
||||
@@ -1209,7 +1209,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeInt(TYPE_ID);
|
||||
parcel.writeString(scheme);
|
||||
parcel.writeString8(scheme);
|
||||
authority.writeTo(parcel);
|
||||
path.writeTo(parcel);
|
||||
query.writeTo(parcel);
|
||||
@@ -2028,7 +2028,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
+ 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) {
|
||||
int representation = parcel.readInt();
|
||||
String value = parcel.readString();
|
||||
String value = parcel.readString8();
|
||||
switch (representation) {
|
||||
case REPRESENTATION_ENCODED:
|
||||
return fromEncoded(value);
|
||||
@@ -2251,9 +2251,9 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
int representation = parcel.readInt();
|
||||
switch (representation) {
|
||||
case REPRESENTATION_ENCODED:
|
||||
return fromEncoded(parcel.readString());
|
||||
return fromEncoded(parcel.readString8());
|
||||
case REPRESENTATION_DECODED:
|
||||
return fromDecoded(parcel.readString());
|
||||
return fromDecoded(parcel.readString8());
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown representation: " + representation);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,9 @@ public final class Parcel {
|
||||
@FastNative
|
||||
private static native void nativeWriteDouble(long nativePtr, double val);
|
||||
@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
|
||||
private static native void nativeWriteStrongBinder(long nativePtr, IBinder val);
|
||||
@FastNative
|
||||
@@ -325,7 +327,9 @@ public final class Parcel {
|
||||
@CriticalNative
|
||||
private static native double nativeReadDouble(long nativePtr);
|
||||
@FastNative
|
||||
static native String nativeReadString(long nativePtr);
|
||||
private static native String nativeReadString8(long nativePtr);
|
||||
@FastNative
|
||||
private static native String nativeReadString16(long nativePtr);
|
||||
@FastNative
|
||||
private static native IBinder nativeReadStrongBinder(long nativePtr);
|
||||
@FastNative
|
||||
@@ -386,8 +390,12 @@ public final class Parcel {
|
||||
* must use {@link #writeStringNoHelper(String)} to avoid
|
||||
* infinity recursive calls.
|
||||
*/
|
||||
public void writeString(Parcel p, String s) {
|
||||
nativeWriteString(p.mNativePtr, s);
|
||||
public void writeString8(Parcel p, String 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
|
||||
* infinity recursive calls.
|
||||
*/
|
||||
public String readString(Parcel p) {
|
||||
return nativeReadString(p.mNativePtr);
|
||||
public String readString8(Parcel p) {
|
||||
return p.readString8NoHelper();
|
||||
}
|
||||
|
||||
public String readString16(Parcel p) {
|
||||
return p.readString16NoHelper();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,7 +771,17 @@ public final class Parcel {
|
||||
* growing dataCapacity() if needed.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
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
|
||||
*/
|
||||
@Nullable
|
||||
public String readStringNoHelper() {
|
||||
return nativeReadString(mNativePtr);
|
||||
public @Nullable String readStringNoHelper() {
|
||||
return readString16NoHelper();
|
||||
}
|
||||
|
||||
/** {@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) {
|
||||
if (cs instanceof Spanned) {
|
||||
p.writeInt(0);
|
||||
p.writeString(cs.toString());
|
||||
p.writeString8(cs.toString());
|
||||
|
||||
Spanned sp = (Spanned) cs;
|
||||
Object[] os = sp.getSpans(0, cs.length(), Object.class);
|
||||
@@ -785,9 +785,9 @@ public class TextUtils {
|
||||
} else {
|
||||
p.writeInt(1);
|
||||
if (cs != null) {
|
||||
p.writeString(cs.toString());
|
||||
p.writeString8(cs.toString());
|
||||
} else {
|
||||
p.writeString(null);
|
||||
p.writeString8(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -807,7 +807,7 @@ public class TextUtils {
|
||||
public CharSequence createFromParcel(Parcel p) {
|
||||
int kind = p.readInt();
|
||||
|
||||
String string = p.readString();
|
||||
String string = p.readString8();
|
||||
if (string == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1213,7 +1213,7 @@ public class RemoteViews implements Parcelable, Filter {
|
||||
|
||||
BitmapReflectionAction(Parcel in) {
|
||||
viewId = in.readInt();
|
||||
methodName = in.readString();
|
||||
methodName = in.readString8();
|
||||
bitmapId = in.readInt();
|
||||
bitmap = mBitmapCache.getBitmapForId(bitmapId);
|
||||
}
|
||||
@@ -1221,7 +1221,7 @@ public class RemoteViews implements Parcelable, Filter {
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(viewId);
|
||||
dest.writeString(methodName);
|
||||
dest.writeString8(methodName);
|
||||
dest.writeInt(bitmapId);
|
||||
}
|
||||
|
||||
@@ -1282,7 +1282,7 @@ public class RemoteViews implements Parcelable, Filter {
|
||||
|
||||
ReflectionAction(Parcel in) {
|
||||
this.viewId = in.readInt();
|
||||
this.methodName = in.readString();
|
||||
this.methodName = in.readString8();
|
||||
this.type = in.readInt();
|
||||
//noinspection ConstantIfStatement
|
||||
if (false) {
|
||||
@@ -1318,7 +1318,7 @@ public class RemoteViews implements Parcelable, Filter {
|
||||
this.value = (char)in.readInt();
|
||||
break;
|
||||
case STRING:
|
||||
this.value = in.readString();
|
||||
this.value = in.readString8();
|
||||
break;
|
||||
case CHAR_SEQUENCE:
|
||||
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) {
|
||||
out.writeInt(this.viewId);
|
||||
out.writeString(this.methodName);
|
||||
out.writeString8(this.methodName);
|
||||
out.writeInt(this.type);
|
||||
//noinspection ConstantIfStatement
|
||||
if (false) {
|
||||
@@ -1383,7 +1383,7 @@ public class RemoteViews implements Parcelable, Filter {
|
||||
out.writeInt((int)((Character)this.value).charValue());
|
||||
break;
|
||||
case STRING:
|
||||
out.writeString((String)this.value);
|
||||
out.writeString8((String)this.value);
|
||||
break;
|
||||
case CHAR_SEQUENCE:
|
||||
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);
|
||||
if (parcel != NULL) {
|
||||
@@ -444,7 +465,21 @@ static jdouble android_os_Parcel_readDouble(jlong nativePtr)
|
||||
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);
|
||||
if (parcel != NULL) {
|
||||
@@ -722,7 +757,9 @@ static const JNINativeMethod gParcelMethods[] = {
|
||||
// @FastNative
|
||||
{"nativeWriteDouble", "(JD)V", (void*)android_os_Parcel_writeDouble},
|
||||
// @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
|
||||
{"nativeWriteStrongBinder", "(JLandroid/os/IBinder;)V", (void*)android_os_Parcel_writeStrongBinder},
|
||||
// @FastNative
|
||||
@@ -740,7 +777,9 @@ static const JNINativeMethod gParcelMethods[] = {
|
||||
// @CriticalNative
|
||||
{"nativeReadDouble", "(J)D", (void*)android_os_Parcel_readDouble},
|
||||
// @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
|
||||
{"nativeReadStrongBinder", "(J)Landroid/os/IBinder;", (void*)android_os_Parcel_readStrongBinder},
|
||||
// @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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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