Fix service binding for singleUser services
Bug: 7137147
No need to try to retrieve the service again as user 0.
Change-Id: I910aca3fae91dc709ef2265ed0fce09f46f5b769
diff --git a/services/java/com/android/server/am/ActiveServices.java b/services/java/com/android/server/am/ActiveServices.java
index 3bb95a8..aefc264 100644
--- a/services/java/com/android/server/am/ActiveServices.java
+++ b/services/java/com/android/server/am/ActiveServices.java
@@ -478,12 +478,6 @@
if (res.record == null) {
return -1;
}
- if (mAm.isSingleton(res.record.processName, res.record.appInfo,
- res.record.serviceInfo.name, res.record.serviceInfo.flags)) {
- userId = 0;
- res = retrieveServiceLocked(service, resolvedType, Binder.getCallingPid(),
- Binder.getCallingUid(), 0, true);
- }
ServiceRecord s = res.record;
final long origId = Binder.clearCallingIdentity();