Disable WiFi p2p service if it's not supported.
b/26877020
Change-Id: I84b822fa57423711de75d2147effe73a1fc40eb4
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 4f54e87..baae34d 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -823,7 +823,11 @@
} else {
Slog.i(TAG, "No Wi-Fi NAN Service (NAN support Not Present)");
}
- mSystemServiceManager.startService(WIFI_P2P_SERVICE_CLASS);
+
+ if (context.getPackageManager().hasSystemFeature(
+ PackageManager.FEATURE_WIFI_DIRECT)) {
+ mSystemServiceManager.startService(WIFI_P2P_SERVICE_CLASS);
+ }
mSystemServiceManager.startService(WIFI_SERVICE_CLASS);
mSystemServiceManager.startService(
"com.android.server.wifi.scanner.WifiScanningService");