From 6d4ea870ce5b19e654ebb63e6ae959cd4244e524 Mon Sep 17 00:00:00 2001 From: Milk <1871357815@qq.com> Date: Fri, 4 Jun 2021 18:54:04 +0800 Subject: [PATCH] fix android l --- .../blackbox/core/system/os/BStorageManagerService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Bcore/src/main/java/top/niunaijun/blackbox/core/system/os/BStorageManagerService.java b/Bcore/src/main/java/top/niunaijun/blackbox/core/system/os/BStorageManagerService.java index 1b0f2b1..57e43bc 100644 --- a/Bcore/src/main/java/top/niunaijun/blackbox/core/system/os/BStorageManagerService.java +++ b/Bcore/src/main/java/top/niunaijun/blackbox/core/system/os/BStorageManagerService.java @@ -34,6 +34,8 @@ public class BStorageManagerService extends IBStorageManagerService.Stub impleme } try { StorageVolume[] storageVolumes = reflection.android.os.storage.StorageManager.getVolumeList.call(BUserHandle.getUserId(Process.myUid()), 0); + if (storageVolumes == null) + return null; for (StorageVolume storageVolume : storageVolumes) { reflection.android.os.storage.StorageVolume.mPath.set(storageVolume, BEnvironment.getExternalUserDir(userId)); if (BuildCompat.isPie()) { @@ -44,7 +46,7 @@ public class BStorageManagerService extends IBStorageManagerService.Stub impleme } catch (Exception e) { e.printStackTrace(); } - return new StorageVolume[]{}; + return null; } @Override