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

Commit 0fec9368 authored by Andrew Grieve's avatar Andrew Grieve Committed by Richard Coles
Browse files

Expose Process.isIsolated()

Rather than have a process attempt to perform IO / IPC and check if it
fails, it makes much more sense to expose this getter.

My specific motivation for exposing this information more directly is to
be able to perform process-specific initialization logic in
Application.attachBaseContext():

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java?rcl=ac2e180a1265f88dd4030bb35d69f5d0b2dc488d&l=54

Bug: 73343822
Test: Same code that's used in Chrome via reflection.
Change-Id: I1505962679da36ac42401230b204bff7b3376b73
parent e84c506f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33586,6 +33586,7 @@ package android.os {
    method public static final int getUidForName(java.lang.String);
    method public static final boolean is64Bit();
    method public static boolean isApplicationUid(int);
    method public static final boolean isIsolated();
    method public static final void killProcess(int);
    method public static final int myPid();
    method public static final int myTid();
+0 −1
Original line number Diff line number Diff line
@@ -1284,7 +1284,6 @@ Landroid/os/Process;->getPids(Ljava/lang/String;[I)[I
Landroid/os/Process;->getTotalMemory()J
Landroid/os/Process;->getUidForPid(I)I
Landroid/os/Process;->isIsolated(I)Z
Landroid/os/Process;->isIsolated()Z
Landroid/os/Process;->readProcFile(Ljava/lang/String;[I[Ljava/lang/String;[J[F)Z
Landroid/os/Process;->readProcLines(Ljava/lang/String;[Ljava/lang/String;[J)V
Landroid/os/RecoverySystem;->cancelScheduledUpdate(Landroid/content/Context;)V
+0 −1
Original line number Diff line number Diff line
@@ -599,7 +599,6 @@ public class Process {

    /**
     * Returns whether the current process is in an isolated sandbox.
     * @hide
     */
    public static final boolean isIsolated() {
        return isIsolated(myUid());