fix android l

pull/15/head
Milk 4 years ago
parent 57b9defca0
commit 6d4ea870ce
  1. 4
      Bcore/src/main/java/top/niunaijun/blackbox/core/system/os/BStorageManagerService.java

@ -34,6 +34,8 @@ public class BStorageManagerService extends IBStorageManagerService.Stub impleme
} }
try { try {
StorageVolume[] storageVolumes = reflection.android.os.storage.StorageManager.getVolumeList.call(BUserHandle.getUserId(Process.myUid()), 0); StorageVolume[] storageVolumes = reflection.android.os.storage.StorageManager.getVolumeList.call(BUserHandle.getUserId(Process.myUid()), 0);
if (storageVolumes == null)
return null;
for (StorageVolume storageVolume : storageVolumes) { for (StorageVolume storageVolume : storageVolumes) {
reflection.android.os.storage.StorageVolume.mPath.set(storageVolume, BEnvironment.getExternalUserDir(userId)); reflection.android.os.storage.StorageVolume.mPath.set(storageVolume, BEnvironment.getExternalUserDir(userId));
if (BuildCompat.isPie()) { if (BuildCompat.isPie()) {
@ -44,7 +46,7 @@ public class BStorageManagerService extends IBStorageManagerService.Stub impleme
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return new StorageVolume[]{}; return null;
} }
@Override @Override

Loading…
Cancel
Save