Loading cmds/lshal/libprocpartition/include/procpartition/procpartition.h +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ namespace procpartition { enum class Partition { UNKNOWN = 0, SYSTEM, SYSTEM_EXT, PRODUCT, VENDOR, ODM }; Loading cmds/lshal/libprocpartition/procpartition.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; } Loading libs/binder/TEST_MAPPING +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ { "name": "binderStabilityTest" }, { "name": "binderStabilityIntegrationTest" }, { "name": "binderRpcWireProtocolTest" }, Loading libs/binder/include/binder/Stability.h +6 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <binder/IBinder.h> #include <string> class BinderStabilityIntegrationTest_ExpectedStabilityForItsPartition_Test; namespace android { class BpBinder; Loading Loading @@ -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. Loading Loading @@ -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); Loading libs/binder/tests/Android.bp +22 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
cmds/lshal/libprocpartition/include/procpartition/procpartition.h +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ namespace procpartition { enum class Partition { UNKNOWN = 0, SYSTEM, SYSTEM_EXT, PRODUCT, VENDOR, ODM }; Loading
cmds/lshal/libprocpartition/procpartition.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; } Loading
libs/binder/TEST_MAPPING +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ { "name": "binderStabilityTest" }, { "name": "binderStabilityIntegrationTest" }, { "name": "binderRpcWireProtocolTest" }, Loading
libs/binder/include/binder/Stability.h +6 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <binder/IBinder.h> #include <string> class BinderStabilityIntegrationTest_ExpectedStabilityForItsPartition_Test; namespace android { class BpBinder; Loading Loading @@ -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. Loading Loading @@ -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); Loading
libs/binder/tests/Android.bp +22 −0 Original line number Diff line number Diff line Loading @@ -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