Skip to content

Commit a84a4af

Browse files
Amith YamasaniAndroid (Google) Code Review
authored andcommitted
Merge "Fix adb install" into jb-mr1-dev
2 parents 63dc027 + 2b91465 commit a84a4af

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

services/java/com/android/server/am/ActiveServices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ private ServiceLookupResult retrieveServiceLocked(Intent service,
729729
ServiceInfo sInfo =
730730
rInfo != null ? rInfo.serviceInfo : null;
731731
if (sInfo == null) {
732-
Slog.w(TAG, "Unable to start service " + service +
732+
Slog.w(TAG, "Unable to start service " + service + " U=" + userId +
733733
": not found");
734734
return null;
735735
}

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ private boolean connectToService() {
473473
mContainerServiceUserId = 0;
474474
if (mPendingInstalls.size() > 0) {
475475
mContainerServiceUserId = mPendingInstalls.get(0).getUser().getIdentifier();
476+
if (mContainerServiceUserId == UserHandle.USER_ALL) {
477+
mContainerServiceUserId = 0;
478+
}
476479
}
477480
if (mContext.bindService(service, mDefContainerConn,
478481
Context.BIND_AUTO_CREATE, mContainerServiceUserId)) {
@@ -554,7 +557,10 @@ void doHandleMessage(Message msg) {
554557
if (params != null) {
555558
// Check if we're connected to the correct service, if it's an install
556559
// request.
557-
if (params.getUser().getIdentifier() != mContainerServiceUserId) {
560+
final int installFor = params.getUser().getIdentifier();
561+
if (installFor != mContainerServiceUserId
562+
&& (installFor == UserHandle.USER_ALL
563+
&& mContainerServiceUserId != 0)) {
558564
mHandler.sendEmptyMessage(MCS_RECONNECT);
559565
return;
560566
}

0 commit comments

Comments
 (0)