Merge "Add minSdk to dumpsys" into nyc-dev
am: 1374af2c7b
* commit '1374af2c7be265701b9b402b7d4749ffe716ef01':
Add minSdk to dumpsys
This commit is contained in:
@@ -706,6 +706,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
*/
|
||||
public int uid;
|
||||
|
||||
/**
|
||||
* The minimum SDK version this application can run on. It will not run
|
||||
* on earlier versions.
|
||||
*/
|
||||
public String minSdkVersion;
|
||||
|
||||
/**
|
||||
* The minimum SDK version this application targets. It may run on earlier
|
||||
* versions, but it knows how to work with any new behavior added at this
|
||||
@@ -790,7 +796,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
pw.println(prefix + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
|
||||
}
|
||||
}
|
||||
pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion
|
||||
pw.println(prefix + "enabled=" + enabled
|
||||
+ " minSdkVersion=" + minSdkVersion
|
||||
+ " targetSdkVersion=" + targetSdkVersion
|
||||
+ " versionCode=" + versionCode);
|
||||
if ((flags&DUMP_FLAG_DETAILS) != 0) {
|
||||
if (manageSpaceActivityName != null) {
|
||||
@@ -884,6 +892,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
deviceEncryptedDataDir = orig.deviceEncryptedDataDir;
|
||||
credentialEncryptedDataDir = orig.credentialEncryptedDataDir;
|
||||
uid = orig.uid;
|
||||
minSdkVersion = orig.minSdkVersion;
|
||||
targetSdkVersion = orig.targetSdkVersion;
|
||||
versionCode = orig.versionCode;
|
||||
enabled = orig.enabled;
|
||||
@@ -938,6 +947,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
dest.writeString(deviceEncryptedDataDir);
|
||||
dest.writeString(credentialEncryptedDataDir);
|
||||
dest.writeInt(uid);
|
||||
dest.writeString(minSdkVersion);
|
||||
dest.writeInt(targetSdkVersion);
|
||||
dest.writeInt(versionCode);
|
||||
dest.writeInt(enabled ? 1 : 0);
|
||||
@@ -992,6 +1002,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
deviceEncryptedDataDir = source.readString();
|
||||
credentialEncryptedDataDir = source.readString();
|
||||
uid = source.readInt();
|
||||
minSdkVersion = source.readString();
|
||||
targetSdkVersion = source.readInt();
|
||||
versionCode = source.readInt();
|
||||
enabled = source.readInt() != 0;
|
||||
|
||||
@@ -1524,6 +1524,7 @@ public class PackageParser {
|
||||
childPkg.baseRevisionCode = parentPkg.baseRevisionCode;
|
||||
childPkg.mVersionName = parentPkg.mVersionName;
|
||||
childPkg.applicationInfo.targetSdkVersion = parentPkg.applicationInfo.targetSdkVersion;
|
||||
childPkg.applicationInfo.minSdkVersion = parentPkg.applicationInfo.minSdkVersion;
|
||||
|
||||
childPkg = parseBaseApkCommon(childPkg, CHILD_PACKAGE_TAGS, res, parser, flags, outError);
|
||||
if (childPkg == null) {
|
||||
@@ -1854,10 +1855,16 @@ public class PackageParser {
|
||||
com.android.internal.R.styleable.AndroidManifestUsesSdk_targetSdkVersion);
|
||||
if (val != null) {
|
||||
if (val.type == TypedValue.TYPE_STRING && val.string != null) {
|
||||
targetCode = minCode = val.string.toString();
|
||||
targetCode = val.string.toString();
|
||||
if (minCode == null) {
|
||||
minCode = targetCode;
|
||||
}
|
||||
} else {
|
||||
// If it's not a string, it's an integer.
|
||||
targetVers = val.data;
|
||||
if (minVers == 0) {
|
||||
minVers = targetVers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1883,11 +1890,14 @@ public class PackageParser {
|
||||
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
|
||||
return null;
|
||||
}
|
||||
pkg.applicationInfo.minSdkVersion = minCode;
|
||||
} else if (minVers > SDK_VERSION) {
|
||||
outError[0] = "Requires newer sdk version #" + minVers
|
||||
+ " (current version is #" + SDK_VERSION + ")";
|
||||
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
|
||||
return null;
|
||||
} else {
|
||||
pkg.applicationInfo.minSdkVersion = Integer.toString(minVers);
|
||||
}
|
||||
|
||||
if (targetCode != null) {
|
||||
|
||||
@@ -4291,6 +4291,7 @@ final class Settings {
|
||||
}
|
||||
pw.print(prefix); pw.print(" versionCode="); pw.print(ps.versionCode);
|
||||
if (ps.pkg != null) {
|
||||
pw.print(" minSdk="); pw.print(ps.pkg.applicationInfo.minSdkVersion);
|
||||
pw.print(" targetSdk="); pw.print(ps.pkg.applicationInfo.targetSdkVersion);
|
||||
}
|
||||
pw.println();
|
||||
|
||||
Reference in New Issue
Block a user