Merge "Fix adb install" into jb-mr1-dev

This commit is contained in:
Amith Yamasani
2012-08-27 12:24:24 -07:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 2 deletions

View File

@@ -729,7 +729,7 @@ public class ActiveServices {
ServiceInfo sInfo =
rInfo != null ? rInfo.serviceInfo : null;
if (sInfo == null) {
Slog.w(TAG, "Unable to start service " + service +
Slog.w(TAG, "Unable to start service " + service + " U=" + userId +
": not found");
return null;
}

View File

@@ -473,6 +473,9 @@ public class PackageManagerService extends IPackageManager.Stub {
mContainerServiceUserId = 0;
if (mPendingInstalls.size() > 0) {
mContainerServiceUserId = mPendingInstalls.get(0).getUser().getIdentifier();
if (mContainerServiceUserId == UserHandle.USER_ALL) {
mContainerServiceUserId = 0;
}
}
if (mContext.bindService(service, mDefContainerConn,
Context.BIND_AUTO_CREATE, mContainerServiceUserId)) {
@@ -554,7 +557,10 @@ public class PackageManagerService extends IPackageManager.Stub {
if (params != null) {
// Check if we're connected to the correct service, if it's an install
// request.
if (params.getUser().getIdentifier() != mContainerServiceUserId) {
final int installFor = params.getUser().getIdentifier();
if (installFor != mContainerServiceUserId
&& (installFor == UserHandle.USER_ALL
&& mContainerServiceUserId != 0)) {
mHandler.sendEmptyMessage(MCS_RECONNECT);
return;
}