* commit 'ebd6a2d2710ebf7196a399d6d5a2f0745844310b': Release DrmManagerClient resources
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user