Merge "Creating new user correctly connects to the system OverviewProxy"

This commit is contained in:
TreeHugger Robot
2018-03-03 00:13:40 +00:00
committed by Android (Google) Code Review

View File

@@ -36,6 +36,7 @@ import android.view.SurfaceControl;
import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.GraphicBufferCompat;
@@ -201,15 +202,18 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
mConnectionBackoffAttempts = 0;
mLauncherComponentName = ComponentName
.unflattenFromString(context.getString(R.string.config_overviewServiceComponent));
mDeviceProvisionedController.addCallback(mDeviceProvisionedCallback);
// Listen for the package update changes.
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addDataScheme("package");
filter.addDataSchemeSpecificPart(mLauncherComponentName.getPackageName(),
PatternMatcher.PATTERN_LITERAL);
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
mContext.registerReceiver(mLauncherAddedReceiver, filter);
if (SystemServicesProxy.getInstance(context)
.isSystemUser(mDeviceProvisionedController.getCurrentUser())) {
mDeviceProvisionedController.addCallback(mDeviceProvisionedCallback);
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addDataScheme("package");
filter.addDataSchemeSpecificPart(mLauncherComponentName.getPackageName(),
PatternMatcher.PATTERN_LITERAL);
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
mContext.registerReceiver(mLauncherAddedReceiver, filter);
}
}
public void startConnectionToCurrentUser() {