Merge "Expose WifiP2pDevice.update() as public API"

This commit is contained in:
David Su
2019-11-28 18:03:16 +00:00
committed by Android (Google) Code Review
3 changed files with 5 additions and 7 deletions

View File

@@ -30569,6 +30569,7 @@ package android.net.wifi.p2p {
method @Nullable public android.net.wifi.p2p.WifiP2pWfdInfo getWfdInfo();
method public boolean isGroupOwner();
method public boolean isServiceDiscoveryCapable();
method public void update(@NonNull android.net.wifi.p2p.WifiP2pDevice);
method public boolean wpsDisplaySupported();
method public boolean wpsKeypadSupported();
method public boolean wpsPbcSupported();

View File

@@ -508,8 +508,7 @@ final class WifiDisplayController implements DumpUtils.Dump {
Slog.d(TAG, "updateDesiredDevice: new information "
+ describeWifiP2pDevice(device));
}
mDesiredDevice.updateSupplicantDetails(device);
mDesiredDevice.status = device.status;
mDesiredDevice.update(device);
if (mAdvertisedDisplay != null
&& mAdvertisedDisplay.getDeviceAddress().equals(address)) {
readvertiseDisplay(createWifiDisplay(mDesiredDevice));

View File

@@ -286,14 +286,12 @@ public class WifiP2pDevice implements Parcelable {
}
/**
* Update device details. This will throw an exception if the device address does not match.
* Update this device's details using another {@link WifiP2pDevice} instance.
* This will throw an exception if the device address does not match.
*
* @param device to be updated
* @param device another instance of {@link WifiP2pDevice} used to update this instance.
* @throws IllegalArgumentException if the device is null or the device address does not match
*
* @hide
*/
@UnsupportedAppUsage
public void update(@NonNull WifiP2pDevice device) {
updateSupplicantDetails(device);
status = device.status;