From 5c53f4a047e1ee4e6ba34e52a7fba58b191f2d6b Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Wed, 17 Nov 2021 11:27:10 -0800 Subject: [PATCH] Improve the javadoc for the new Process APIs. Fix: 206696542 Test: treehugger Change-Id: Iab420163f7970d2c5036e997f567812bf31fca22 --- core/java/android/os/Process.java | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index c9670ff93f606..742a542efdd11 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -742,7 +742,8 @@ public class Process { public static final native long getElapsedCpuTime(); /** - * Return the {@link SystemClock#elapsedRealtime()} at which this process was started. + * Return the {@link SystemClock#elapsedRealtime()} at which this process was started, + * but before any of the application code was executed. */ @ElapsedRealtimeLong public static long getStartElapsedRealtime() { @@ -750,7 +751,8 @@ public class Process { } /** - * Return the {@link SystemClock#uptimeMillis()} at which this process was started. + * Return the {@link SystemClock#uptimeMillis()} at which this process was started, + * but before any of the application code was executed. */ @UptimeMillisLong public static long getStartUptimeMillis() { @@ -758,8 +760,12 @@ public class Process { } /** - * Return the {@link SystemClock#elapsedRealtime()} at which the system decides to start - * this process. + * Return the {@link SystemClock#elapsedRealtime()} at which the system was about to + * start this process. i.e. before a zygote fork. + * + *

More precisely, the system may start app processes before there's a start request, + * in order to reduce the process start up latency, in which case this is set when the system + * decides to "specialize" the process into a requested app. */ @ElapsedRealtimeLong public static long getStartRequestedElapsedRealtime() { @@ -767,8 +773,12 @@ public class Process { } /** - * Return the {@link SystemClock#uptimeMillis()} at which the system decides to start - * this process. + * Return the {@link SystemClock#uptimeMillis()} at which the system was about to + * start this process. i.e. before a zygote fork. + * + *

More precisely, the system may start app processes before there's a start request, + * in order to reduce the process start up latency, in which case this is set when the system + * decides to "specialize" the process into a requested app. */ @UptimeMillisLong public static long getStartRequestedUptimeMillis() { @@ -1195,7 +1205,8 @@ public class Process { private static native void setArgV0Native(String text); /** - * Return the name of this process. + * Return the name of this process. By default, the process name is the same as the app's + * package name, but this can be changed using {@code android:process}. */ @NonNull public static String myProcessName() {