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;
|
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
|
* 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
|
* 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 + "sharedLibraryFiles=" + Arrays.toString(sharedLibraryFiles));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pw.println(prefix + "enabled=" + enabled + " targetSdkVersion=" + targetSdkVersion
|
pw.println(prefix + "enabled=" + enabled
|
||||||
|
+ " minSdkVersion=" + minSdkVersion
|
||||||
|
+ " targetSdkVersion=" + targetSdkVersion
|
||||||
+ " versionCode=" + versionCode);
|
+ " versionCode=" + versionCode);
|
||||||
if ((flags&DUMP_FLAG_DETAILS) != 0) {
|
if ((flags&DUMP_FLAG_DETAILS) != 0) {
|
||||||
if (manageSpaceActivityName != null) {
|
if (manageSpaceActivityName != null) {
|
||||||
@@ -884,6 +892,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
deviceEncryptedDataDir = orig.deviceEncryptedDataDir;
|
deviceEncryptedDataDir = orig.deviceEncryptedDataDir;
|
||||||
credentialEncryptedDataDir = orig.credentialEncryptedDataDir;
|
credentialEncryptedDataDir = orig.credentialEncryptedDataDir;
|
||||||
uid = orig.uid;
|
uid = orig.uid;
|
||||||
|
minSdkVersion = orig.minSdkVersion;
|
||||||
targetSdkVersion = orig.targetSdkVersion;
|
targetSdkVersion = orig.targetSdkVersion;
|
||||||
versionCode = orig.versionCode;
|
versionCode = orig.versionCode;
|
||||||
enabled = orig.enabled;
|
enabled = orig.enabled;
|
||||||
@@ -938,6 +947,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
dest.writeString(deviceEncryptedDataDir);
|
dest.writeString(deviceEncryptedDataDir);
|
||||||
dest.writeString(credentialEncryptedDataDir);
|
dest.writeString(credentialEncryptedDataDir);
|
||||||
dest.writeInt(uid);
|
dest.writeInt(uid);
|
||||||
|
dest.writeString(minSdkVersion);
|
||||||
dest.writeInt(targetSdkVersion);
|
dest.writeInt(targetSdkVersion);
|
||||||
dest.writeInt(versionCode);
|
dest.writeInt(versionCode);
|
||||||
dest.writeInt(enabled ? 1 : 0);
|
dest.writeInt(enabled ? 1 : 0);
|
||||||
@@ -992,6 +1002,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
|||||||
deviceEncryptedDataDir = source.readString();
|
deviceEncryptedDataDir = source.readString();
|
||||||
credentialEncryptedDataDir = source.readString();
|
credentialEncryptedDataDir = source.readString();
|
||||||
uid = source.readInt();
|
uid = source.readInt();
|
||||||
|
minSdkVersion = source.readString();
|
||||||
targetSdkVersion = source.readInt();
|
targetSdkVersion = source.readInt();
|
||||||
versionCode = source.readInt();
|
versionCode = source.readInt();
|
||||||
enabled = source.readInt() != 0;
|
enabled = source.readInt() != 0;
|
||||||
|
|||||||
@@ -1524,6 +1524,7 @@ public class PackageParser {
|
|||||||
childPkg.baseRevisionCode = parentPkg.baseRevisionCode;
|
childPkg.baseRevisionCode = parentPkg.baseRevisionCode;
|
||||||
childPkg.mVersionName = parentPkg.mVersionName;
|
childPkg.mVersionName = parentPkg.mVersionName;
|
||||||
childPkg.applicationInfo.targetSdkVersion = parentPkg.applicationInfo.targetSdkVersion;
|
childPkg.applicationInfo.targetSdkVersion = parentPkg.applicationInfo.targetSdkVersion;
|
||||||
|
childPkg.applicationInfo.minSdkVersion = parentPkg.applicationInfo.minSdkVersion;
|
||||||
|
|
||||||
childPkg = parseBaseApkCommon(childPkg, CHILD_PACKAGE_TAGS, res, parser, flags, outError);
|
childPkg = parseBaseApkCommon(childPkg, CHILD_PACKAGE_TAGS, res, parser, flags, outError);
|
||||||
if (childPkg == null) {
|
if (childPkg == null) {
|
||||||
@@ -1854,10 +1855,16 @@ public class PackageParser {
|
|||||||
com.android.internal.R.styleable.AndroidManifestUsesSdk_targetSdkVersion);
|
com.android.internal.R.styleable.AndroidManifestUsesSdk_targetSdkVersion);
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
if (val.type == TypedValue.TYPE_STRING && val.string != 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 {
|
} else {
|
||||||
// If it's not a string, it's an integer.
|
// If it's not a string, it's an integer.
|
||||||
targetVers = val.data;
|
targetVers = val.data;
|
||||||
|
if (minVers == 0) {
|
||||||
|
minVers = targetVers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1883,11 +1890,14 @@ public class PackageParser {
|
|||||||
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
|
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
pkg.applicationInfo.minSdkVersion = minCode;
|
||||||
} else if (minVers > SDK_VERSION) {
|
} else if (minVers > SDK_VERSION) {
|
||||||
outError[0] = "Requires newer sdk version #" + minVers
|
outError[0] = "Requires newer sdk version #" + minVers
|
||||||
+ " (current version is #" + SDK_VERSION + ")";
|
+ " (current version is #" + SDK_VERSION + ")";
|
||||||
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
|
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
|
||||||
return null;
|
return null;
|
||||||
|
} else {
|
||||||
|
pkg.applicationInfo.minSdkVersion = Integer.toString(minVers);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetCode != null) {
|
if (targetCode != null) {
|
||||||
|
|||||||
@@ -4291,6 +4291,7 @@ final class Settings {
|
|||||||
}
|
}
|
||||||
pw.print(prefix); pw.print(" versionCode="); pw.print(ps.versionCode);
|
pw.print(prefix); pw.print(" versionCode="); pw.print(ps.versionCode);
|
||||||
if (ps.pkg != null) {
|
if (ps.pkg != null) {
|
||||||
|
pw.print(" minSdk="); pw.print(ps.pkg.applicationInfo.minSdkVersion);
|
||||||
pw.print(" targetSdk="); pw.print(ps.pkg.applicationInfo.targetSdkVersion);
|
pw.print(" targetSdk="); pw.print(ps.pkg.applicationInfo.targetSdkVersion);
|
||||||
}
|
}
|
||||||
pw.println();
|
pw.println();
|
||||||
|
|||||||
Reference in New Issue
Block a user