根据惯例,先看trace

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
----- pid 20930 at 2024-07-21 13:36:35.207552938+0800 -----
Cmd line: com.android.launcher
Build fingerprint: 'xxx/release-keys'
ABI: 'arm64'
Build type: optimized
suspend all histogram: Sum: 5.532ms 99% C.I. 2us-2958.079us Avg: 83.818us Max: 4255us
DALVIK THREADS (52):
"main" prio=5 tid=1 Native
| group="main" sCount=1 ucsCount=0 flags=1 obj=0x77bd5fb8 self=0xb400007e50af9c00
| sysTid=2378 nice=-10 cgrp=top-app sched=0/0 handle=0x7e521594f8
| state=S schedstat=( 282836249 206702075 685 ) utm=15 stm=12 core=0 HZ=100
| stack=0x7fcda6b000-0x7fcda6d000 stackSize=8188KB
| held mutexes=
native: #00 pc 00000000000e6568 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+8) (BuildId: 72faca30b9bcf1e4042942620badb423)
native: #01 pc 000000000009808c /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156) (BuildId: 72faca30b9bcf1e4042942620badb423)
native: #02 pc 000000000005b3ac /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+284) (BuildId: 997b56887b57ac9e77cd2aee7c068758)
native: #03 pc 000000000005c5e8 /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+72) (BuildId: 997b56887b57ac9e77cd2aee7c068758)
native: #04 pc 000000000005c318 /system/lib64/libbinder.so (android::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+216) (BuildId: 997b56887b57ac9e77cd2aee7c068758)
native: #05 pc 0000000000053a3c /system/lib64/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+188) (BuildId: 997b56887b57ac9e77cd2aee7c068758)
native: #06 pc 000000000017bdb0 /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact(_JNIEnv*, _jobject*, int, _jobject*, _jobject*, int)+400) (BuildId: efc10adff2a34368676560cff811f79d)
at android.os.BinderProxy.transactNative(Native method)
at android.os.BinderProxy.transact(BinderProxy.java:584)
at android.os.storage.IStorageManager$Stub$Proxy.mkdirs(IStorageManager.java:1461)
at android.os.storage.StorageManager.mkdirs(StorageManager.java:1376)
at android.app.ContextImpl.ensureExternalDirsExistOrFilter(ContextImpl.java:3380)
at android.app.ContextImpl.getExternalFilesDirs(ContextImpl.java:847)
- locked <0x049604e9> (a java.lang.Object)
at android.content.ContextWrapper.getExternalFilesDirs(ContextWrapper.java:307)
at b.i.c.a$b.b(ContextCompat.java:1)
at androidx.core.content.FileProvider.c(FileProvider.java:23)
at androidx.core.content.FileProvider.a(FileProvider.java:3)
- locked <0x0e95456e> (a java.util.HashMap)
at androidx.core.content.FileProvider.attachInfo(FileProvider.java:8)
at android.app.ActivityThread.installProvider(ActivityThread.java:7718)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7226)
at android.app.ActivityThread.handleInstallProvider(ActivityThread.java:4238)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2419)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:239)
at android.os.Looper.loop(Looper.java:337)
at android.app.ActivityThread.main(ActivityThread.java:8140)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1054)

线程状态是Native,从堆栈信息看,在调用ContextWrapper.getExternalFilesDirs方法时,出现了一个锁,- locked <0x049604e9> (a java.lang.Object),然后调用到android.os.storage.IStorageManager$Stub$Proxy.mkdirs,说明调用binder机制与系统服务进行交互的时候发生了阻塞。

接着看Event log信息

1
07-02 10:13:56.741  1000  1674  2963 I am_anr  : [0,2378,com.android.launcher,751550021,Input dispatching timed out (Application does not have a focused window)]

这里确定ANR类型,还是Input dispatching timed out (Application does not have a focused window)。

