Fixing possible NullPointerException

Test: manul testing
Change-Id: I448c3d31c69a7c1649bfe30e864ad053cd8987bb
Bug: b/263304156
This commit is contained in:
Kunal Malhotra
2023-02-23 00:56:44 +00:00
parent 474b46c43d
commit c2c86d0b9e

View File

@@ -316,6 +316,10 @@ public class ForegroundServiceTypeLoggerModule {
// then we should care, otherwise we assume
// it's not related to any FGS
UidState uidState = mUids.get(uid);
if (uidState == null) {
Log.w(TAG, "API event end called before start!");
return -1;
}
if (uidState.mOpenWithFgsCount.contains(apiType)) {
// are there any calls that started with an FGS?
if (uidState.mOpenWithFgsCount.get(apiType) != 0) {