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

Commit c806d539 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android Git Automerger
Browse files

am ebd6a2d2: am eded9e3b: am adcf38c9: Merge "Release DrmManagerClient resources"

* commit 'ebd6a2d2':
  Release DrmManagerClient resources
parents a77f358e ebd6a2d2
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1281,6 +1281,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");

@@ -1341,6 +1349,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();
        }
    }

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

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