summaryrefslogtreecommitdiff
path: root/service/java/com/android/server/bluetooth/BluetoothManagerService.java
diff options
context:
space:
mode:
authorxiaowang <quic_xiaowang@quicinc.com>2022-03-18 16:34:14 +0800
committerXiaoyang Wang <quic_xiaowang@quicinc.com>2022-03-23 07:17:11 +0000
commit21ce9ab0c738318776d7747f720f12b8a05a63fb (patch)
tree42af899d5fb3242d5fec5e22322d73207c00ed2e /service/java/com/android/server/bluetooth/BluetoothManagerService.java
parent716968a4d1de6971c5c569cd8f5f2830b5dba575 (diff)
Restore call to Process.getPidsForCommand().
CRs-Fixed: 2838648, 2891932 Bug: 224174628 Change-Id: Ib19c2ef2efed670ff7d2a3d58a8bada52fd3bc46
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java')
-rw-r--r--service/java/com/android/server/bluetooth/BluetoothManagerService.java9
1 files changed, 7 insertions, 2 deletions
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);