Merge "Add APIs to find out the time when a process was created." into nyc-dev am: ef1971ffc5
am: 623ebce5fb
* commit '623ebce5fb9041968c324b418e029df85b13b61e':
Add APIs to find out the time when a process was created.
This commit is contained in:
@@ -29054,6 +29054,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();
|
||||
|
||||
@@ -31345,6 +31345,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();
|
||||
|
||||
@@ -29065,6 +29065,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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user