Merge "Update strings for Wi-Fi DPP handshake running state"
This commit is contained in:
committed by
Android (Google) Code Review
commit
6dcb6a35c3
@@ -2153,6 +2153,10 @@
|
||||
<string name="wifi_dpp_could_not_add_device">Couldn\u2019t add device</string>
|
||||
<!-- Title for the fragment to show that device found but naming known [CHAR LIMIT=50] -->
|
||||
<string name="wifi_dpp_device_found">Device found</string>
|
||||
<!-- Hint for Wi-Fi DPP handshake running [CHAR LIMIT=NONE] -->
|
||||
<string name="wifi_dpp_sharing_wifi_with_this_device">Sharing Wi\u2011Fi with this device\u2026</string>
|
||||
<!-- Hint for Wi-Fi DPP handshake running [CHAR LIMIT=NONE] -->
|
||||
<string name="wifi_dpp_connecting">Connecting\u2026</string>
|
||||
<!-- Label for the try again button [CHAR LIMIT=20]-->
|
||||
<string name="retry">Retry</string>
|
||||
<!-- Label for the check box to share a network with other users on the same device -->
|
||||
|
@@ -172,6 +172,9 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
|
||||
mLatestStatusCode = code;
|
||||
}
|
||||
|
||||
if (isGoingInitiator()) {
|
||||
mSummary.setText(R.string.wifi_dpp_sharing_wifi_with_this_device);
|
||||
}
|
||||
mProgressBar.setVisibility(isGoingInitiator() ? View.VISIBLE : View.INVISIBLE);
|
||||
mButtonRight.setVisibility(isGoingInitiator() ? View.INVISIBLE : View.VISIBLE);
|
||||
}
|
||||
@@ -255,7 +258,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
|
||||
mTitle.setText(information);
|
||||
}
|
||||
|
||||
mSummary.setText(getString(R.string.wifi_dpp_add_device_to_wifi, getSsid()));
|
||||
updateSummary();
|
||||
mWifiApPictureView = view.findViewById(R.id.wifi_ap_picture_view);
|
||||
|
||||
mChooseDifferentNetwork = view.findViewById(R.id.choose_different_network);
|
||||
@@ -273,6 +276,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
mButtonRight.setVisibility(View.INVISIBLE);
|
||||
startWifiDppConfiguratorInitiator();
|
||||
updateSummary();
|
||||
});
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
@@ -342,4 +346,12 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
|
||||
|
||||
return model.isGoingInitiator();
|
||||
}
|
||||
|
||||
private void updateSummary() {
|
||||
if (isGoingInitiator()) {
|
||||
mSummary.setText(R.string.wifi_dpp_sharing_wifi_with_this_device);
|
||||
} else {
|
||||
mSummary.setText(getString(R.string.wifi_dpp_add_device_to_wifi, getSsid()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -229,13 +229,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
} else {
|
||||
mTitle.setText(R.string.wifi_dpp_scan_qr_code);
|
||||
|
||||
String description;
|
||||
if (TextUtils.isEmpty(mSsid)) {
|
||||
description = getString(R.string.wifi_dpp_scan_qr_code_join_unknown_network, mSsid);
|
||||
} else {
|
||||
description = getString(R.string.wifi_dpp_scan_qr_code_join_network, mSsid);
|
||||
}
|
||||
mSummary.setText(description);
|
||||
updateEnrolleeSummary();
|
||||
}
|
||||
|
||||
mErrorMessage = view.findViewById(R.id.error_message);
|
||||
@@ -415,6 +409,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
if (!mIsConfiguratorMode) {
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
startWifiDppEnrolleeInitiator((WifiQrCode)msg.obj);
|
||||
updateEnrolleeSummary();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -461,6 +456,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
|
||||
Log.e(TAG, "Invalid networkId " + newNetworkId);
|
||||
mLatestStatusCode = EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_GENERIC;
|
||||
updateEnrolleeSummary();
|
||||
mProgressBar.setVisibility(View.INVISIBLE);
|
||||
showErrorMessage(getString(R.string.wifi_dpp_check_connection_try_again));
|
||||
restartCamera();
|
||||
@@ -528,6 +524,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
}
|
||||
|
||||
mLatestStatusCode = code;
|
||||
updateEnrolleeSummary();
|
||||
mProgressBar.setVisibility(View.INVISIBLE);
|
||||
restartCamera();
|
||||
}
|
||||
@@ -588,4 +585,18 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
|
||||
|
||||
mCamera.start(surfaceTexture);
|
||||
}
|
||||
|
||||
private void updateEnrolleeSummary() {
|
||||
if (isGoingInitiator()) {
|
||||
mSummary.setText(R.string.wifi_dpp_connecting);
|
||||
} else {
|
||||
String description;
|
||||
if (TextUtils.isEmpty(mSsid)) {
|
||||
description = getString(R.string.wifi_dpp_scan_qr_code_join_unknown_network, mSsid);
|
||||
} else {
|
||||
description = getString(R.string.wifi_dpp_scan_qr_code_join_network, mSsid);
|
||||
}
|
||||
mSummary.setText(description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user