Loading services/core/java/com/android/server/MountService.java +11 −5 Original line number Diff line number Diff line Loading @@ -1505,6 +1505,16 @@ class MountService extends IMountService.Stub return null; } private boolean hasUmsVolume() { final StorageVolume[] storageVolumes = getVolumeList(); for(StorageVolume volume : storageVolumes) { if (volume.allowMassStorage()) { return true; } } return false; } /** * Constructs a new MountService instance * Loading Loading @@ -1532,11 +1542,7 @@ class MountService extends IMountService.Stub userFilter.addAction(Intent.ACTION_USER_REMOVED); mContext.registerReceiver(mUserReceiver, userFilter, null, mHandler); // Watch for USB changes on primary volume final StorageVolume primary = getPrimaryPhysicalVolume(); if ((primary != null && primary.allowMassStorage()) || //ignore primary config, force to register if property is true SystemProperties.getBoolean("persist.sys.ums", true)) { if (hasUmsVolume() || SystemProperties.getBoolean("persist.sys.ums", true)) { mContext.registerReceiver( mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_STATE), null, mHandler); } Loading Loading
services/core/java/com/android/server/MountService.java +11 −5 Original line number Diff line number Diff line Loading @@ -1505,6 +1505,16 @@ class MountService extends IMountService.Stub return null; } private boolean hasUmsVolume() { final StorageVolume[] storageVolumes = getVolumeList(); for(StorageVolume volume : storageVolumes) { if (volume.allowMassStorage()) { return true; } } return false; } /** * Constructs a new MountService instance * Loading Loading @@ -1532,11 +1542,7 @@ class MountService extends IMountService.Stub userFilter.addAction(Intent.ACTION_USER_REMOVED); mContext.registerReceiver(mUserReceiver, userFilter, null, mHandler); // Watch for USB changes on primary volume final StorageVolume primary = getPrimaryPhysicalVolume(); if ((primary != null && primary.allowMassStorage()) || //ignore primary config, force to register if property is true SystemProperties.getBoolean("persist.sys.ums", true)) { if (hasUmsVolume() || SystemProperties.getBoolean("persist.sys.ums", true)) { mContext.registerReceiver( mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_STATE), null, mHandler); } Loading