Donot start Bluetooth Manager Service when bluetooth hardware feature is missing
bug 8374762
Change-Id: Iea06bd05e19eeddf3398ac446f3d6b80fce51283
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 681c21d..7994b56 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -23,6 +23,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.IPackageManager;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.media.AudioService;
import android.net.wifi.p2p.WifiP2pService;
@@ -330,6 +331,9 @@
Slog.i(TAG, "No Bluetooh Service (emulator)");
} else if (factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL) {
Slog.i(TAG, "No Bluetooth Service (factory test)");
+ } else if (!context.getPackageManager().hasSystemFeature
+ (PackageManager.FEATURE_BLUETOOTH)) {
+ Slog.i(TAG, "No Bluetooth Service (Bluetooth Hardware Not Present)");
} else {
Slog.i(TAG, "Bluetooth Manager Service");
bluetooth = new BluetoothManagerService(context);