Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b77455ee authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 78d68836: Implement tracking of package install times.

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

* commit '78d68836':
  Implement tracking of package install times.
parents 779a6e41 78d68836
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -48214,6 +48214,16 @@
 visibility="public"
>
</field>
<field name="firstInstallTime"
 type="long"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="gids"
 type="int[]"
 transient="false"
@@ -48236,6 +48246,16 @@
 visibility="public"
>
</field>
<field name="lastUpdateTime"
 type="long"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="packageName"
 type="java.lang.String"
 transient="false"
+16 −0
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }

    /**
+3 −1
Original line number Diff line number Diff line
@@ -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;
        }
+135 −34

File changed.

Preview size limit exceeded, changes collapsed.