Merge "Update more Parcelables to send Strings UTF-8." into rvc-dev
This commit is contained in:
@@ -25,7 +25,6 @@ import android.annotation.TestApi;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.content.pm.ProcessInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
@@ -39,8 +38,6 @@ import android.util.SparseArray;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.Parcelling;
|
||||
import com.android.internal.util.Parcelling.BuiltIn.ForBoolean;
|
||||
import com.android.server.SystemConfig;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -1725,9 +1722,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeString8(scanPublicSourceDir);
|
||||
dest.writeString8(sourceDir);
|
||||
dest.writeString8(publicSourceDir);
|
||||
dest.writeStringArray(splitNames);
|
||||
dest.writeStringArray(splitSourceDirs);
|
||||
dest.writeStringArray(splitPublicSourceDirs);
|
||||
dest.writeString8Array(splitNames);
|
||||
dest.writeString8Array(splitSourceDirs);
|
||||
dest.writeString8Array(splitPublicSourceDirs);
|
||||
dest.writeSparseArray((SparseArray) splitDependencies);
|
||||
dest.writeString8(nativeLibraryDir);
|
||||
dest.writeString8(secondaryNativeLibraryDir);
|
||||
@@ -1735,10 +1732,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeInt(nativeLibraryRootRequiresIsa ? 1 : 0);
|
||||
dest.writeString8(primaryCpuAbi);
|
||||
dest.writeString8(secondaryCpuAbi);
|
||||
dest.writeStringArray(resourceDirs);
|
||||
dest.writeString8Array(resourceDirs);
|
||||
dest.writeString8(seInfo);
|
||||
dest.writeString8(seInfoUser);
|
||||
dest.writeStringArray(sharedLibraryFiles);
|
||||
dest.writeString8Array(sharedLibraryFiles);
|
||||
dest.writeTypedList(sharedLibraryInfos);
|
||||
dest.writeString8(dataDir);
|
||||
dest.writeString8(deviceProtectedDataDir);
|
||||
@@ -1760,7 +1757,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeInt(category);
|
||||
dest.writeInt(targetSandboxVersion);
|
||||
dest.writeString8(classLoaderName);
|
||||
dest.writeStringArray(splitClassLoaderNames);
|
||||
dest.writeString8Array(splitClassLoaderNames);
|
||||
dest.writeInt(compileSdkVersion);
|
||||
dest.writeString8(compileSdkVersionCodename);
|
||||
dest.writeString8(appComponentFactory);
|
||||
@@ -1806,9 +1803,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
scanPublicSourceDir = source.readString8();
|
||||
sourceDir = source.readString8();
|
||||
publicSourceDir = source.readString8();
|
||||
splitNames = source.readStringArray();
|
||||
splitSourceDirs = source.readStringArray();
|
||||
splitPublicSourceDirs = source.readStringArray();
|
||||
splitNames = source.createString8Array();
|
||||
splitSourceDirs = source.createString8Array();
|
||||
splitPublicSourceDirs = source.createString8Array();
|
||||
splitDependencies = source.readSparseArray(null);
|
||||
nativeLibraryDir = source.readString8();
|
||||
secondaryNativeLibraryDir = source.readString8();
|
||||
@@ -1816,10 +1813,10 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
nativeLibraryRootRequiresIsa = source.readInt() != 0;
|
||||
primaryCpuAbi = source.readString8();
|
||||
secondaryCpuAbi = source.readString8();
|
||||
resourceDirs = source.readStringArray();
|
||||
resourceDirs = source.createString8Array();
|
||||
seInfo = source.readString8();
|
||||
seInfoUser = source.readString8();
|
||||
sharedLibraryFiles = source.readStringArray();
|
||||
sharedLibraryFiles = source.createString8Array();
|
||||
sharedLibraryInfos = source.createTypedArrayList(SharedLibraryInfo.CREATOR);
|
||||
dataDir = source.readString8();
|
||||
deviceProtectedDataDir = source.readString8();
|
||||
@@ -1841,7 +1838,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
category = source.readInt();
|
||||
targetSandboxVersion = source.readInt();
|
||||
classLoaderName = source.readString8();
|
||||
splitClassLoaderNames = source.readStringArray();
|
||||
splitClassLoaderNames = source.createString8Array();
|
||||
compileSdkVersion = source.readInt();
|
||||
compileSdkVersionCodename = source.readString8();
|
||||
appComponentFactory = source.readString8();
|
||||
|
||||
@@ -161,9 +161,9 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeString8(targetProcesses);
|
||||
dest.writeString8(sourceDir);
|
||||
dest.writeString8(publicSourceDir);
|
||||
dest.writeStringArray(splitNames);
|
||||
dest.writeStringArray(splitSourceDirs);
|
||||
dest.writeStringArray(splitPublicSourceDirs);
|
||||
dest.writeString8Array(splitNames);
|
||||
dest.writeString8Array(splitSourceDirs);
|
||||
dest.writeString8Array(splitPublicSourceDirs);
|
||||
dest.writeSparseArray((SparseArray) splitDependencies);
|
||||
dest.writeString8(dataDir);
|
||||
dest.writeString8(deviceProtectedDataDir);
|
||||
@@ -193,9 +193,9 @@ public class InstrumentationInfo extends PackageItemInfo implements Parcelable {
|
||||
targetProcesses = source.readString8();
|
||||
sourceDir = source.readString8();
|
||||
publicSourceDir = source.readString8();
|
||||
splitNames = source.readStringArray();
|
||||
splitSourceDirs = source.readStringArray();
|
||||
splitPublicSourceDirs = source.readStringArray();
|
||||
splitNames = source.createString8Array();
|
||||
splitSourceDirs = source.createString8Array();
|
||||
splitPublicSourceDirs = source.createString8Array();
|
||||
splitDependencies = source.readSparseArray(null);
|
||||
dataDir = source.readString8();
|
||||
deviceProtectedDataDir = source.readString8();
|
||||
|
||||
@@ -442,7 +442,7 @@ public class PackageInfo implements Parcelable {
|
||||
// Allow ApplicationInfo to be squashed.
|
||||
final boolean prevAllowSquashing = dest.allowSquashing();
|
||||
dest.writeString8(packageName);
|
||||
dest.writeStringArray(splitNames);
|
||||
dest.writeString8Array(splitNames);
|
||||
dest.writeInt(versionCode);
|
||||
dest.writeInt(versionCodeMajor);
|
||||
dest.writeString8(versionName);
|
||||
@@ -465,7 +465,7 @@ public class PackageInfo implements Parcelable {
|
||||
dest.writeTypedArray(providers, parcelableFlags);
|
||||
dest.writeTypedArray(instrumentation, parcelableFlags);
|
||||
dest.writeTypedArray(permissions, parcelableFlags);
|
||||
dest.writeStringArray(requestedPermissions);
|
||||
dest.writeString8Array(requestedPermissions);
|
||||
dest.writeIntArray(requestedPermissionsFlags);
|
||||
dest.writeTypedArray(signatures, parcelableFlags);
|
||||
dest.writeTypedArray(configPreferences, parcelableFlags);
|
||||
@@ -509,7 +509,7 @@ public class PackageInfo implements Parcelable {
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||
private PackageInfo(Parcel source) {
|
||||
packageName = source.readString8();
|
||||
splitNames = source.createStringArray();
|
||||
splitNames = source.createString8Array();
|
||||
versionCode = source.readInt();
|
||||
versionCodeMajor = source.readInt();
|
||||
versionName = source.readString8();
|
||||
@@ -530,7 +530,7 @@ public class PackageInfo implements Parcelable {
|
||||
providers = source.createTypedArray(ProviderInfo.CREATOR);
|
||||
instrumentation = source.createTypedArray(InstrumentationInfo.CREATOR);
|
||||
permissions = source.createTypedArray(PermissionInfo.CREATOR);
|
||||
requestedPermissions = source.createStringArray();
|
||||
requestedPermissions = source.createString8Array();
|
||||
requestedPermissionsFlags = source.createIntArray();
|
||||
signatures = source.createTypedArray(Signature.CREATOR);
|
||||
configPreferences = source.createTypedArray(ConfigurationInfo.CREATOR);
|
||||
|
||||
@@ -618,8 +618,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
super.writeToParcel(dest, parcelableFlags);
|
||||
dest.writeInt(protectionLevel);
|
||||
dest.writeInt(flags);
|
||||
dest.writeString(group);
|
||||
dest.writeString(backgroundPermission);
|
||||
dest.writeString8(group);
|
||||
dest.writeString8(backgroundPermission);
|
||||
dest.writeInt(descriptionRes);
|
||||
dest.writeInt(requestRes);
|
||||
TextUtils.writeToParcel(nonLocalizedDescription, dest, parcelableFlags);
|
||||
@@ -678,8 +678,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
|
||||
super(source);
|
||||
protectionLevel = source.readInt();
|
||||
flags = source.readInt();
|
||||
group = source.readString();
|
||||
backgroundPermission = source.readString();
|
||||
group = source.readString8();
|
||||
backgroundPermission = source.readString8();
|
||||
descriptionRes = source.readInt();
|
||||
requestRes = source.readInt();
|
||||
nonLocalizedDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
|
||||
|
||||
@@ -443,7 +443,7 @@ public class ResolveInfo implements Parcelable {
|
||||
dest.writeInt(labelRes);
|
||||
TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
|
||||
dest.writeInt(icon);
|
||||
dest.writeString(resolvePackageName);
|
||||
dest.writeString8(resolvePackageName);
|
||||
dest.writeInt(targetUserId);
|
||||
dest.writeInt(system ? 1 : 0);
|
||||
dest.writeInt(noResourceId ? 1 : 0);
|
||||
@@ -491,7 +491,7 @@ public class ResolveInfo implements Parcelable {
|
||||
nonLocalizedLabel
|
||||
= TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
|
||||
icon = source.readInt();
|
||||
resolvePackageName = source.readString();
|
||||
resolvePackageName = source.readString8();
|
||||
targetUserId = source.readInt();
|
||||
system = source.readInt() != 0;
|
||||
noResourceId = source.readInt() != 0;
|
||||
|
||||
@@ -26,6 +26,7 @@ import android.os.Parcelable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -111,10 +112,19 @@ public final class SharedLibraryInfo implements Parcelable {
|
||||
}
|
||||
|
||||
private SharedLibraryInfo(Parcel parcel) {
|
||||
this(parcel.readString(), parcel.readString(), parcel.readArrayList(null),
|
||||
parcel.readString(), parcel.readLong(),
|
||||
parcel.readInt(), parcel.readParcelable(null), parcel.readArrayList(null),
|
||||
parcel.createTypedArrayList(SharedLibraryInfo.CREATOR));
|
||||
mPath = parcel.readString8();
|
||||
mPackageName = parcel.readString8();
|
||||
if (parcel.readInt() != 0) {
|
||||
mCodePaths = Arrays.asList(parcel.createString8Array());
|
||||
} else {
|
||||
mCodePaths = null;
|
||||
}
|
||||
mName = parcel.readString8();
|
||||
mVersion = parcel.readLong();
|
||||
mType = parcel.readInt();
|
||||
mDeclaringPackage = parcel.readParcelable(null);
|
||||
mDependentPackages = parcel.readArrayList(null);
|
||||
mDependencies = parcel.createTypedArrayList(SharedLibraryInfo.CREATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -296,10 +306,15 @@ public final class SharedLibraryInfo implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeString(mPath);
|
||||
parcel.writeString(mPackageName);
|
||||
parcel.writeList(mCodePaths);
|
||||
parcel.writeString(mName);
|
||||
parcel.writeString8(mPath);
|
||||
parcel.writeString8(mPackageName);
|
||||
if (mCodePaths != null) {
|
||||
parcel.writeInt(1);
|
||||
parcel.writeString8Array(mCodePaths.toArray(new String[mCodePaths.size()]));
|
||||
} else {
|
||||
parcel.writeInt(0);
|
||||
}
|
||||
parcel.writeString8(mName);
|
||||
parcel.writeLong(mVersion);
|
||||
parcel.writeInt(mType);
|
||||
parcel.writeParcelable(mDeclaringPackage, flags);
|
||||
|
||||
@@ -2059,8 +2059,8 @@ public final class ShortcutInfo implements Parcelable {
|
||||
final ClassLoader cl = getClass().getClassLoader();
|
||||
|
||||
mUserId = source.readInt();
|
||||
mId = source.readString();
|
||||
mPackageName = source.readString();
|
||||
mId = source.readString8();
|
||||
mPackageName = source.readString8();
|
||||
mActivity = source.readParcelable(cl);
|
||||
mFlags = source.readInt();
|
||||
mIconResId = source.readInt();
|
||||
@@ -2082,12 +2082,12 @@ public final class ShortcutInfo implements Parcelable {
|
||||
mIntentPersistableExtrases = source.readParcelableArray(cl, PersistableBundle.class);
|
||||
mRank = source.readInt();
|
||||
mExtras = source.readParcelable(cl);
|
||||
mBitmapPath = source.readString();
|
||||
mBitmapPath = source.readString8();
|
||||
|
||||
mIconResName = source.readString();
|
||||
mTitleResName = source.readString();
|
||||
mTextResName = source.readString();
|
||||
mDisabledMessageResName = source.readString();
|
||||
mIconResName = source.readString8();
|
||||
mTitleResName = source.readString8();
|
||||
mTextResName = source.readString8();
|
||||
mDisabledMessageResName = source.readString8();
|
||||
|
||||
int N = source.readInt();
|
||||
if (N == 0) {
|
||||
@@ -2095,20 +2095,20 @@ public final class ShortcutInfo implements Parcelable {
|
||||
} else {
|
||||
mCategories = new ArraySet<>(N);
|
||||
for (int i = 0; i < N; i++) {
|
||||
mCategories.add(source.readString().intern());
|
||||
mCategories.add(source.readString8().intern());
|
||||
}
|
||||
}
|
||||
|
||||
mPersons = source.readParcelableArray(cl, Person.class);
|
||||
mLocusId = source.readParcelable(cl);
|
||||
mIconUri = source.readString();
|
||||
mIconUri = source.readString8();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mUserId);
|
||||
dest.writeString(mId);
|
||||
dest.writeString(mPackageName);
|
||||
dest.writeString8(mId);
|
||||
dest.writeString8(mPackageName);
|
||||
dest.writeParcelable(mActivity, flags);
|
||||
dest.writeInt(mFlags);
|
||||
dest.writeInt(mIconResId);
|
||||
@@ -2133,18 +2133,18 @@ public final class ShortcutInfo implements Parcelable {
|
||||
dest.writeParcelableArray(mIntentPersistableExtrases, flags);
|
||||
dest.writeInt(mRank);
|
||||
dest.writeParcelable(mExtras, flags);
|
||||
dest.writeString(mBitmapPath);
|
||||
dest.writeString8(mBitmapPath);
|
||||
|
||||
dest.writeString(mIconResName);
|
||||
dest.writeString(mTitleResName);
|
||||
dest.writeString(mTextResName);
|
||||
dest.writeString(mDisabledMessageResName);
|
||||
dest.writeString8(mIconResName);
|
||||
dest.writeString8(mTitleResName);
|
||||
dest.writeString8(mTextResName);
|
||||
dest.writeString8(mDisabledMessageResName);
|
||||
|
||||
if (mCategories != null) {
|
||||
final int N = mCategories.size();
|
||||
dest.writeInt(N);
|
||||
for (int i = 0; i < N; i++) {
|
||||
dest.writeString(mCategories.valueAt(i));
|
||||
dest.writeString8(mCategories.valueAt(i));
|
||||
}
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
@@ -2152,7 +2152,7 @@ public final class ShortcutInfo implements Parcelable {
|
||||
|
||||
dest.writeParcelableArray(mPersons, flags);
|
||||
dest.writeParcelable(mLocusId, flags);
|
||||
dest.writeString(mIconUri);
|
||||
dest.writeString8(mIconUri);
|
||||
}
|
||||
|
||||
public static final @android.annotation.NonNull Creator<ShortcutInfo> CREATOR =
|
||||
|
||||
@@ -457,14 +457,14 @@ public class UserInfo implements Parcelable {
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
dest.writeInt(id);
|
||||
dest.writeString(name);
|
||||
dest.writeString(iconPath);
|
||||
dest.writeString8(name);
|
||||
dest.writeString8(iconPath);
|
||||
dest.writeInt(flags);
|
||||
dest.writeString(userType);
|
||||
dest.writeString8(userType);
|
||||
dest.writeInt(serialNumber);
|
||||
dest.writeLong(creationTime);
|
||||
dest.writeLong(lastLoggedInTime);
|
||||
dest.writeString(lastLoggedInFingerprint);
|
||||
dest.writeString8(lastLoggedInFingerprint);
|
||||
dest.writeBoolean(partial);
|
||||
dest.writeBoolean(preCreated);
|
||||
dest.writeInt(profileGroupId);
|
||||
@@ -486,14 +486,14 @@ public class UserInfo implements Parcelable {
|
||||
|
||||
private UserInfo(Parcel source) {
|
||||
id = source.readInt();
|
||||
name = source.readString();
|
||||
iconPath = source.readString();
|
||||
name = source.readString8();
|
||||
iconPath = source.readString8();
|
||||
flags = source.readInt();
|
||||
userType = source.readString();
|
||||
userType = source.readString8();
|
||||
serialNumber = source.readInt();
|
||||
creationTime = source.readLong();
|
||||
lastLoggedInTime = source.readLong();
|
||||
lastLoggedInFingerprint = source.readString();
|
||||
lastLoggedInFingerprint = source.readString8();
|
||||
partial = source.readBoolean();
|
||||
preCreated = source.readBoolean();
|
||||
profileGroupId = source.readInt();
|
||||
|
||||
@@ -60,7 +60,7 @@ public final class VersionedPackage implements Parcelable {
|
||||
}
|
||||
|
||||
private VersionedPackage(Parcel parcel) {
|
||||
mPackageName = parcel.readString();
|
||||
mPackageName = parcel.readString8();
|
||||
mVersionCode = parcel.readLong();
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public final class VersionedPackage implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeString(mPackageName);
|
||||
parcel.writeString8(mPackageName);
|
||||
parcel.writeLong(mVersionCode);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ public final class LocaleList implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int parcelableFlags) {
|
||||
dest.writeString(mStringRepresentation);
|
||||
dest.writeString8(mStringRepresentation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,7 +239,7 @@ public final class LocaleList implements Parcelable {
|
||||
= new Parcelable.Creator<LocaleList>() {
|
||||
@Override
|
||||
public LocaleList createFromParcel(Parcel source) {
|
||||
return LocaleList.forLanguageTags(source.readString());
|
||||
return LocaleList.forLanguageTags(source.readString8());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1396,24 +1396,39 @@ public final class Parcel {
|
||||
}
|
||||
|
||||
public final void writeStringArray(@Nullable String[] val) {
|
||||
writeString16Array(val);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final String[] createStringArray() {
|
||||
return createString16Array();
|
||||
}
|
||||
|
||||
public final void readStringArray(@NonNull String[] val) {
|
||||
readString16Array(val);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
public final void writeString8Array(@Nullable String[] val) {
|
||||
if (val != null) {
|
||||
int N = val.length;
|
||||
writeInt(N);
|
||||
for (int i=0; i<N; i++) {
|
||||
writeString(val[i]);
|
||||
writeString8(val[i]);
|
||||
}
|
||||
} else {
|
||||
writeInt(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@Nullable
|
||||
public final String[] createStringArray() {
|
||||
public final String[] createString8Array() {
|
||||
int N = readInt();
|
||||
if (N >= 0) {
|
||||
String[] val = new String[N];
|
||||
for (int i=0; i<N; i++) {
|
||||
val[i] = readString();
|
||||
val[i] = readString8();
|
||||
}
|
||||
return val;
|
||||
} else {
|
||||
@@ -1421,11 +1436,52 @@ public final class Parcel {
|
||||
}
|
||||
}
|
||||
|
||||
public final void readStringArray(@NonNull String[] val) {
|
||||
/** {@hide} */
|
||||
public final void readString8Array(@NonNull String[] val) {
|
||||
int N = readInt();
|
||||
if (N == val.length) {
|
||||
for (int i=0; i<N; i++) {
|
||||
val[i] = readString();
|
||||
val[i] = readString8();
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("bad array lengths");
|
||||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
public final void writeString16Array(@Nullable String[] val) {
|
||||
if (val != null) {
|
||||
int N = val.length;
|
||||
writeInt(N);
|
||||
for (int i=0; i<N; i++) {
|
||||
writeString16(val[i]);
|
||||
}
|
||||
} else {
|
||||
writeInt(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@Nullable
|
||||
public final String[] createString16Array() {
|
||||
int N = readInt();
|
||||
if (N >= 0) {
|
||||
String[] val = new String[N];
|
||||
for (int i=0; i<N; i++) {
|
||||
val[i] = readString16();
|
||||
}
|
||||
return val;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
public final void readString16Array(@NonNull String[] val) {
|
||||
int N = readInt();
|
||||
if (N == val.length) {
|
||||
for (int i=0; i<N; i++) {
|
||||
val[i] = readString16();
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("bad array lengths");
|
||||
@@ -2641,20 +2697,7 @@ public final class Parcel {
|
||||
@UnsupportedAppUsage
|
||||
@Nullable
|
||||
public final String[] readStringArray() {
|
||||
String[] array = null;
|
||||
|
||||
int length = readInt();
|
||||
if (length >= 0)
|
||||
{
|
||||
array = new String[length];
|
||||
|
||||
for (int i = 0 ; i < length ; i++)
|
||||
{
|
||||
array[i] = readString();
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
return createString16Array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -149,18 +149,18 @@ public final class StorageVolume implements Parcelable {
|
||||
}
|
||||
|
||||
private StorageVolume(Parcel in) {
|
||||
mId = in.readString();
|
||||
mPath = new File(in.readString());
|
||||
mInternalPath = new File(in.readString());
|
||||
mDescription = in.readString();
|
||||
mId = in.readString8();
|
||||
mPath = new File(in.readString8());
|
||||
mInternalPath = new File(in.readString8());
|
||||
mDescription = in.readString8();
|
||||
mPrimary = in.readInt() != 0;
|
||||
mRemovable = in.readInt() != 0;
|
||||
mEmulated = in.readInt() != 0;
|
||||
mAllowMassStorage = in.readInt() != 0;
|
||||
mMaxFileSize = in.readLong();
|
||||
mOwner = in.readParcelable(null);
|
||||
mFsUuid = in.readString();
|
||||
mState = in.readString();
|
||||
mFsUuid = in.readString8();
|
||||
mState = in.readString8();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,17 +503,17 @@ public final class StorageVolume implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeString(mId);
|
||||
parcel.writeString(mPath.toString());
|
||||
parcel.writeString(mInternalPath.toString());
|
||||
parcel.writeString(mDescription);
|
||||
parcel.writeString8(mId);
|
||||
parcel.writeString8(mPath.toString());
|
||||
parcel.writeString8(mInternalPath.toString());
|
||||
parcel.writeString8(mDescription);
|
||||
parcel.writeInt(mPrimary ? 1 : 0);
|
||||
parcel.writeInt(mRemovable ? 1 : 0);
|
||||
parcel.writeInt(mEmulated ? 1 : 0);
|
||||
parcel.writeInt(mAllowMassStorage ? 1 : 0);
|
||||
parcel.writeLong(mMaxFileSize);
|
||||
parcel.writeParcelable(mOwner, flags);
|
||||
parcel.writeString(mFsUuid);
|
||||
parcel.writeString(mState);
|
||||
parcel.writeString8(mFsUuid);
|
||||
parcel.writeString8(mState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,22 +181,22 @@ public class VolumeInfo implements Parcelable {
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public VolumeInfo(Parcel parcel) {
|
||||
id = parcel.readString();
|
||||
id = parcel.readString8();
|
||||
type = parcel.readInt();
|
||||
if (parcel.readInt() != 0) {
|
||||
disk = DiskInfo.CREATOR.createFromParcel(parcel);
|
||||
} else {
|
||||
disk = null;
|
||||
}
|
||||
partGuid = parcel.readString();
|
||||
partGuid = parcel.readString8();
|
||||
mountFlags = parcel.readInt();
|
||||
mountUserId = parcel.readInt();
|
||||
state = parcel.readInt();
|
||||
fsType = parcel.readString();
|
||||
fsUuid = parcel.readString();
|
||||
fsLabel = parcel.readString();
|
||||
path = parcel.readString();
|
||||
internalPath = parcel.readString();
|
||||
fsType = parcel.readString8();
|
||||
fsUuid = parcel.readString8();
|
||||
fsLabel = parcel.readString8();
|
||||
path = parcel.readString8();
|
||||
internalPath = parcel.readString8();
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
@@ -553,7 +553,7 @@ public class VolumeInfo implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeString(id);
|
||||
parcel.writeString8(id);
|
||||
parcel.writeInt(type);
|
||||
if (disk != null) {
|
||||
parcel.writeInt(1);
|
||||
@@ -561,14 +561,14 @@ public class VolumeInfo implements Parcelable {
|
||||
} else {
|
||||
parcel.writeInt(0);
|
||||
}
|
||||
parcel.writeString(partGuid);
|
||||
parcel.writeString8(partGuid);
|
||||
parcel.writeInt(mountFlags);
|
||||
parcel.writeInt(mountUserId);
|
||||
parcel.writeInt(state);
|
||||
parcel.writeString(fsType);
|
||||
parcel.writeString(fsUuid);
|
||||
parcel.writeString(fsLabel);
|
||||
parcel.writeString(path);
|
||||
parcel.writeString(internalPath);
|
||||
parcel.writeString8(fsType);
|
||||
parcel.writeString8(fsUuid);
|
||||
parcel.writeString8(fsLabel);
|
||||
parcel.writeString8(path);
|
||||
parcel.writeString8(internalPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ public final class DisplayInfo implements Parcelable {
|
||||
displayId = source.readInt();
|
||||
address = source.readParcelable(null);
|
||||
deviceProductInfo = source.readParcelable(null);
|
||||
name = source.readString();
|
||||
name = source.readString8();
|
||||
appWidth = source.readInt();
|
||||
appHeight = source.readInt();
|
||||
smallestNominalAppWidth = source.readInt();
|
||||
@@ -418,8 +418,8 @@ public final class DisplayInfo implements Parcelable {
|
||||
presentationDeadlineNanos = source.readLong();
|
||||
state = source.readInt();
|
||||
ownerUid = source.readInt();
|
||||
ownerPackageName = source.readString();
|
||||
uniqueId = source.readString();
|
||||
ownerPackageName = source.readString8();
|
||||
uniqueId = source.readString8();
|
||||
removeMode = source.readInt();
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ public final class DisplayInfo implements Parcelable {
|
||||
dest.writeInt(displayId);
|
||||
dest.writeParcelable(address, flags);
|
||||
dest.writeParcelable(deviceProductInfo, flags);
|
||||
dest.writeString(name);
|
||||
dest.writeString8(name);
|
||||
dest.writeInt(appWidth);
|
||||
dest.writeInt(appHeight);
|
||||
dest.writeInt(smallestNominalAppWidth);
|
||||
@@ -462,8 +462,8 @@ public final class DisplayInfo implements Parcelable {
|
||||
dest.writeLong(presentationDeadlineNanos);
|
||||
dest.writeInt(state);
|
||||
dest.writeInt(ownerUid);
|
||||
dest.writeString(ownerPackageName);
|
||||
dest.writeString(uniqueId);
|
||||
dest.writeString8(ownerPackageName);
|
||||
dest.writeString8(uniqueId);
|
||||
dest.writeInt(removeMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -213,8 +213,16 @@ public class InsetsSource implements Parcelable {
|
||||
|
||||
public InsetsSource(Parcel in) {
|
||||
mType = in.readInt();
|
||||
mFrame = in.readParcelable(null /* loader */);
|
||||
mVisibleFrame = in.readParcelable(null /* loader */);
|
||||
if (in.readInt() != 0) {
|
||||
mFrame = Rect.CREATOR.createFromParcel(in);
|
||||
} else {
|
||||
mFrame = null;
|
||||
}
|
||||
if (in.readInt() != 0) {
|
||||
mVisibleFrame = Rect.CREATOR.createFromParcel(in);
|
||||
} else {
|
||||
mVisibleFrame = null;
|
||||
}
|
||||
mVisible = in.readBoolean();
|
||||
}
|
||||
|
||||
@@ -226,8 +234,18 @@ public class InsetsSource implements Parcelable {
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(mType);
|
||||
dest.writeParcelable(mFrame, 0 /* flags*/);
|
||||
dest.writeParcelable(mVisibleFrame, 0 /* flags */);
|
||||
if (mFrame != null) {
|
||||
dest.writeInt(1);
|
||||
mFrame.writeToParcel(dest, 0);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
if (mVisibleFrame != null) {
|
||||
dest.writeInt(1);
|
||||
mVisibleFrame.writeToParcel(dest, 0);
|
||||
} else {
|
||||
dest.writeInt(0);
|
||||
}
|
||||
dest.writeBoolean(mVisible);
|
||||
}
|
||||
|
||||
|
||||
@@ -894,7 +894,7 @@ public final class SurfaceControl implements Parcelable {
|
||||
throw new IllegalArgumentException("source must not be null");
|
||||
}
|
||||
|
||||
mName = in.readString();
|
||||
mName = in.readString8();
|
||||
mWidth = in.readInt();
|
||||
mHeight = in.readInt();
|
||||
|
||||
@@ -912,7 +912,7 @@ public final class SurfaceControl implements Parcelable {
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(mName);
|
||||
dest.writeString8(mName);
|
||||
dest.writeInt(mWidth);
|
||||
dest.writeInt(mHeight);
|
||||
if (mNativeObject == 0) {
|
||||
|
||||
Reference in New Issue
Block a user