From 21ce9ab0c738318776d7747f720f12b8a05a63fb Mon Sep 17 00:00:00 2001 From: xiaowang Date: Fri, 18 Mar 2022 16:34:14 +0800 Subject: Restore call to Process.getPidsForCommand(). CRs-Fixed: 2838648, 2891932 Bug: 224174628 Change-Id: Ib19c2ef2efed670ff7d2a3d58a8bada52fd3bc46 --- .../com/android/server/bluetooth/BluetoothManagerService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java') diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java index 3e8f8fd016..6a1c28beb0 100644 --- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java @@ -2603,9 +2603,14 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } // Make sure BT process exit completely - //int[] pids = Process.getPidsForCommands( - // new String[]{ "com.android.bluetooth" }); int[] pids = null; + try { + pids = (int[]) Class.forName("android.os.Process") + .getMethod("getPidsForCommands", String[].class) + .invoke(new String[]{ "com.android.bluetooth" }); + } catch (Exception e) { + Log.e(TAG, "Error to call getPidsForCommands"); + } if (pids != null && pids.length > 0) { for(int pid : pids) { Log.e(TAG, "Killing BT process with PID = " + pid); -- cgit v1.2.3