Don't call onNullBinding when the service host is dead

Bug: 189038850
Test: atest CtsAppTestCases
Change-Id: I8bcdaf545ee8ca46327fc25c14d9821e288600a4
This commit is contained in:
Jing Ji
2021-05-26 13:59:33 -07:00
parent 87d4c9a9ca
commit 980dc5ae12

View File

@@ -2056,13 +2056,14 @@ public final class LoadedApk {
}
if (dead) {
mConnection.onBindingDied(name);
}
// If there is a new viable service, it is now connected.
if (service != null) {
mConnection.onServiceConnected(name, service);
} else {
// The binding machinery worked, but the remote returned null from onBind().
mConnection.onNullBinding(name);
// If there is a new viable service, it is now connected.
if (service != null) {
mConnection.onServiceConnected(name, service);
} else {
// The binding machinery worked, but the remote returned null from onBind().
mConnection.onNullBinding(name);
}
}
}