确定好类型,看logcat中负载情况,看看是不是由于负载较大导致的ANR

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
行  10719: 07-02 10:13:34.102  1000  1674  1674 I AnrManager: startAnrManagerService
行 10721: 07-02 10:13:34.262 1000 1674 1674 I AnrManager: prepareStackTraceFile:
行 15333: 07-02 10:13:56.743 1000 1674 2963 I AnrManager: startAnrDump
行 15334: 07-02 10:13:56.743 1000 1674 2963 I AnrManager: isANRFlowSkipped() AnrFlow = 0
行 15335: 07-02 10:13:56.744 1000 1674 2963 I AnrManager: enableTraceLog: false
行 15336: 07-02 10:13:56.750 1000 1674 2963 I AnrManager: dumpAnrDebugInfo begin: AnrDumpRecord{ Input dispatching timed out (Application does not have a focused window) ProcessRecord{6ce010b 2378:com.android.launcher/u0a63} IsCompleted:false IsCancelled:false }, onlyDumpSelf = false, isSilentANR = false
行 15337: 07-02 10:13:56.750 1000 1674 2963 I AnrManager: dumpAnrDebugInfoLocked: AnrDumpRecord{ Input dispatching timed out (Application does not have a focused window) ProcessRecord{6ce010b 2378:com.android.launcher/u0a63} IsCompleted:false IsCancelled:false }, onlyDumpSelf = false, isSilentANR = false
行 15338: 07-02 10:13:56.758 1000 1674 2964 I AnrManager: /dev/binderfs/binder_logs/timeout_log isn't exist
行 15339: 07-02 10:13:56.790 1000 1674 2963 I AnrManager: dumpStackTraces begin!
行 15414: 07-02 10:14:00.878 1000 1674 2963 I AnrManager: dumpStackTraces end!
行 15415: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: ANR in com.android.launcher (com.android.launcher/.uioverrides.QuickstepLauncher), time=41755
行 15416: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: Reason: Input dispatching timed out (Application does not have a focused window)
行 15417: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: Load: 10.76 / 2.71 / 0.91
行 15418: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: ----- Output from /proc/pressure/memory -----
行 15419: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: some avg10=0.00 avg60=0.00 avg300=0.00 total=0
行 15420: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: full avg10=0.00 avg60=0.00 avg300=0.00 total=0
行 15421: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: ----- End output from /proc/pressure/memory -----
行 15422: 07-02 10:14:00.882 1000 1674 2963 I AnrManager:
行 15423: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: Android time :[2024-07-02 10:14:00.87] [45.992]
行 15424: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: CPU usage from 6404ms to 0ms ago (2024-07-02 10:13:50.238 to 2024-07-02 10:13:56.642):
行 15425: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 45% 1674/system_server: 28% user + 17% kernel / faults: 2881 minor 9 major
行 15426: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 36% 691/surfaceflinger: 24% user + 12% kernel / faults: 1263 minor
行 15427: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 32% 1992/com.android.systemui: 20% user + 12% kernel / faults: 379 minor
行 15428: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 27% 2790/android.process.acore: 25% user + 1.7% kernel / faults: 3484 minor 31 major
行 15429: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 21% 676/android.hardware.graphics.composer@2.1-service: 10% user + 10% kernel / faults: 851 minor
行 15430: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 20% 669/android.hardware.audio.service.mediatek: 9.9% user + 10% kernel
行 15431: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 12% 688/audioserver: 7.6% user + 4.5% kernel / faults: 119 minor 1 major
行 15432: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 9% 326/logd: 2% user + 7% kernel / faults: 557 minor
行 15433: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 7.4% 2126/com.android.networkstack.process: 5.7% user + 1.7% kernel / faults: 1353 minor 7 major
行 15434: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 4.2% 893/mobile_log_d: 1.8% user + 2.3% kernel / faults: 210 minor
行 15435: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 3.2% 518/kfps: 0% user + 3.2% kernel
行 15436: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 2.9% 684/android.hardware.memtrack-service.mediatek: 0.6% user + 2.3% kernel / faults: 824 minor
行 15437: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 2.6% 2144/com.android.permissioncontroller: 1.7% user + 0.9% kernel / faults: 234 minor
行 15438: 07-02 10:14:00.882 1000 1674 2963 I AnrManager: 2.6% 2293/com.android.phone: 2% user + 0.6% kernel / faults: 1004 minor
...
行 15506: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 36% TOTAL: 19% user + 14% kernel + 0% iowait + 1.6% irq + 0.4% softirq
行 15507: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: CPU usage from 148ms to 897ms later (2024-07-02 10:13:56.791 to 2024-07-02 10:13:57.539):
行 15508: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 74% 1674/system_server: 33% user + 41% kernel / faults: 240 minor
行 15509: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 43% 2963/AnrConsumer: 15% user + 28% kernel
行 15510: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 5.1% 1711/binder:1674_1: 5.1% user + 0% kernel
行 15511: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 5.1% 1720/android.display: 0% user + 5.1% kernel
行 15512: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 1718/android.ui: 2.5% user + 0% kernel
行 15513: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 1733/batterystats-ha: 2.5% user + 0% kernel
行 15514: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 1821/InputDispatcher: 2.5% user + 0% kernel
行 15515: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 1822/system_server: 0% user + 2.5% kernel
行 15516: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 1823/InputReader: 2.5% user + 0% kernel
行 15517: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 1901/RenderThread: 2.5% user + 0% kernel
行 15518: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 2.5% 2332/binder:1674_9: 2.5% user + 0% kernel
行 15519: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 35% 691/surfaceflinger: 25% user + 10% kernel / faults: 130 minor
行 15520: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 20% 691/surfaceflinger: 17% user + 3.4% kernel
行 15521: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 5.1% 1062/surfaceflinger: 5.1% user + 0% kernel
行 15522: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 5.1% 1785/binder:691_3: 1.7% user + 3.4% kernel
行 15523: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 3.4% 1053/TimerDispatch: 1.7% user + 1.7% kernel
行 15524: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 1.7% 772/binder:691_2: 0% user + 1.7% kernel
行 15525: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 1.7% 1054/app: 0% user + 1.7% kernel
行 15526: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 47% 1992/com.android.systemui: 27% user + 19% kernel / faults: 6 minor
...
行 15559: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: 32% TOTAL: 15% user + 14% kernel + 1.7% irq + 0.5% softirq
行 15560: 07-02 10:14:00.883 1000 1674 2963 I AnrManager: dumpAnrDebugInfo end: AnrDumpRecord{ Input dispatching timed out (Application does not have a focused window) ProcessRecord{6ce010b 2378:com.android.launcher/u0a63} IsCompleted:true IsCancelled:false }, onlyDumpSelf = false , isSilentANR = false
行 15561: 07-02 10:14:00.884 1000 1674 2963 I AnrManager: addErrorToDropBox app = ProcessRecord{6ce010b 2378:com.android.launcher/u0a63} processName = com.android.launcher activityShortComponentName = com.android.launcher/.uioverrides.QuickstepLauncher parentShortComponentName = com.android.launcher/.uioverrides.QuickstepLauncher parentProcess = ProcessRecord{6ce010b 2378:com.android.launcher/u0a63} annotation = Input dispatching timed out (Application does not have a focused window) mTracesFile = /data/anr/anr_2024-07-02-10-13-57-639
行 15562: 07-02 10:14:00.886 1000 1674 2963 I AnrManager: controller = null

