mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-20 00:18:28 +00:00
Catch possible exceptions when the receiver is already unregistered
This commit is contained in:
parent
d33b077a13
commit
c8fe0f5524
@ -116,7 +116,10 @@ public final class APKInstall {
|
|||||||
if (onFailure != null) {
|
if (onFailure != null) {
|
||||||
onFailure.run();
|
onFailure.run();
|
||||||
}
|
}
|
||||||
context.getApplicationContext().unregisterReceiver(this);
|
try {
|
||||||
|
context.getApplicationContext().unregisterReceiver(this);
|
||||||
|
} catch (IllegalArgumentException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
@ -126,7 +129,10 @@ public final class APKInstall {
|
|||||||
private void onSuccess(Context context) {
|
private void onSuccess(Context context) {
|
||||||
if (onSuccess != null)
|
if (onSuccess != null)
|
||||||
onSuccess.run();
|
onSuccess.run();
|
||||||
context.getApplicationContext().unregisterReceiver(this);
|
try {
|
||||||
|
context.getApplicationContext().unregisterReceiver(this);
|
||||||
|
} catch (IllegalArgumentException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user