文件管理器里无法显示OTG文件夹

修改frameworks/base/services/core/java/com/android/server/MountService.java文件中的onVolumeCreatedLocked函数将如下行

   // Adoptable public disks are visible to apps, since they meet

   // public API requirement of being in a stable location.

   if (vol.disk.isAdoptable() || vol.isPhoneStorage()) {

         vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;

   }

   改成

   // Adoptable public disks are visible to apps, since they meet

   // public API requirement of being in a stable location.

   if (vol.disk.isAdoptable() || vol.isPhoneStorage() || vol.isUSBOTG()) {

    //额外增加USBOTG

         vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;

   }

    原文作者:突突突突击队
    原文地址: https://blog.csdn.net/lywpljw/article/details/80339074
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