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

Commit 8c0164ca authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix clang-tidy warnings in drm.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: Idf1c48d7bfe3f0da20401cb3ff1983ec00be170d
parent 67fbddfd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@

using namespace android;

DrmInfoEvent::DrmInfoEvent(int uniqueId, int infoType, const String8 message)
DrmInfoEvent::DrmInfoEvent(int uniqueId, int infoType, const String8 &message)
    : mUniqueId(uniqueId),
      mInfoType(infoType),
      mMessage(message) {
+3 −3
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ DecryptHandle* DrmManager::openDecryptSession(
        handle->decryptId = mDecryptSessionId + 1;

        for (size_t index = 0; index < plugInIdList.size(); index++) {
            String8 plugInId = plugInIdList.itemAt(index);
            const String8& plugInId = plugInIdList.itemAt(index);
            IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
            result = rDrmEngine.openDecryptSession(uniqueId, handle, fd, offset, length, mime);

@@ -441,7 +441,7 @@ DecryptHandle* DrmManager::openDecryptSession(
        handle->decryptId = mDecryptSessionId + 1;

        for (size_t index = 0; index < plugInIdList.size(); index++) {
            String8 plugInId = plugInIdList.itemAt(index);
            const String8& plugInId = plugInIdList.itemAt(index);
            IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
            result = rDrmEngine.openDecryptSession(uniqueId, handle, uri, mime);

@@ -470,7 +470,7 @@ DecryptHandle* DrmManager::openDecryptSession(
        handle->decryptId = mDecryptSessionId + 1;

        for (size_t index = 0; index < plugInIdList.size(); index++) {
            String8 plugInId = plugInIdList.itemAt(index);
            const String8& plugInId = plugInIdList.itemAt(index);
            IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
            result = rDrmEngine.openDecryptSession(uniqueId, handle, buf, mimeType);

+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public:
class BpDrmManagerService: public BpInterface<IDrmManagerService>
{
public:
    BpDrmManagerService(const sp<IBinder>& impl)
    explicit BpDrmManagerService(const sp<IBinder>& impl)
            : BpInterface<IDrmManagerService>(impl) {}

    virtual int addUniqueId(bool isNative);
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public:
class BpDrmServiceListener: public BpInterface<IDrmServiceListener>
{
public:
    BpDrmServiceListener(const sp<IBinder>& impl)
    explicit BpDrmServiceListener(const sp<IBinder>& impl)
            : BpInterface<IDrmServiceListener>(impl) {}

    virtual status_t notify(const DrmInfoEvent& event);
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ class DecodeSession {
            offset = 0;
        }

        DecodeSession(int fd) {
        explicit DecodeSession(int fd) {
            fileDesc = fd;
            offset = 0;
        }
Loading