Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid suggesting the user to update the recommended fw if already there #8495

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ public class FirmwareUpdateDialog extends DialogFragment {
private TextView mTitle;

private boolean mDontShowAgain = false;
private boolean mAlreadyLatestInstalled = false;

static private String getFirmwareUpdateMessage(Device device){
private String getFirmwareUpdateMessage(Device device){
final String recFw = device.supportsInfo(CameraInfo.RECOMMENDED_FIRMWARE_VERSION) ?
device.getInfo(CameraInfo.RECOMMENDED_FIRMWARE_VERSION) : "unknown";
final String fw = device.getInfo(CameraInfo.FIRMWARE_VERSION);
if (recFw.equals(fw)){
mAlreadyLatestInstalled = true;
return "The recommended firmware is already installed";
}
return "The firmware of the connected device is: " + fw +
"\n\nThe recommended firmware for this device is: " + recFw;
}
Expand Down Expand Up @@ -93,6 +98,9 @@ public void onClick(View view) {
}
});

if (mAlreadyLatestInstalled)
ev-mp marked this conversation as resolved.
Show resolved Hide resolved
mFwUpdateButton.setEnabled(false);

mSkipFwUpdateButton = fragmentView.findViewById(R.id.skipFwUpdateButton);
mSkipFwUpdateButton.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down