diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-09-07 17:42:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-07 17:42:47 -0700 |
commit | 511f8e2ff23c480808d831125f3c93d4cbd15f59 (patch) | |
tree | 055478df8ce7849fff81ef5708548ff473596df5 /wifi/java | |
parent | d1847cb0cf6075debdd9ed62934c9ca802c8869b (diff) | |
parent | a8f63a38a0570d2521d5db73f05218d114fa902a (diff) | |
download | frameworks_base-511f8e2ff23c480808d831125f3c93d4cbd15f59.zip frameworks_base-511f8e2ff23c480808d831125f3c93d4cbd15f59.tar.gz frameworks_base-511f8e2ff23c480808d831125f3c93d4cbd15f59.tar.bz2 |
Merge "Use hasSystemFeature() API to check for p2p"
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl | 1 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/p2p/WifiP2pManager.java | 9 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/p2p/WifiP2pService.java | 13 |
3 files changed, 3 insertions, 20 deletions
diff --git a/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl b/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl index a0c7dd1..381a450 100644 --- a/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl +++ b/wifi/java/android/net/wifi/p2p/IWifiP2pManager.aidl @@ -26,6 +26,5 @@ import android.os.Messenger; interface IWifiP2pManager { Messenger getMessenger(); - boolean isP2pSupported(); } diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java index 10a316e..5715186 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java @@ -400,15 +400,6 @@ public class WifiP2pManager { } } - /** @hide */ - public boolean isP2pSupported() { - try { - return mService.isP2pSupported(); - } catch (RemoteException e) { - return false; - } - } - /** * Sends in a request to the system to enable p2p. This will pop up a dialog * to the user and upon authorization will enable p2p. diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java index 361cac5..b848f82 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java @@ -155,8 +155,9 @@ public class WifiP2pService extends IWifiP2pManager.Stub { mInterface = SystemProperties.get("wifi.interface", "wlan0"); mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_WIFI_P2P, 0, NETWORKTYPE, ""); - mP2pSupported = mContext.getResources().getBoolean( - com.android.internal.R.bool.config_wifi_p2p_support); + mP2pSupported = mContext.getPackageManager().hasSystemFeature( + PackageManager.FEATURE_WIFI_DIRECT); + mDeviceType = mContext.getResources().getString( com.android.internal.R.string.config_wifi_p2p_device_type); mDeviceName = getDefaultDeviceName(); @@ -218,14 +219,6 @@ public class WifiP2pService extends IWifiP2pManager.Stub { return new Messenger(mP2pStateMachine.getHandler()); } - /** - * Return if p2p is supported - */ - public boolean isP2pSupported() { - enforceAccessPermission(); - return mP2pSupported; - } - @Override protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) |