Merge "Revert "Revert "[AC] Fix NPE. If the client sends multiple unregister requests at the same time, the client request could be null before the next request is processed.""" into udc-dev
This commit is contained in:
@@ -60,6 +60,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* System service for managing {@link AmbientContextEvent}s.
|
||||
@@ -595,7 +596,7 @@ public class AmbientContextManagerService extends
|
||||
|
||||
synchronized (mLock) {
|
||||
for (ClientRequest cr : mExistingClientRequests) {
|
||||
if (cr.getPackageName().equals(callingPackage)) {
|
||||
if ((cr != null) && cr.getPackageName().equals(callingPackage)) {
|
||||
AmbientContextManagerPerUserService service =
|
||||
getAmbientContextManagerPerUserServiceForEventTypes(
|
||||
UserHandle.getCallingUserId(),
|
||||
|
||||
Reference in New Issue
Block a user