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

Commit 9f38c7f1 authored by Sandeep Bandaru's avatar Sandeep Bandaru
Browse files

Move hasBinders from hidden to Module API

Coverage is already added for this in BundleTests.

This API was added as hidden method in V and was only used in
system-server. This is now required to be used in
NeuralNetworks mainline module and requires to be a
non-hidden API.

Flag: android.os.enable_has_binders
Test: core/tests/coretests/src/android/os/BundleTest.java
Bug: 330345513

Change-Id: I581d25893c5f4945912f7f0c68dbed6fe867369e
parent d73e3332
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -379,6 +379,13 @@ package android.os {
    field public static final int DEVICE_INITIAL_SDK_INT;
  }

  public final class Bundle extends android.os.BaseBundle implements java.lang.Cloneable android.os.Parcelable {
    method @FlaggedApi("android.os.enable_has_binders") public int hasBinders();
    field @FlaggedApi("android.os.enable_has_binders") public static final int STATUS_BINDERS_NOT_PRESENT = 0; // 0x0
    field @FlaggedApi("android.os.enable_has_binders") public static final int STATUS_BINDERS_PRESENT = 1; // 0x1
    field @FlaggedApi("android.os.enable_has_binders") public static final int STATUS_BINDERS_UNKNOWN = 2; // 0x2
  }

  public class Handler {
    method @FlaggedApi("android.os.mainline_vcn_platform_api") public final boolean hasMessagesOrCallbacks();
    method @FlaggedApi("android.os.mainline_vcn_platform_api") public final void removeCallbacksAndEqualMessages(@Nullable Object);
+10 −3
Original line number Diff line number Diff line
@@ -18,10 +18,12 @@ package android.os;

import static java.util.Objects.requireNonNull;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.util.ArrayMap;
import android.util.Size;
@@ -72,16 +74,18 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
    /**
     * Status when the Bundle can <b>assert</b> that the underlying Parcel DOES NOT contain
     * Binder object(s).
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_ENABLE_HAS_BINDERS)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public static final int STATUS_BINDERS_NOT_PRESENT = 0;

    /**
     * Status when the Bundle can <b>assert</b> that there are Binder object(s) in the Parcel.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_ENABLE_HAS_BINDERS)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public static final int STATUS_BINDERS_PRESENT = 1;

    /**
@@ -94,9 +98,10 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
     * object to the Bundle but it is not possible to assert this fact unless the Bundle is written
     * to a Parcel.
     * </p>
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_ENABLE_HAS_BINDERS)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public static final int STATUS_BINDERS_UNKNOWN = 2;

    /** @hide */
@@ -417,6 +422,8 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
     * Returns a status indicating whether the bundle contains any parcelled Binder objects.
     * @hide
     */
    @FlaggedApi(Flags.FLAG_ENABLE_HAS_BINDERS)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public @HasBinderStatus int hasBinders() {
        if ((mFlags & FLAG_HAS_BINDERS_KNOWN) != 0) {
            if ((mFlags & FLAG_HAS_BINDERS) != 0) {
+9 −0
Original line number Diff line number Diff line
@@ -242,6 +242,15 @@ flag {
    bug: "317250784"
}

flag {
     namespace: "system_performance"
     name: "enable_has_binders"
     is_exported: true
     description: "Add hasBinders to Public API under a flag."
     is_fixed_read_only: true
     bug: "330345513"
}

flag {
     namespace: "system_performance"
     name: "perfetto_sdk_tracing"