summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2019-01-28 18:34:27 +0000
committerNeil Fuller <nfuller@google.com>2019-01-29 19:47:55 +0000
commit54d244d3ee96e2747b3217f10226deff6f65505c (patch)
tree488eab1ec81307a32cfba2fc27e6abda0f8ac6a5
parent51588c82bd37ed5bf7e5c7c1518ecc1d0c712c2f (diff)
Make the ZygoteHooks API more consistent
Make the ZygoteHooks API more consistent by making the API entirely "static". Bug: 111742291 Test: build / boot / treehugger Merged-In: Ide38a9640a4d9f7a7621b8405a9732573f7420cf Change-Id: Ide38a9640a4d9f7a7621b8405a9732573f7420cf
-rw-r--r--dalvik/src/main/java/dalvik/system/ZygoteHooks.java14
-rw-r--r--mmodules/core_platform_api/api/platform/current-api.txt9
2 files changed, 11 insertions, 12 deletions
diff --git a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
index 5ae9f23043..13769e137e 100644
--- a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
+++ b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
@@ -30,10 +30,10 @@ import java.io.File;
*/
@libcore.api.CorePlatformApi
public final class ZygoteHooks {
- private long token;
+ private static long token;
- @libcore.api.CorePlatformApi
- public ZygoteHooks() {
+ /** All methods are static, no need to instantiate. */
+ private ZygoteHooks() {
}
/**
@@ -101,7 +101,7 @@ public final class ZygoteHooks {
* the child process.
*/
@libcore.api.CorePlatformApi
- public void preFork() {
+ public static void preFork() {
Daemons.stop();
token = nativePreFork();
waitUntilAllThreadsStopped();
@@ -112,7 +112,7 @@ public final class ZygoteHooks {
* before {@code postForkChild} for system server.
*/
@libcore.api.CorePlatformApi
- public void postForkSystemServer() {
+ public static void postForkSystemServer() {
nativePostForkSystemServer();
}
@@ -122,7 +122,7 @@ public final class ZygoteHooks {
* {@code instructionSet} determines whether to use a native bridge.
*/
@libcore.api.CorePlatformApi
- public void postForkChild(int runtimeFlags, boolean isSystemServer, boolean isZygote,
+ public static void postForkChild(int runtimeFlags, boolean isSystemServer, boolean isZygote,
String instructionSet) {
nativePostForkChild(token, runtimeFlags, isSystemServer, isZygote, instructionSet);
@@ -135,7 +135,7 @@ public final class ZygoteHooks {
* {@code postForkChild}.
*/
@libcore.api.CorePlatformApi
- public void postForkCommon() {
+ public static void postForkCommon() {
Daemons.startPostZygoteFork();
nativePostZygoteFork();
}
diff --git a/mmodules/core_platform_api/api/platform/current-api.txt b/mmodules/core_platform_api/api/platform/current-api.txt
index d2ecf2976b..5a3c59ca88 100644
--- a/mmodules/core_platform_api/api/platform/current-api.txt
+++ b/mmodules/core_platform_api/api/platform/current-api.txt
@@ -795,14 +795,13 @@ package dalvik.system {
}
public final class ZygoteHooks {
- ctor public ZygoteHooks();
method public static void gcAndFinalize();
method public static void onBeginPreload();
method public static void onEndPreload();
- method public void postForkChild(int, boolean, boolean, String);
- method public void postForkCommon();
- method public void postForkSystemServer();
- method public void preFork();
+ method public static void postForkChild(int, boolean, boolean, String);
+ method public static void postForkCommon();
+ method public static void postForkSystemServer();
+ method public static void preFork();
method public static void startZygoteNoThreadCreation();
method public static void stopZygoteNoThreadCreation();
}