Implement Wi-Fi QR code scanner flow.

1. Implements WifiNetworkConfig Wi-Fi connection method
2. Shows error message when the QR code is not valid and hides it after 2s
3. In configurator mode, launchs AddDeviceFragment for a valid QR code
4. In enrollee mode, connects Wi-Fi for a valid QR code

Bug: 118794978
Test: manual test
      atest WifiQrCodetest
      atest WifiDppConfiguratorActivityTest
      atest WifiDppEnrolleeActivityTest
      atest WifiDppQrCodeScannerFragmentTest

Change-Id: Ie4731b22df295c60906156d33ea28dad9c084ce4
This commit is contained in:
Arc Wang
2018-12-27 13:54:15 +08:00
parent cc8212edf6
commit 1988fb75c6
10 changed files with 368 additions and 19 deletions

View File

@@ -101,6 +101,13 @@ public abstract class WifiDppQrCodeBaseFragment extends InstrumentedFragment {
mDescription.setText(description);
}
/** optional, for WifiDppQrCodeScannerFragment */
protected void showErrorMessage(boolean show) {
if (mErrorMessage != null) {
mErrorMessage.setVisibility(show ? View.VISIBLE : View.INVISIBLE);
}
}
/** optional, for WifiDppQrCodeScannerFragment */
protected void setErrorMessage(String errorMessage) {
if (mErrorMessage != null) {