Wifi: update p2p API usage in settings
Bug: 146423859 Bug: 144799344 Test: atest --host SettingsRoboTests Change-Id: Ia0225fa8110ff16ceda260f59ffee3739776a6a9
This commit is contained in:
@@ -520,7 +520,7 @@ public final class WifiDisplaySettings extends SettingsPreferenceFragment implem
|
||||
if (DEBUG) {
|
||||
Slog.d(TAG, "Setting listen mode to: " + enable);
|
||||
}
|
||||
mWifiP2pManager.listen(mWifiP2pChannel, enable, new ActionListener() {
|
||||
final ActionListener listener = new ActionListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (DEBUG) {
|
||||
@@ -534,7 +534,12 @@ public final class WifiDisplaySettings extends SettingsPreferenceFragment implem
|
||||
Slog.e(TAG, "Failed to " + (enable ? "entered" : "exited")
|
||||
+ " listen mode with reason " + reason + ".");
|
||||
}
|
||||
});
|
||||
};
|
||||
if (enable) {
|
||||
mWifiP2pManager.startListening(mWifiP2pChannel, listener);
|
||||
} else {
|
||||
mWifiP2pManager.stopListening(mWifiP2pChannel, listener);
|
||||
}
|
||||
}
|
||||
|
||||
private void setWifiP2pChannels(final int lc, final int oc) {
|
||||
|
Reference in New Issue
Block a user