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

Commit b7b32be9 authored by Saumya Prakash's avatar Saumya Prakash
Browse files

Don't let TouchInteractionService get created for the System user

In HSUM mode, the system user and the main user both had TouchInteractionServices being
created. These would create 2 Taskbar windows leading to the 2 back
arrows showing up. In this change, we avoid creating a
TouchInteractionService for the System user as it is not intended to be
there.

Fix: 341047445
Test: Factory reset a device with HSUM build and ensure only one back
arrow shows up. Ensure that non-HSUM builds are unaffected.
Flag: EXEMPT bugfix

Change-Id: I81574f198717d3e1e6c853bbf40fe1de43737f71
parent a5971de4
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -883,11 +883,21 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            return;
        }
        mHandler.removeCallbacks(mConnectionRunnable);

        // Avoid creating TouchInteractionService because the System user in HSUM mode does not
        // interact with UI elements
        UserHandle currentUser = UserHandle.of(mUserTracker.getUserId());
        if (UserManager.isHeadlessSystemUserMode() && currentUser.isSystem()) {
            Log.w(TAG_OPS,
                    "Skipping connection to TouchInteractionService for the System user in HSUM "
                            + "mode.");
            return;
        }
        try {
            mBound = mContext.bindServiceAsUser(mQuickStepIntent,
                    mOverviewServiceConnection,
                    Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE,
                    UserHandle.of(mUserTracker.getUserId()));
                    currentUser);
        } catch (SecurityException e) {
            Log.e(TAG_OPS, "Unable to bind because of security error", e);
        }