diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java index 5b25f0525d92f..ba50c663a6bd1 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 930ed795af9fc..4b4db8236d1e3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -78,6 +78,7 @@ import android.view.accessibility.AccessibilityManager; import com.android.internal.app.AssistUtils; import com.android.internal.os.BackgroundThread; import com.android.systemui.R; +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; @@ -413,8 +414,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(); }