Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -31600,8 +31600,10 @@ package android.net.wifi.p2p { method public int getControlPort(); method public int getDeviceType(); method public int getMaxThroughput(); method public boolean isContentProtectionSupported(); method public boolean isSessionAvailable(); method public boolean isWfdEnabled(); method public void setContentProtectionSupported(boolean); method public void setControlPort(int); method public boolean setDeviceType(int); method public void setMaxThroughput(int); wifi/java/android/net/wifi/p2p/WifiP2pWfdInfo.java +25 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,9 @@ public final class WifiP2pWfdInfo implements Parcelable { * {@link #mDeviceInfo} & {@link #DEVICE_TYPE} is one of {@link #DEVICE_TYPE_WFD_SOURCE}, * {@link #DEVICE_TYPE_PRIMARY_SINK}, {@link #DEVICE_TYPE_SECONDARY_SINK} or * {@link #DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK}. * * The bit definition is listed in 5.1.2 WFD Device Information Subelement in * Wi-Fi Display Technical Specification. */ private static final int DEVICE_TYPE = 1 << 1 | 1 << 0; private static final int COUPLED_SINK_SUPPORT_AT_SOURCE = 1 << 2; Loading @@ -69,6 +72,8 @@ public final class WifiP2pWfdInfo implements Parcelable { private static final int SESSION_AVAILABLE_BIT2 = 1 << 5; private static final int SESSION_AVAILABLE = SESSION_AVAILABLE_BIT2 | SESSION_AVAILABLE_BIT1; /* The support of Content Protection using the HDCP system 2.0/2.1. */ private static final int CONTENT_PROTECTION_SUPPORT = 1 << 8; private int mCtrlPort; Loading Loading @@ -146,6 +151,26 @@ public final class WifiP2pWfdInfo implements Parcelable { } } /** * @return true if Content Protection using the HDCP system 2.0/2.1 is supported. */ public boolean isContentProtectionSupported() { return (mDeviceInfo & CONTENT_PROTECTION_SUPPORT) != 0; } /** * Sets whether Content Protection using the HDCP system 2.0/2.1 is supported. * * @param enabled true to indicate that Content Protection is supported, false otherwise. */ public void setContentProtectionSupported(boolean enabled) { if (enabled) { mDeviceInfo |= CONTENT_PROTECTION_SUPPORT; } else { mDeviceInfo &= ~CONTENT_PROTECTION_SUPPORT; } } /** Returns the TCP port at which the WFD Device listens for RTSP messages. */ public int getControlPort() { return mCtrlPort; Loading wifi/tests/src/android/net/wifi/p2p/WifiP2pWfdInfoTest.java +5 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public class WifiP2pWfdInfoTest { // initialize device info flags. mSourceInfo.setDeviceType(WifiP2pWfdInfo.DEVICE_TYPE_WFD_SOURCE); mSourceInfo.setSessionAvailable(true); mSourceInfo.setContentProtectionSupported(true); } /** Loading @@ -63,13 +64,16 @@ public class WifiP2pWfdInfoTest { info.setSessionAvailable(true); assertTrue(info.isSessionAvailable()); info.setContentProtectionSupported(true); assertTrue(info.isContentProtectionSupported()); info.setControlPort(TEST_CTRL_PORT); assertEquals(TEST_CTRL_PORT, info.getControlPort()); info.setMaxThroughput(TEST_MAX_TPUT); assertEquals(TEST_MAX_TPUT, info.getMaxThroughput()); assertEquals("0010270f0400", info.getDeviceInfoHex()); assertEquals("0110270f0400", info.getDeviceInfoHex()); } /** Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -31600,8 +31600,10 @@ package android.net.wifi.p2p { method public int getControlPort(); method public int getDeviceType(); method public int getMaxThroughput(); method public boolean isContentProtectionSupported(); method public boolean isSessionAvailable(); method public boolean isWfdEnabled(); method public void setContentProtectionSupported(boolean); method public void setControlPort(int); method public boolean setDeviceType(int); method public void setMaxThroughput(int);
wifi/java/android/net/wifi/p2p/WifiP2pWfdInfo.java +25 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,9 @@ public final class WifiP2pWfdInfo implements Parcelable { * {@link #mDeviceInfo} & {@link #DEVICE_TYPE} is one of {@link #DEVICE_TYPE_WFD_SOURCE}, * {@link #DEVICE_TYPE_PRIMARY_SINK}, {@link #DEVICE_TYPE_SECONDARY_SINK} or * {@link #DEVICE_TYPE_SOURCE_OR_PRIMARY_SINK}. * * The bit definition is listed in 5.1.2 WFD Device Information Subelement in * Wi-Fi Display Technical Specification. */ private static final int DEVICE_TYPE = 1 << 1 | 1 << 0; private static final int COUPLED_SINK_SUPPORT_AT_SOURCE = 1 << 2; Loading @@ -69,6 +72,8 @@ public final class WifiP2pWfdInfo implements Parcelable { private static final int SESSION_AVAILABLE_BIT2 = 1 << 5; private static final int SESSION_AVAILABLE = SESSION_AVAILABLE_BIT2 | SESSION_AVAILABLE_BIT1; /* The support of Content Protection using the HDCP system 2.0/2.1. */ private static final int CONTENT_PROTECTION_SUPPORT = 1 << 8; private int mCtrlPort; Loading Loading @@ -146,6 +151,26 @@ public final class WifiP2pWfdInfo implements Parcelable { } } /** * @return true if Content Protection using the HDCP system 2.0/2.1 is supported. */ public boolean isContentProtectionSupported() { return (mDeviceInfo & CONTENT_PROTECTION_SUPPORT) != 0; } /** * Sets whether Content Protection using the HDCP system 2.0/2.1 is supported. * * @param enabled true to indicate that Content Protection is supported, false otherwise. */ public void setContentProtectionSupported(boolean enabled) { if (enabled) { mDeviceInfo |= CONTENT_PROTECTION_SUPPORT; } else { mDeviceInfo &= ~CONTENT_PROTECTION_SUPPORT; } } /** Returns the TCP port at which the WFD Device listens for RTSP messages. */ public int getControlPort() { return mCtrlPort; Loading
wifi/tests/src/android/net/wifi/p2p/WifiP2pWfdInfoTest.java +5 −1 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public class WifiP2pWfdInfoTest { // initialize device info flags. mSourceInfo.setDeviceType(WifiP2pWfdInfo.DEVICE_TYPE_WFD_SOURCE); mSourceInfo.setSessionAvailable(true); mSourceInfo.setContentProtectionSupported(true); } /** Loading @@ -63,13 +64,16 @@ public class WifiP2pWfdInfoTest { info.setSessionAvailable(true); assertTrue(info.isSessionAvailable()); info.setContentProtectionSupported(true); assertTrue(info.isContentProtectionSupported()); info.setControlPort(TEST_CTRL_PORT); assertEquals(TEST_CTRL_PORT, info.getControlPort()); info.setMaxThroughput(TEST_MAX_TPUT); assertEquals(TEST_MAX_TPUT, info.getMaxThroughput()); assertEquals("0010270f0400", info.getDeviceInfoHex()); assertEquals("0110270f0400", info.getDeviceInfoHex()); } /** Loading