Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
fix A11
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Jun 7, 2022
1 parent a847d0b commit 9875b9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
applicationId "cn.myflv.android.noanr"
minSdk 23
targetSdk 32
versionCode 7
versionCode 10
versionName "2.4-alpha"

}
Expand Down
2 changes: 1 addition & 1 deletion app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 7,
"versionCode": 10,
"versionName": "2.4-alpha",
"outputFile": "app-release.apk"
}
Expand Down
11 changes: 8 additions & 3 deletions app/src/main/java/cn/myflv/android/noanr/utils/AnrUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public static void startAnrConsumerIfNeeded(Object anrHelper) {
}

public static void resetNotResponding(Object processRecord) {
if (Build.VERSION.SDK_INT==Build.VERSION_CODES.S){
Object activityManagerService = ProcessUtil.getActivityManagerService(processRecord);
if (activityManagerService == null) return;
Object activityManagerService = ProcessUtil.getActivityManagerService(processRecord);
if (activityManagerService == null) return;
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.S) {
if (AppUtil.getActivityManagerGlobalLock(activityManagerService) == null) {
return;
}
Expand All @@ -36,6 +36,11 @@ public static void resetNotResponding(Object processRecord) {
if (mErrorState == null) return;
XposedHelpers.callMethod(mErrorState, MethodEnum.setNotResponding, false);
}
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
synchronized (ProcessUtil.getActivityManagerService(processRecord)) {
XposedHelpers.callMethod(processRecord, MethodEnum.setNotResponding, false);
}

}
}

Expand Down

0 comments on commit 9875b9f

Please sign in to comment.