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

Commit 7c610aaa authored by Tiger Huang's avatar Tiger Huang
Browse files

Let System UI show on external displays (1/3)

Let each display have one status bar and one navigation bar. This is
so on each display, status bar and navigation bar can be laid out with
apps and produce proper insets.

Bug: 117474929
Test: atest com.android.server.wm
Test: Watch YouTube video in fullscreen mode, and see if status bar
      and navigation will be hidden as expected. Swipe on the edge
      of screen and see if status bar and navigation bar are both
      shown as expected.

Change-Id: I1550659b7cd1dd1676bf04483c5b68376ef42905
parent 0b69021d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12162,7 +12162,7 @@ public final class Settings {
        /**
         * Defines global runtime overrides to window policy.
         *
         * See {@link com.android.server.policy.PolicyControl} for value format.
         * See {@link com.android.server.wm.PolicyControl} for value format.
         *
         * @hide
         */
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ interface IWindowManager
    /**
     * Called by the status bar to notify Views of changes to System UI visiblity.
     */
    oneway void statusBarVisibilityChanged(int visibility);
    oneway void statusBarVisibilityChanged(int displayId, int visibility);

    /**
     * Called by System UI to notify of changes to the visibility of Recents.
+10 −10
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ message KeyguardServiceDelegateProto {
message WindowManagerPolicyProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    optional int32 last_system_ui_flags = 1;
    optional int32 last_system_ui_flags = 1 [deprecated=true];
    enum UserRotationMode {
        USER_ROTATION_FREE = 0;
        USER_ROTATION_LOCKED = 1;
@@ -108,18 +108,18 @@ message WindowManagerPolicyProto {
    optional bool screen_on_fully = 5;
    optional bool keyguard_draw_complete = 6;
    optional bool window_manager_draw_complete = 7;
    optional string focused_app_token = 8;
    optional IdentifierProto focused_window = 9;
    optional IdentifierProto top_fullscreen_opaque_window = 10;
    optional IdentifierProto top_fullscreen_opaque_or_dimming_window = 11;
    optional string focused_app_token = 8 [deprecated=true];
    optional IdentifierProto focused_window = 9 [deprecated=true];
    optional IdentifierProto top_fullscreen_opaque_window = 10 [deprecated=true];
    optional IdentifierProto top_fullscreen_opaque_or_dimming_window = 11 [deprecated=true];
    optional bool keyguard_occluded = 12;
    optional bool keyguard_occluded_changed = 13;
    optional bool keyguard_occluded_pending = 14;
    optional bool force_status_bar = 15;
    optional bool force_status_bar_from_keyguard = 16;
    optional BarControllerProto status_bar = 17;
    optional BarControllerProto navigation_bar = 18;
    optional WindowOrientationListenerProto orientation_listener = 19;
    optional bool force_status_bar = 15 [deprecated=true];
    optional bool force_status_bar_from_keyguard = 16 [deprecated=true];
    optional BarControllerProto status_bar = 17 [deprecated=true];
    optional BarControllerProto navigation_bar = 18 [deprecated=true];
    optional WindowOrientationListenerProto orientation_listener = 19 [deprecated=true];
    optional KeyguardServiceDelegateProto keyguard_delegate = 20;
}

+4 −4
Original line number Diff line number Diff line
@@ -17,6 +17,9 @@
package com.android.systemui.shared.system;

import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_BOTTOM;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_LEFT;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_RIGHT;

import android.app.WindowConfiguration;
import android.graphics.Rect;
@@ -26,10 +29,6 @@ import android.util.Log;
import android.view.WindowManager;
import android.view.WindowManagerGlobal;

import static android.view.WindowManagerPolicyConstants.NAV_BAR_RIGHT;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_BOTTOM;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_LEFT;

import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecsFuture;
import com.android.systemui.shared.recents.view.RecentsTransition;

@@ -179,6 +178,7 @@ public class WindowManagerWrapper {
     */
    public int getNavBarPosition() {
        try {
            // TODO: Use WindowManagerService.getNavBarPosition(int displayId)
            return WindowManagerGlobal.getWindowManagerService().getNavBarPosition();
        } catch (RemoteException e) {
            Log.w(TAG, "Failed to get nav bar position");
+1 −0
Original line number Diff line number Diff line
@@ -904,6 +904,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
        boolean isRtl = (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL);
        int navBarPos = 0;
        try {
            // TODO: Use WindowManagerService.getNavBarPosition(int displayId)
            navBarPos = WindowManagerGlobal.getWindowManagerService().getNavBarPosition();
        } catch (RemoteException e) {
            Slog.e(TAG, "Failed to get nav bar position.", e);
Loading