Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b1d346b authored by Matthew Ng's avatar Matthew Ng
Browse files

Creating new user correctly connects to the system OverviewProxy

When creating a new user, it creates a new OverviewServiceProxy which
connects to launcher instead of the system user version. Since the new
proxy does not have any callbacks connected to it, launcher cannot send
any data to change systemui. Preventing the new proxy from connecting
allows the original to connect.

Test: manual, create new user, wait for connection, play with quick step
Change-Id: I0838fe8294c7a3ee89062c0c9855caf5ab52482b
Fixes: 74001992
parent 341c2366
Loading
Loading
Loading
Loading
+11 −7
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ import android.view.SurfaceControl;
import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.DockedFirstAnimationFrameEvent;
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.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.GraphicBufferCompat;
import com.android.systemui.shared.system.GraphicBufferCompat;
@@ -201,9 +202,11 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        mConnectionBackoffAttempts = 0;
        mConnectionBackoffAttempts = 0;
        mLauncherComponentName = ComponentName
        mLauncherComponentName = ComponentName
                .unflattenFromString(context.getString(R.string.config_overviewServiceComponent));
                .unflattenFromString(context.getString(R.string.config_overviewServiceComponent));
        mDeviceProvisionedController.addCallback(mDeviceProvisionedCallback);


        // Listen for the package update changes.
        // Listen for the package update changes.
        if (SystemServicesProxy.getInstance(context)
                .isSystemUser(mDeviceProvisionedController.getCurrentUser())) {
            mDeviceProvisionedController.addCallback(mDeviceProvisionedCallback);
            IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
            IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
            filter.addDataScheme("package");
            filter.addDataScheme("package");
            filter.addDataSchemeSpecificPart(mLauncherComponentName.getPackageName(),
            filter.addDataSchemeSpecificPart(mLauncherComponentName.getPackageName(),
@@ -211,6 +214,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
            filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
            mContext.registerReceiver(mLauncherAddedReceiver, filter);
            mContext.registerReceiver(mLauncherAddedReceiver, filter);
        }
        }
    }


    public void startConnectionToCurrentUser() {
    public void startConnectionToCurrentUser() {
        if (mHandler.getLooper() != Looper.myLooper()) {
        if (mHandler.getLooper() != Looper.myLooper()) {