Android 11 每次插入U盘都自动创建了很多文件夹 (Podcast Ringtones Music Alarm Notification Pictures Movies Download DCIM Documents Audiobo
Android 11 每次插入U盘都自动创建了很多文件夹
(Podcast Ringtones Music Alarm Notification Pictures Movies Download DCIM Documents Audiobooks 等)
修改路径 package/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
diff --git a/MediaProvider/src/com/android/providers/media/MediaProvider.java b/MediaProvider/src/com/android/providers/media/MediaProvider.javaindex 13a17ac..37ef123 100644--- a/MediaProvider/src/com/android/providers/media/MediaProvider.java+++ b/MediaProvider/src/com/android/providers/media/MediaProvider.java@@ -824,7 +824,8 @@ public class MediaProvider extends ContentProvider { if (vol.isPrimary()) { key = "created_default_folders"; } else {- key = "created_default_folders_" + vol.getMediaStoreVolumeName();+ //key = "created_default_folders_" + vol.getMediaStoreVolumeName(); //delete by gyx+ return; } final SharedPreferences prefs = PreferenceManager@@ -856,6 +857,13 @@ public class MediaProvider extends ContentProvider { private void ensureThumbnailsValid(@NonNull String volumeName, @NonNull sqliteDatabase db) { final String uuidFromDatabase = DatabaseHelper.getOrCreateUuid(db); try {++ //add by gyx+ final File path = getVolumePath(volumeName);+ final StorageVolume vol = mStorageManager.getStorageVolume(path);+ if(!vol.isPrimary())return;+ //end+ for (File dir : getThumbnailDirectories(volumeName)) { if (!dir.exists()) { dir.mkdirs();
来源地址:https://blog.csdn.net/weixin_35649059/article/details/129796179
--结束END--
本文标题: Android 每次插入U盘自动创建了不需要的文件夹
本文链接: https://lsjlt.com/news/398544.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0