Merge "Revert "Remove outdated emulator check which causes BT to not start""
am: 375ea2ae71

Change-Id: I3d5abc52abf3f7c01ba4fbee47d7e487e99f5dda
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index fbc0759..f0d5549 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -563,6 +563,8 @@
         boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice",
                 false);
 
+        boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1");
+
         try {
             Slog.i(TAG, "Reading configuration...");
             SystemConfig.getInstance();
@@ -649,7 +651,12 @@
             // TODO: Use service dependencies instead.
             mDisplayManagerService.windowManagerAndInputReady();
 
-            if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) {
+            // Skip Bluetooth if we have an emulator kernel
+            // TODO: Use a more reliable check to see if this product should
+            // support Bluetooth - see bug 988521
+            if (isEmulator) {
+                Slog.i(TAG, "No Bluetooth Service (emulator)");
+            } else if (mFactoryTestMode == FactoryTest.FACTORY_TEST_LOW_LEVEL) {
                 Slog.i(TAG, "No Bluetooth Service (factory test)");
             } else if (!context.getPackageManager().hasSystemFeature
                        (PackageManager.FEATURE_BLUETOOTH)) {