Play vibration when Wi-Fi QR code scanner recognize a valid QR code
Bug: 127377350 Test: manual Change-Id: I9bfcb6f4d1d4dee45d2cacdedfc07d2f4eccd758
This commit is contained in:
@@ -140,6 +140,11 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
break;
|
||||
|
||||
case MESSAGE_SCAN_WIFI_DPP_SUCCESS:
|
||||
if (mCamera != null) {
|
||||
mCamera.stop();
|
||||
}
|
||||
|
||||
mDecorateView.setFocused(true);
|
||||
mErrorMessage.setVisibility(View.INVISIBLE);
|
||||
|
||||
if (mScanWifiDppSuccessListener == null) {
|
||||
@@ -154,15 +159,24 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
mSummary.sendAccessibilityEvent(
|
||||
AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
|
||||
}
|
||||
|
||||
WifiDppUtils.triggerVibrationForQrCodeRecognition(getContext());
|
||||
break;
|
||||
|
||||
case MESSAGE_SCAN_ZXING_WIFI_FORMAT_SUCCESS:
|
||||
if (mCamera != null) {
|
||||
mCamera.stop();
|
||||
}
|
||||
|
||||
mDecorateView.setFocused(true);
|
||||
mErrorMessage.setVisibility(View.INVISIBLE);
|
||||
|
||||
final WifiNetworkConfig wifiNetworkConfig = (WifiNetworkConfig)msg.obj;
|
||||
mWifiConfiguration = wifiNetworkConfig.getWifiConfigurationOrNull();
|
||||
wifiNetworkConfig.connect(getContext(),
|
||||
/* listener */ WifiDppQrCodeScannerFragment.this);
|
||||
|
||||
WifiDppUtils.triggerVibrationForQrCodeRecognition(getContext());
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -409,11 +423,6 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
}
|
||||
|
||||
private void handleWifiDpp() {
|
||||
if (mCamera != null) {
|
||||
mCamera.stop();
|
||||
}
|
||||
mDecorateView.setFocused(true);
|
||||
|
||||
Message message = mHandler.obtainMessage(MESSAGE_SCAN_WIFI_DPP_SUCCESS);
|
||||
message.obj = new WifiQrCode(mWifiQrCode.getQrCode());
|
||||
|
||||
@@ -421,11 +430,6 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
}
|
||||
|
||||
private void handleZxingWifiFormat() {
|
||||
if (mCamera != null) {
|
||||
mCamera.stop();
|
||||
}
|
||||
mDecorateView.setFocused(true);
|
||||
|
||||
Message message = mHandler.obtainMessage(MESSAGE_SCAN_ZXING_WIFI_FORMAT_SUCCESS);
|
||||
message.obj = new WifiQrCode(mWifiQrCode.getQrCode()).getWifiNetworkConfig();
|
||||
|
||||
|
Reference in New Issue
Block a user