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

Commit b1d985de authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Resolve car dock home activities properly."

parents 894ff892 f56bef14
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -4789,8 +4790,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        ActivityInfo ai = null;
        ResolveInfo info = mContext.getPackageManager().resolveActivityAsUser(
                intent,
                PackageManager.MATCH_DEFAULT_ONLY,
                UserHandle.USER_CURRENT);
                PackageManager.MATCH_DEFAULT_ONLY | PackageManager.GET_META_DATA,
                getCurrentUserId());
        if (info != null) {
            ai = info.activityInfo;
        }
@@ -4805,6 +4806,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        return null;
    }

    private int getCurrentUserId() {
        try {
            UserInfo user = ActivityManagerNative.getDefault().getCurrentUser();
            return user != null ? user.id : UserHandle.USER_NULL;
        } catch (RemoteException e) {
            // noop
        }
        return UserHandle.USER_NULL;
    }

    void startDockOrHome() {
        awakenDreams();