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

Commit 4ac78a18 authored by Steven Moreland's avatar Steven Moreland Committed by Gerrit Code Review
Browse files

Merge changes from topic "aidl-partition-check" into main

* changes:
  libbinder: integration test for stability
  libprocpartition: support product/system_ext
parents 1f55f7d4 869c4e24
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ namespace procpartition {
enum class Partition {
    UNKNOWN = 0,
    SYSTEM,
    SYSTEM_EXT,
    PRODUCT,
    VENDOR,
    ODM
};
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@ namespace procpartition {
std::ostream& operator<<(std::ostream& os, Partition p) {
    switch (p) {
        case Partition::SYSTEM: return os << "system";
        case Partition::SYSTEM_EXT: return os << "system_ext";
        case Partition::PRODUCT: return os << "product";
        case Partition::VENDOR: return os << "vendor";
        case Partition::ODM: return os << "odm";
        case Partition::UNKNOWN: // fallthrough
@@ -57,6 +59,12 @@ Partition parsePartition(const std::string& s) {
    if (s == "system") {
        return Partition::SYSTEM;
    }
    if (s == "system_ext") {
        return Partition::SYSTEM_EXT;
    }
    if (s == "product") {
        return Partition::PRODUCT;
    }
    if (s == "vendor") {
        return Partition::VENDOR;
    }
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@
    {
      "name": "binderStabilityTest"
    },
    {
      "name": "binderStabilityIntegrationTest"
    },
    {
      "name": "binderRpcWireProtocolTest"
    },
+6 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <binder/IBinder.h>
#include <string>

class BinderStabilityIntegrationTest_ExpectedStabilityForItsPartition_Test;

namespace android {

class BpBinder;
@@ -127,6 +129,8 @@ private:
    // through Parcel)
    friend ::android::ProcessState;

    friend ::BinderStabilityIntegrationTest_ExpectedStabilityForItsPartition_Test;

    static void tryMarkCompilationUnit(IBinder* binder);

    // Currently, we use int16_t for Level so that it can fit in BBinder.
@@ -156,11 +160,11 @@ private:
                                                                uint32_t flags);

    // get stability information as encoded on the wire
    static int16_t getRepr(IBinder* binder);
    LIBBINDER_EXPORTED static int16_t getRepr(IBinder* binder);

    // whether a transaction on binder is allowed, if the transaction
    // is done from a context with a specific stability level
    static bool check(int16_t provided, Level required);
    LIBBINDER_EXPORTED static bool check(int16_t provided, Level required);

    static bool isDeclaredLevel(int32_t level);
    static std::string levelString(int32_t level);
+22 −0
Original line number Diff line number Diff line
@@ -802,6 +802,28 @@ cc_test {
    require_root: true,
}

cc_test {
    name: "binderStabilityIntegrationTest",
    defaults: ["binder_test_defaults"],
    srcs: [
        "binderStabilityIntegrationTest.cpp",
    ],

    shared_libs: [
        "libbinder",
        "libutils",
    ],
    static_libs: [
        "libprocpartition",
    ],

    test_suites: [
        "general-tests",
        "vts",
    ],
    require_root: true,
}

cc_test {
    name: "binderAllocationLimits",
    defaults: ["binder_test_defaults"],
Loading