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

Commit f4ffd8cb authored by Steven Moreland's avatar Steven Moreland Committed by android-build-merger
Browse files

Merge "libbinder_ndk: ScopedAResource into impl namespace" am: 4cf7bb91

am: f1a0fe4f

Change-Id: I0ae4137a2c0dfe636aa6c4c260e3e052bdf92126
parents 49039cac f1a0fe4f
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -109,6 +109,8 @@ class SpAIBinder {
    AIBinder* mBinder = nullptr;
    AIBinder* mBinder = nullptr;
};
};


namespace impl {

/**
/**
 * This baseclass owns a single object, used to make various classes RAII.
 * This baseclass owns a single object, used to make various classes RAII.
 */
 */
@@ -169,10 +171,12 @@ class ScopedAResource {
    T mT;
    T mT;
};
};


}  // namespace impl

/**
/**
 * Convenience wrapper. See AParcel.
 * Convenience wrapper. See AParcel.
 */
 */
class ScopedAParcel : public ScopedAResource<AParcel*, void, AParcel_delete, nullptr> {
class ScopedAParcel : public impl::ScopedAResource<AParcel*, void, AParcel_delete, nullptr> {
   public:
   public:
    /**
    /**
     * Takes ownership of a.
     * Takes ownership of a.
@@ -185,7 +189,7 @@ class ScopedAParcel : public ScopedAResource<AParcel*, void, AParcel_delete, nul
/**
/**
 * Convenience wrapper. See AStatus.
 * Convenience wrapper. See AStatus.
 */
 */
class ScopedAStatus : public ScopedAResource<AStatus*, void, AStatus_delete, nullptr> {
class ScopedAStatus : public impl::ScopedAResource<AStatus*, void, AStatus_delete, nullptr> {
   public:
   public:
    /**
    /**
     * Takes ownership of a.
     * Takes ownership of a.
@@ -209,7 +213,7 @@ class ScopedAStatus : public ScopedAResource<AStatus*, void, AStatus_delete, nul
 * Convenience wrapper. See AIBinder_DeathRecipient.
 * Convenience wrapper. See AIBinder_DeathRecipient.
 */
 */
class ScopedAIBinder_DeathRecipient
class ScopedAIBinder_DeathRecipient
    : public ScopedAResource<AIBinder_DeathRecipient*, void, AIBinder_DeathRecipient_delete,
    : public impl::ScopedAResource<AIBinder_DeathRecipient*, void, AIBinder_DeathRecipient_delete,
                                   nullptr> {
                                   nullptr> {
   public:
   public:
    /**
    /**
@@ -225,7 +229,7 @@ class ScopedAIBinder_DeathRecipient
 * Convenience wrapper. See AIBinder_Weak.
 * Convenience wrapper. See AIBinder_Weak.
 */
 */
class ScopedAIBinder_Weak
class ScopedAIBinder_Weak
    : public ScopedAResource<AIBinder_Weak*, void, AIBinder_Weak_delete, nullptr> {
    : public impl::ScopedAResource<AIBinder_Weak*, void, AIBinder_Weak_delete, nullptr> {
   public:
   public:
    /**
    /**
     * Takes ownership of a.
     * Takes ownership of a.
@@ -243,7 +247,7 @@ class ScopedAIBinder_Weak
/**
/**
 * Convenience wrapper for a file descriptor.
 * Convenience wrapper for a file descriptor.
 */
 */
class ScopedFileDescriptor : public ScopedAResource<int, int, close, -1> {
class ScopedFileDescriptor : public impl::ScopedAResource<int, int, close, -1> {
   public:
   public:
    /**
    /**
     * Takes ownership of a.
     * Takes ownership of a.