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