Android设置去掉 外部USB存储和默认存储选项

去掉USB外部存储

diff --git a/packages/apps/Settings/src/com/android/settings/deviceinfo/Memory.java b/packages/apps/Settings/src/com/android/settings/
old mode 100644
new mode 100755
index c98e9f3..3a1bc24
--- a/packages/apps/Settings/src/com/android/settings/deviceinfo/Memory.java
+++ b/packages/apps/Settings/src/com/android/settings/deviceinfo/Memory.java
@@ -117,7 +117,8 @@ public class Memory extends SettingsPreferenceFragment implements Indexable {
         }

        for (StorageVolume volume : storageVolumes) {
-            if (mMemoryExts.isAddPhysicalCategory(volume)) {
+                  Log.v("AZ","[Memory.StorageVolume]StorageId:" + volume.getStorageId()+",Path:" + volume.getPath());
+            if (mMemoryExts.isAddPhysicalCategory(volume) && !"/storage/usbotg".equals(volume.getPath())) {
                 addCategory(StorageVolumePreferenceCategory.buildForPhysical(context, volume));
             }
         }

去掉默认存储选项

diff --git a/packages/apps/Settings/src/com/mediatek/settings/deviceinfo/MemoryExts.java b/packages/apps/Settings/src/com/mediatek/set
index fe7c713..2f016da 100755
--- a/packages/apps/Settings/src/com/mediatek/settings/deviceinfo/MemoryExts.java
+++ b/packages/apps/Settings/src/com/mediatek/settings/deviceinfo/MemoryExts.java
@@ -265,7 +265,7 @@ public class MemoryExts {
         }

         // Remove the category once no available write disk.
-        int writeDiskNum = mDefaultWriteDiskContainer.getPreferenceCount();
+        int writeDiskNum = 0;//mDefaultWriteDiskContainer.getPreferenceCount();
         if (mIsCategoryAdded && writeDiskNum == 0) {
             mRootContainer.removePreference(mDefaultWriteDiskContainer);
             mIsCategoryAdded = false;

你可能感兴趣的:(Android,Android,设置,USB存储,默认存储)