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

Commit adcf38c9 authored by Marco Nelissen's avatar Marco Nelissen Committed by Gerrit Code Review
Browse files

Merge "Release DrmManagerClient resources"

parents 8c2d70f5 1b37c3bd
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1280,6 +1280,14 @@ public class MediaScanner
        mMediaProvider = null;
    }

    private void releaseResources() {
        // release the DrmManagerClient resources
        if (mDrmManagerClient != null) {
            mDrmManagerClient.release();
            mDrmManagerClient = null;
        }
    }

    private void initialize(String volumeName) {
        mMediaProvider = mContext.getContentResolver().acquireProvider("media");

@@ -1340,6 +1348,8 @@ public class MediaScanner
            Log.e(TAG, "UnsupportedOperationException in MediaScanner.scan()", e);
        } catch (RemoteException e) {
            Log.e(TAG, "RemoteException in MediaScanner.scan()", e);
        } finally {
            releaseResources();
        }
    }

@@ -1363,6 +1373,8 @@ public class MediaScanner
        } catch (RemoteException e) {
            Log.e(TAG, "RemoteException in MediaScanner.scanFile()", e);
            return null;
        } finally {
            releaseResources();
        }
    }

@@ -1477,6 +1489,7 @@ public class MediaScanner
            if (fileList != null) {
                fileList.close();
            }
            releaseResources();
        }
    }