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

Commit df380260 authored by Sanjana Sunil's avatar Sanjana Sunil Committed by Android (Google) Code Review
Browse files

Merge "Add a mainline-accessible API to kill an app on sandbox death"

parents 05bda468 46bb3e8a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ package android.content {
  }

  public abstract class Context {
    method @NonNull public android.os.IBinder getIApplicationThreadBinder();
    method @NonNull public android.os.UserHandle getUser();
    field public static final String PAC_PROXY_SERVICE = "pac_proxy";
    field public static final String TEST_NETWORK_SERVICE = "test_network";
+9 −0
Original line number Diff line number Diff line
@@ -416,6 +416,15 @@ public final class ApplicationExitInfo implements Parcelable {
     */
    public static final int SUBREASON_UNDELIVERED_BROADCAST = 26;

    /**
     * The process was killed because its associated SDK sandbox process (where it had loaded SDKs)
     * had died; this would be set only when the reason is {@link #REASON_DEPENDENCY_DIED}.
     *
     * For internal use only.
     * @hide
     */
    public static final int SUBREASON_SDK_SANDBOX_DIED = 27;

    // If there is any OEM code which involves additional app kill reasons, it should
    // be categorized in {@link #REASON_OTHER}, with subreason code starting from 1000.

+7 −0
Original line number Diff line number Diff line
@@ -2027,6 +2027,13 @@ class ContextImpl extends Context {
        return mMainThread.getApplicationThread();
    }

    /** @hide */
    @NonNull
    @Override
    public IBinder getIApplicationThreadBinder() {
        return getIApplicationThread().asBinder();
    }

    /** @hide */
    @Override
    public Handler getMainThreadHandler() {
+12 −0
Original line number Diff line number Diff line
@@ -7490,6 +7490,18 @@ public abstract class Context {
        throw new RuntimeException("Not implemented. Must override in a subclass.");
    }

    /**
     * Get the binder object associated with the IApplicationThread of this Context.
     *
     * This can be used by a mainline module to uniquely identify a specific app process.
     * @hide
     */
    @NonNull
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public IBinder getIApplicationThreadBinder() {
        throw new RuntimeException("Not implemented. Must override in a subclass.");
    }

    /**
     * @hide
     */
+8 −0
Original line number Diff line number Diff line
@@ -1273,6 +1273,14 @@ public class ContextWrapper extends Context {
        return mBase.getIApplicationThread();
    }

    /**
     * @hide
     */
    @Override
    public IBinder getIApplicationThreadBinder() {
        return mBase.getIApplicationThreadBinder();
    }

    /**
     * @hide
     */
Loading