Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a77e03f authored by William Escande's avatar William Escande
Browse files

Kill bluetooth instead of using exit

Bug: 339553092
Test: None
Flag: com.android.bluetooth.flags.kill_instead_of_exit
Change-Id: I1a1fa25739ee8f4a4abdef9e11e5631691a2ba76
parent adb7fbb0
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ import android.os.Message;
import android.os.ParcelUuid;
import android.os.Parcelable;
import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -2249,8 +2250,13 @@ public class AdapterService extends Service {
            // Post on the main handler to be sure the cleanup has completed before calling exit
            mService.mHandler.post(
                    () -> {
                        if (Flags.killInsteadOfExit()) {
                            Log.i(TAG, "killBluetoothProcess: Calling killProcess(myPid())");
                            Process.killProcess(Process.myPid());
                        } else {
                            Log.i(TAG, "killBluetoothProcess: Calling System.exit");
                            System.exit(0);
                        }
                    });
        }