Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 511f8e2f authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Use hasSystemFeature() API to check for p2p"

parents d1847cb0 a8f63a38
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -26,6 +26,5 @@ import android.os.Messenger;
interface IWifiP2pManager
{
    Messenger getMessenger();
    boolean isP2pSupported();
}
+0 −9
Original line number Diff line number Diff line
@@ -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.
+3 −10
Original line number Diff line number Diff line
@@ -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)