Fixes overview connecting to correct launcher when changing users

When switching users, it would always connect to the system user's
launcher because the user was gained incorrectly so the new user would
lose its recents button and other issues may occur. Getting the actual
user fixes it to connect to the current user's launcher.

Bug: 67957962
Test: change users
Change-Id: If49b9bea3920242c2653913b127ac65a16c13b92
This commit is contained in:
Matthew Ng
2018-02-01 16:54:16 -08:00
parent 7902b4a1b2
commit 09e6fbde50

View File

@@ -199,7 +199,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
launcherServiceIntent.setComponent(mLauncherComponentName);
boolean bound = mContext.bindServiceAsUser(launcherServiceIntent,
mOverviewServiceConnection, Context.BIND_AUTO_CREATE,
UserHandle.getUserHandleForUid(mDeviceProvisionedController.getCurrentUser()));
UserHandle.of(mDeviceProvisionedController.getCurrentUser()));
if (!bound) {
// Retry after exponential backoff timeout
final long timeoutMs = (long) Math.scalb(BACKOFF_MILLIS, mConnectionBackoffAttempts);