Skip to content
This repository was archived by the owner on Nov 25, 2017. It is now read-only.

Commit a348ace

Browse files
committed
Fix media scanner
1 parent 2f58db3 commit a348ace

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/main/java/com/lody/virtual/client/hook/patchs/am/BroadcastIntent.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ public Object call(Object who, Method method, Object... args) throws Throwable {
4545
values.put("mime_type", mime);
4646
values.put("_data", intent.getData().getPath());
4747
VLog.d(getName(), "try " + values);
48-
VirtualCore.get().getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
48+
if (mime.startsWith("image"))
49+
VirtualCore.get().getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
50+
else if (mime.startsWith("video"))
51+
VirtualCore.get().getContext().getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, values);
52+
else if (mime.startsWith("audio"))
53+
VirtualCore.get().getContext().getContentResolver().insert(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, values);
4954
}
5055
if (VirtualCore.get().getComponentDelegate() != null) {
5156
if (!VirtualCore.get().getComponentDelegate().onSendBroadcast(intent)) return null;

0 commit comments

Comments
 (0)