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

Commit ef1971ff authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Add APIs to find out the time when a process was created." into nyc-dev

parents 6bce68ed d98885c1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -29048,6 +29048,8 @@ package android.os {
    ctor public Process();
    method public static final long getElapsedCpuTime();
    method public static final int getGidForName(java.lang.String);
    method public static final long getStartElapsedRealtime();
    method public static final long getStartUptimeMillis();
    method public static final int getThreadPriority(int) throws java.lang.IllegalArgumentException;
    method public static final int getUidForName(java.lang.String);
    method public static final boolean is64Bit();
+2 −0
Original line number Diff line number Diff line
@@ -31339,6 +31339,8 @@ package android.os {
    ctor public Process();
    method public static final long getElapsedCpuTime();
    method public static final int getGidForName(java.lang.String);
    method public static final long getStartElapsedRealtime();
    method public static final long getStartUptimeMillis();
    method public static final int getThreadPriority(int) throws java.lang.IllegalArgumentException;
    method public static final int getUidForName(java.lang.String);
    method public static final boolean is64Bit();
+2 −0
Original line number Diff line number Diff line
@@ -29059,6 +29059,8 @@ package android.os {
    ctor public Process();
    method public static final long getElapsedCpuTime();
    method public static final int getGidForName(java.lang.String);
    method public static final long getStartElapsedRealtime();
    method public static final long getStartUptimeMillis();
    method public static final int getThreadPriority(int) throws java.lang.IllegalArgumentException;
    method public static final int getUidForName(java.lang.String);
    method public static final boolean is64Bit();
+3 −0
Original line number Diff line number Diff line
@@ -4909,6 +4909,9 @@ public final class ActivityThread {
            DdmVmInternal.enableRecentAllocations(true);
        }

        // Note when this process has started.
        Process.setStartTimes(SystemClock.elapsedRealtime(), SystemClock.uptimeMillis());

        mBoundApplication = data;
        mConfiguration = new Configuration(data.config);
        mCompatConfiguration = new Configuration(data.config);
+23 −0
Original line number Diff line number Diff line
@@ -383,6 +383,9 @@ public class Process {
    public static final int SIGNAL_KILL = 9;
    public static final int SIGNAL_USR1 = 10;

    private static long sStartElapsedRealtime;
    private static long sStartUptimeMillis;

    /**
     * State for communicating with the zygote process.
     *
@@ -771,6 +774,26 @@ public class Process {
     */
    public static final native long getElapsedCpuTime();

    /**
     * Return the {@link SystemClock#elapsedRealtime()} at which this process was started.
     */
    public static final long getStartElapsedRealtime() {
        return sStartElapsedRealtime;
    }

    /**
     * Return the {@link SystemClock#uptimeMillis()} at which this process was started.
     */
    public static final long getStartUptimeMillis() {
        return sStartUptimeMillis;
    }

    /** @hide */
    public static final void setStartTimes(long elapsedRealtime, long uptimeMillis) {
        sStartElapsedRealtime = elapsedRealtime;
        sStartUptimeMillis = uptimeMillis;
    }

    /**
     * Returns true if the current process is a 64-bit runtime.
     */