diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java index 3c245b46e030b..27fcf2a5aba72 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java @@ -61,6 +61,8 @@ import com.android.systemui.recents.tv.RecentsTvImpl; import com.android.systemui.stackdivider.Divider; import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; /** @@ -77,6 +79,12 @@ public class Recents extends SystemUI public final static int BIND_TO_SYSTEM_USER_RETRY_DELAY = 5000; public final static int RECENTS_GROW_TARGET_INVALID = -1; + public final static Set RECENTS_ACTIVITIES = new HashSet<>(); + static { + RECENTS_ACTIVITIES.add(RecentsImpl.RECENTS_ACTIVITY); + RECENTS_ACTIVITIES.add(RecentsTvImpl.RECENTS_TV_ACTIVITY); + } + // Purely for experimentation private final static String RECENTS_OVERRIDE_SYSPROP_KEY = "persist.recents_override_pkg"; private final static String ACTION_SHOW_RECENTS = "com.android.systemui.recents.ACTION_SHOW"; diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java index c91b06099d666..8137dc62685f3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -81,6 +81,7 @@ import com.android.internal.os.BackgroundThread; import com.android.systemui.R; import com.android.systemui.pip.tv.PipMenuActivity; import com.android.systemui.pip.tv.PipOnboardingActivity; +import com.android.systemui.recents.Recents; import com.android.systemui.recents.RecentsDebugFlags; import com.android.systemui.recents.RecentsImpl; import com.android.systemui.recents.model.Task; @@ -416,8 +417,7 @@ public class SystemServicesProxy { } return (homeStackVisibleNotOccluded && topActivity != null && topActivity.getPackageName().equals(RecentsImpl.RECENTS_PACKAGE) - && (topActivity.getClassName().equals(RecentsImpl.RECENTS_ACTIVITY) - || topActivity.getClassName().equals(RecentsTvImpl.RECENTS_TV_ACTIVITY))); + && Recents.RECENTS_ACTIVITIES.contains(topActivity.getClassName())); } catch (RemoteException e) { e.printStackTrace(); }