从上面负载看负载处于正常范围,并不大:

32% TOTAL: 15% user + 14% kernel + 1.7% irq + 0.5% softirq

那么这里就排除了是由于负载导致的ANR。

这需要我们根据ANR时间去logcat中寻找其他信息,根据trace信息我们知道调用StorageManager.mkdirs时出现问题,从该log看是与存储有关的问题导致的,因此我们要过滤存储相关的信息。

下面我直接贴了过滤信息,在下面log中第一行,从log看,是由于系统锁定,导致存储挂载失败,对应的服务是StorageManagerService,正好与StorageManager相对应,因此是由于该原因导致,找到了原因,我们就可以根据这个去找存储挂载失败的原因。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
07-02 10:13:50.909  1000  1674  1935 W StorageManagerService: Reporting emulated;0 unmounted due to system locked

07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: Failed to mount volume VolumeInfo{emulated;0}:
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: type=EMULATED diskId=null partGuid= mountFlags=PRIMARY|VISIBLE_FOR_WRITE
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: mountUserId=0 state=CHECKING
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: fsType=null fsUuid=null fsLabel=null
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: path=/storage/emulated internalPath=/data/media
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService:
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: com.android.server.storage.StorageSessionController$ExternalStorageServiceException: Failed to start session: [SessionId: emulated;0. UpperPath: /storage/emulated. LowerPath: /data/media]
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection.startSession(StorageUserConnection.java:394)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection.startSession(StorageUserConnection.java:111)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageSessionController.onVolumeMount(StorageSessionController.java:129)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.StorageManagerService$7.onVolumeChecking(StorageManagerService.java:2447)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.IVoldMountCallback$Stub.onTransact(IVoldMountCallback.java:92)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Binder.execTransactInternal(Binder.java:1306)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Binder.execTransact(Binder.java:1257)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.BinderProxy.transactNative(Native Method)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.BinderProxy.transact(BinderProxy.java:584)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.IVold$Stub$Proxy.mount(IVold.java:1716)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.StorageManagerService.mount(StorageManagerService.java:2439)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.StorageManagerService.-$$Nest$mmount(Unknown Source:0)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.StorageManagerService$StorageManagerServiceHandler.handleMessage(StorageManagerService.java:829)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Handler.dispatchMessage(Handler.java:106)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Looper.loopOnce(Looper.java:239)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Looper.loop(Looper.java:337)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.HandlerThread.run(HandlerThread.java:67)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: Caused by: java.util.concurrent.ExecutionException: android.os.ParcelableException: java.lang.IllegalStateException: Failed to start FUSE
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:371)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1998)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection.waitForAsync(StorageUserConnection.java:379)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection.waitForAsyncVoid(StorageUserConnection.java:358)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection.startSession(StorageUserConnection.java:390)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: ... 16 more
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: Caused by: android.os.ParcelableException: java.lang.IllegalStateException: Failed to start FUSE
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.ParcelableException$1.createFromParcel(ParcelableException.java:82)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.ParcelableException$1.createFromParcel(ParcelableException.java:79)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Parcel.readParcelableInternal(Parcel.java:4775)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Parcel.readValue(Parcel.java:4532)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Parcel.readValue(Parcel.java:4312)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Parcel.-$$Nest$mreadValue(Unknown Source:0)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Parcel$LazyValue.apply(Parcel.java:4410)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Parcel$LazyValue.apply(Parcel.java:4369)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.BaseBundle.getValueAt(BaseBundle.java:394)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.BaseBundle.getValue(BaseBundle.java:374)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.BaseBundle.getValue(BaseBundle.java:357)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.BaseBundle.getValue(BaseBundle.java:350)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Bundle.getParcelable(Bundle.java:913)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection.setResult(StorageUserConnection.java:448)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection.lambda$waitForAsyncVoid$0$com-android-server-storage-StorageUserConnection$ActiveConnection(StorageUserConnection.java:356)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at com.android.server.storage.StorageUserConnection$ActiveConnection$$ExternalSyntheticLambda1.onResult(Unknown Source:4)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.RemoteCallback.sendResult(RemoteCallback.java:75)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.RemoteCallback$1.sendResult(RemoteCallback.java:52)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.IRemoteCallback$Stub.onTransact(IRemoteCallback.java:87)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Binder.execTransactInternal(Binder.java:1306)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.Binder.execTransact(Binder.java:1257)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: Caused by: java.lang.IllegalStateException: Failed to start FUSE
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at java.lang.reflect.Constructor.newInstance0(Native Method)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: at android.os.ParcelableException.readFromParcel(ParcelableException.java:56)
07-02 10:13:55.585 1000 1674 1830 E StorageManagerService: ... 21 more
07-02 10:13:55.585 1000 1674 1830 I StorageManagerService: Scheduling reset in 10s
07-02 10:13:55.586 root 340 340 I vold : fuse_unmounter scope_guard running
07-02 10:13:55.586 root 340 340 I vold : Unmounting fuse path /mnt/user/0/emulated
07-02 10:13:55.587 1000 1674 2680 W StorageManagerService: Reporting emulated;0 unmounted due to system locked
07-02 10:13:55.589 1000 1674 1935 W StorageManagerService: Reporting emulated;0 unmounted due to system locked
07-02 10:13:55.590 1002 2234 2234 W Looper : Slow dispatch took 6685ms main h=android.app.ActivityThread$H c=android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0@59e1b9b m=0
07-02 10:13:55.590 1000 1674 2665 W StorageManagerService: Reporting emulated;0 unmounted due to system locked

具体原因这里不在分析,说下结论,就是某个模块签名出了问题,导致不能挂载,而另外一边获取外部存储路径超时,因此出现了ANR。

对于Binder这种问题,需要确定Binder Server端的情况,但是有些服务端是很难找的。