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

Commit b647984f authored by dooyoung.hwang's avatar dooyoung.hwang Committed by Dooyoung Hwang
Browse files

Fix issue that Overview key doesn't work at secondary user

If user captures screenshot, screenshot process is started. Screenshot
process also starts services that is defined SERVICES_PER_USER.
As a result Recents class's object is unexpectedly constucted from
screenshot process, and cause to connect with system-user's SystemUI
with mUserToSystemServiceConnection. So, binder proxy from system-user's
SystemUI to secondary-user's SystemUI is replaced with proxy to
screenshot process. In this case Overview key doesn't work at all
until reboot.

Bug:30340532
Change-Id: I84b8b4a02ac3ff781e06d57be19cff56efa76521
parent c4856bd7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@

package com.android.systemui;

import android.app.ActivityThread;
import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.res.Configuration;
import android.os.Process;
import android.os.SystemProperties;
@@ -105,6 +107,13 @@ public class SystemUIApplication extends Application {
                }
            }, filter);
        } else {
            // We don't need to startServices for sub-process that is doing some tasks.
            // (screenshots, sweetsweetdesserts or tuner ..)
            String processName = ActivityThread.currentProcessName();
            ApplicationInfo info = getApplicationInfo();
            if (processName != null && processName.startsWith(info.processName + ":")) {
                return;
            }
            // For a secondary user, boot-completed will never be called because it has already
            // been broadcasted on startup for the primary SystemUI process.  Instead, for
            // components which require the SystemUI component to be initialized per-user, we