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

Commit bb478f97 authored by Hai Zhang's avatar Hai Zhang
Browse files

DO NOT MERGE Return the preferred home activity first to honor persistent preferred activity.

Bug: 237330774
Test: manual
Change-Id: Ieb8c6b7307338149b87f1b84968f6c1ccaac1d91
parent 7359d321
Loading
Loading
Loading
Loading
+20 −17
Original line number Diff line number Diff line
@@ -1192,8 +1192,9 @@ public class ComputerEngine implements Computer {
        }
        allHomeCandidates.addAll(resolveInfos);

        String packageName = mDefaultAppProvider.getDefaultHome(userId);
        if (packageName == null) {
        String packageName = null;
        // Workaround for b/237330774 in T: return the preferred activity first to honor
        // persistent preferred activity.
        // Role changes are not and cannot be atomic because its implementation lives inside
        // a system app, so when the home role changes, there is a window when the previous
        // role holder is removed and the new role holder is granted the preferred activity,
@@ -1210,6 +1211,8 @@ public class ComputerEngine implements Computer {
        if (preferredResolveInfo != null && preferredResolveInfo.activityInfo != null) {
            packageName = preferredResolveInfo.activityInfo.packageName;
        }
        if (packageName == null) {
            packageName = mDefaultAppProvider.getDefaultHome(userId);
        }
        if (packageName == null) {
            return null;