| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content.pm; |
| 18 |
|
| 19 |
import android.compat.annotation.UnsupportedAppUsage; |
| 20 |
import android.os.Build; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import com.android.internal.content.InstallLocationUtils; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
public class PackageInfoLite implements Parcelable { |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public String packageName; |
| 37 |
|
| 38 |
|
| 39 |
public String[] splitNames; |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
@Deprecated |
| 48 |
public int versionCode; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
public int versionCodeMajor; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
public long getLongVersionCode() { |
| 61 |
return PackageInfo.composeLongVersionCode(versionCodeMajor, versionCode); |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
public int baseRevisionCode; |
| 66 |
|
| 67 |
public int[] splitRevisionCodes; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
public boolean multiArch; |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
public boolean debuggable; |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
public boolean isSdkLibrary; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
public int recommendedInstallLocation; |
| 94 |
public int installLocation; |
| 95 |
|
| 96 |
public VerifierInfo[] verifiers; |
| 97 |
|
| 98 |
public PackageInfoLite() { |
| 99 |
} |
| 100 |
|
| 101 |
public String toString() { |
| 102 |
return "PackageInfoLite{" |
| 103 |
+ Integer.toHexString(System.identityHashCode(this)) |
| 104 |
+ " " + packageName + "}"; |
| 105 |
} |
| 106 |
|
| 107 |
public int describeContents() { |
| 108 |
return 0; |
| 109 |
} |
| 110 |
|
| 111 |
public void writeToParcel(Parcel dest, int parcelableFlags) { |
| 112 |
dest.writeString(packageName); |
| 113 |
dest.writeStringArray(splitNames); |
| 114 |
dest.writeInt(versionCode); |
| 115 |
dest.writeInt(versionCodeMajor); |
| 116 |
dest.writeInt(baseRevisionCode); |
| 117 |
dest.writeIntArray(splitRevisionCodes); |
| 118 |
dest.writeInt(recommendedInstallLocation); |
| 119 |
dest.writeInt(installLocation); |
| 120 |
dest.writeInt(multiArch ? 1 : 0); |
| 121 |
dest.writeInt(debuggable ? 1 : 0); |
| 122 |
|
| 123 |
if (verifiers == null || verifiers.length == 0) { |
| 124 |
dest.writeInt(0); |
| 125 |
} else { |
| 126 |
dest.writeInt(verifiers.length); |
| 127 |
dest.writeTypedArray(verifiers, parcelableFlags); |
| 128 |
} |
| 129 |
} |
| 130 |
|
| 131 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 132 |
public static final @android.annotation.NonNull Parcelable.Creator<PackageInfoLite> CREATOR |
| 133 |
= new Parcelable.Creator<PackageInfoLite>() { |
| 134 |
public PackageInfoLite createFromParcel(Parcel source) { |
| 135 |
return new PackageInfoLite(source); |
| 136 |
} |
| 137 |
|
| 138 |
public PackageInfoLite[] newArray(int size) { |
| 139 |
return new PackageInfoLite[size]; |
| 140 |
} |
| 141 |
}; |
| 142 |
|
| 143 |
private PackageInfoLite(Parcel source) { |
| 144 |
packageName = source.readString(); |
| 145 |
splitNames = source.createStringArray(); |
| 146 |
versionCode = source.readInt(); |
| 147 |
versionCodeMajor = source.readInt(); |
| 148 |
baseRevisionCode = source.readInt(); |
| 149 |
splitRevisionCodes = source.createIntArray(); |
| 150 |
recommendedInstallLocation = source.readInt(); |
| 151 |
installLocation = source.readInt(); |
| 152 |
multiArch = (source.readInt() != 0); |
| 153 |
debuggable = (source.readInt() != 0); |
| 154 |
|
| 155 |
final int verifiersLength = source.readInt(); |
| 156 |
if (verifiersLength == 0) { |
| 157 |
verifiers = new VerifierInfo[0]; |
| 158 |
} else { |
| 159 |
verifiers = new VerifierInfo[verifiersLength]; |
| 160 |
source.readTypedArray(verifiers, VerifierInfo.CREATOR); |
| 161 |
} |
| 162 |
} |
| 163 |
} |