File tree Expand file tree Collapse file tree
app-process/src/main/java/com/rosan/app_process Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import android .content .Context ;
55import android .content .pm .PackageManager ;
66import android .os .Binder ;
7+ import android .os .Build ;
78import android .os .IBinder ;
89import android .os .Parcel ;
910import android .os .RemoteException ;
2122
2223public 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 }
You can’t perform that action at this time.
0 commit comments