1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

FwAppInstallerActivity: Ignore updates from unrelated devices

This commit is contained in:
José Rebelo 2024-09-14 13:36:58 +01:00
parent 1f95258e0e
commit 0b6f36047e
2 changed files with 6 additions and 6 deletions

View File

@ -85,8 +85,8 @@ public class FwAppInstallerActivity extends AbstractGBActivity implements Instal
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (GBDevice.ACTION_DEVICE_CHANGED.equals(action)) {
device = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE);
if (device != null) {
final GBDevice changedDevice = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE);
if (changedDevice != null && changedDevice.equals(device)) {
refreshBusyState(device);
if (!device.isInitialized()) {
setInstallEnabled(false);

View File

@ -491,13 +491,13 @@ public class GBDevice implements Parcelable {
if (obj == this) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GBDevice)) {
return false;
}
if (((GBDevice) obj).getAddress().equals(this.mAddress)) {
return true;
}
return false;
return ((GBDevice) obj).getAddress().equals(this.mAddress);
}
@Override