Skip to content

Commit 754feda

Browse files
committed
fix ProcessManager::exit
1 parent 6bb6dbb commit 754feda

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

app-process/src/main/java/com/rosan/app_process/ProcessManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.pm.PackageManager;
66
import android.os.Binder;
7+
import android.os.Build;
78
import android.os.IBinder;
89
import android.os.Parcel;
910
import android.os.RemoteException;
@@ -21,7 +22,7 @@
2122

2223
public class ProcessManager extends IProcessManager.Stub {
2324
// transact sub service binder before destroy
24-
public static int TRANSACT_ON_DESTROY_CODE = 0x010000EE; // 16777454
25+
public static int TRANSACT_ON_DESTROY_CODE = 0x00FF0000; // 16711680
2526

2627
private final List<Process> mServiceProcesses = new ArrayList<>();
2728

@@ -49,7 +50,11 @@ public void exit(int code) {
4950
synchronized (mServiceIBinders) {
5051
for (Process process : mServiceProcesses) {
5152
try {
52-
process.destroyForcibly();
53+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
54+
process.destroyForcibly();
55+
} else {
56+
process.destroy();
57+
}
5358
} catch (Throwable ignored) {
5459
}
5560
}

0 commit comments

Comments
 (0)