Move container focusability logic to ActivityStackSupervisor.

A number of factors are considered across the container hierarchy
when determining whether the container can be focused. Previously,
windowing mode consideration was added to the activity record, but
not stack. This led to inconsistent behavior when queried.

This changelist combines the logic and moves it to
ActivityStackSupervisor, where it can be invoked by any container.

Change-Id: I0d16faa069fd05500d39cd1619de9f8c488daa25
Fixes: 77708107
Test: atest FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests#testFocusability
Test: atest CtsActivityManagerDeviceTestCases:android.server.am.lifecycle.ActivityLifecycleTests#testPausedWhenRestartedFromInNonFocusedStack
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index e539bf8..eb7e9c8 100644
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -1198,10 +1198,7 @@
     }
 
     boolean isFocusable() {
-        if (inSplitScreenPrimaryWindowingMode() && mStackSupervisor.mIsDockMinimized) {
-            return false;
-        }
-        return getWindowConfiguration().canReceiveKeys() || isAlwaysFocusable();
+        return mStackSupervisor.isFocusable(this, isAlwaysFocusable());
     }
 
     boolean isResizeable() {