1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-27 19:15: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) { public void onReceive(Context context, Intent intent) {
String action = intent.getAction(); String action = intent.getAction();
if (GBDevice.ACTION_DEVICE_CHANGED.equals(action)) { if (GBDevice.ACTION_DEVICE_CHANGED.equals(action)) {
device = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE); final GBDevice changedDevice = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE);
if (device != null) { if (changedDevice != null && changedDevice.equals(device)) {
refreshBusyState(device); refreshBusyState(device);
if (!device.isInitialized()) { if (!device.isInitialized()) {
setInstallEnabled(false); setInstallEnabled(false);

View File

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