Implement receiver flow of WiFi sharing feature
1.Add a button to launch QR code scanner when add a network. 2.Scan button added in AddNetworkFragment / WifiDialog / WifiSettings. Bug: 120630683 Test: make RunSettingsRoboTests Change-Id: I340bfa2247e092f586dd90dfea37c355e681ffee
This commit is contained in:
@@ -23,12 +23,14 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.InstrumentedFragment;
|
||||
import com.android.settings.wifi.dpp.WifiDppUtils;
|
||||
|
||||
public class AddNetworkFragment extends InstrumentedFragment implements WifiConfigUiBase,
|
||||
View.OnClickListener {
|
||||
@@ -64,6 +66,18 @@ public class AddNetworkFragment extends InstrumentedFragment implements WifiConf
|
||||
mCancelBtn.setOnClickListener(this);
|
||||
mUIController = new WifiConfigController(this, rootView, null, getMode());
|
||||
|
||||
if (WifiDppUtils.isSharingNetworkEnabled(getContext())) {
|
||||
final ImageButton scannerButton = rootView.findViewById(R.id.ssid_scanner_button);
|
||||
if (scannerButton != null) {
|
||||
scannerButton.setVisibility(View.VISIBLE);
|
||||
scannerButton.setOnClickListener((View v) -> {
|
||||
// Launch QR code scanner to join a network.
|
||||
getContext().startActivity(
|
||||
WifiDppUtils.getConfiguratorQRCodeScannerIntent(/* ssid */ null));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return rootView;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user