HealthServiceWrapperAidl fix NPE
It is possible that mRegCallback is null. Handle the case when it is accessed without null check. The mRegCallback is null because StatsPullAtomService initializes HealthServiceWrapper with null callback. Test: TH Bug: 232899396 Change-Id: I45c4ebca8c5612fdfbab8ffd28b9c2799d74869a Signed-off-by: Yifan Hong <elsk@google.com> Merged-In: I45c4ebca8c5612fdfbab8ffd28b9c2799d74869a
This commit is contained in:
@@ -208,7 +208,9 @@ class HealthServiceWrapperAidl extends HealthServiceWrapper {
|
||||
if (Objects.equals(newBinder, oldBinder)) return;
|
||||
|
||||
Slog.i(TAG, "New health AIDL HAL service registered");
|
||||
mRegCallback.onRegistration(oldService, newService);
|
||||
if (mRegCallback != null) {
|
||||
mRegCallback.onRegistration(oldService, newService);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user