am 78d68836: Implement tracking of package install times.

Merge commit '78d688369a2240009d3bbe4126996a973b2e2fe2' into gingerbread-plus-aosp

* commit '78d688369a2240009d3bbe4126996a973b2e2fe2':
  Implement tracking of package install times.
This commit is contained in:
Dianne Hackborn
2010-10-07 20:13:24 -07:00
committed by Android Git Automerger
5 changed files with 175 additions and 36 deletions

View File

@@ -64,6 +64,18 @@ public class PackageInfo implements Parcelable {
*/
public ApplicationInfo applicationInfo;
/**
* The time at which the app was first installed. Units are as
* per {@link System#currentTimeMillis()}.
*/
public long firstInstallTime;
/**
* The time at which the app was last updated. Units are as
* per {@link System#currentTimeMillis()}.
*/
public long lastUpdateTime;
/**
* All kernel group-IDs that have been assigned to this package.
* This is only filled in if the flag {@link PackageManager#GET_GIDS} was set.
@@ -207,6 +219,8 @@ public class PackageInfo implements Parcelable {
} else {
dest.writeInt(0);
}
dest.writeLong(firstInstallTime);
dest.writeLong(lastUpdateTime);
dest.writeIntArray(gids);
dest.writeTypedArray(activities, parcelableFlags);
dest.writeTypedArray(receivers, parcelableFlags);
@@ -242,6 +256,8 @@ public class PackageInfo implements Parcelable {
if (hasApp != 0) {
applicationInfo = ApplicationInfo.CREATOR.createFromParcel(source);
}
firstInstallTime = source.readLong();
lastUpdateTime = source.readLong();
gids = source.createIntArray();
activities = source.createTypedArray(ActivityInfo.CREATOR);
receivers = source.createTypedArray(ActivityInfo.CREATOR);

View File

@@ -1891,7 +1891,7 @@ public abstract class PackageManager {
if (pkg == null) {
return null;
}
return PackageParser.generatePackageInfo(pkg, null, flags);
return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0);
}
/**

View File

@@ -187,7 +187,7 @@ public class PackageParser {
* @param flags indicating which optional information is included.
*/
public static PackageInfo generatePackageInfo(PackageParser.Package p,
int gids[], int flags) {
int gids[], int flags, long firstInstallTime, long lastUpdateTime) {
PackageInfo pi = new PackageInfo();
pi.packageName = p.packageName;
@@ -197,6 +197,8 @@ public class PackageParser {
pi.sharedUserLabel = p.mSharedUserLabel;
pi.applicationInfo = p.applicationInfo;
pi.installLocation = p.installLocation;
pi.firstInstallTime = firstInstallTime;
pi.lastUpdateTime = lastUpdateTime;
if ((flags&PackageManager.GET_GIDS) != 0) {
pi.gids = gids;
}