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

Commit 12b62f34 authored by Saumya Prakash's avatar Saumya Prakash Committed by Android (Google) Code Review
Browse files

Merge "Don't let TouchInteractionService get created for the System user" into main

parents c8821625 b7b32be9
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -894,11 +894,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);
        }