Loading core/java/android/companion/virtual/VirtualDeviceManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,10 @@ public final class VirtualDeviceManager { /** * Called when the top activity is changed. * * <p>Note: When there are no activities running on the virtual display, the * {@link #onDisplayEmpty(int)} will be called. If the value topActivity is cached, it * should be cleared when {@link #onDisplayEmpty(int)} is called. * * @param displayId The display ID on which the activity change happened. * @param topActivity The component name of the top activity. */ Loading services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java +4 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,10 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController @Override public void onTopActivityChanged(ComponentName topActivity, int uid) { if (mActivityListener != null) { // Don't send onTopActivityChanged() callback when topActivity is null because it's defined // as @NonNull in ActivityListener interface. Sends onDisplayEmpty() callback instead when // there is no activity running on virtual display. if (mActivityListener != null && topActivity != null) { // Post callback on the main thread so it doesn't block activity launching mHandler.post(() -> mActivityListener.onTopActivityChanged(Display.INVALID_DISPLAY, topActivity)); Loading Loading
core/java/android/companion/virtual/VirtualDeviceManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,10 @@ public final class VirtualDeviceManager { /** * Called when the top activity is changed. * * <p>Note: When there are no activities running on the virtual display, the * {@link #onDisplayEmpty(int)} will be called. If the value topActivity is cached, it * should be cleared when {@link #onDisplayEmpty(int)} is called. * * @param displayId The display ID on which the activity change happened. * @param topActivity The component name of the top activity. */ Loading
services/companion/java/com/android/server/companion/virtual/GenericWindowPolicyController.java +4 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,10 @@ public class GenericWindowPolicyController extends DisplayWindowPolicyController @Override public void onTopActivityChanged(ComponentName topActivity, int uid) { if (mActivityListener != null) { // Don't send onTopActivityChanged() callback when topActivity is null because it's defined // as @NonNull in ActivityListener interface. Sends onDisplayEmpty() callback instead when // there is no activity running on virtual display. if (mActivityListener != null && topActivity != null) { // Post callback on the main thread so it doesn't block activity launching mHandler.post(() -> mActivityListener.onTopActivityChanged(Display.INVALID_DISPLAY, topActivity)); Loading